Contract 0x19f870bD94A34b3adAa9CaA439d333DA18d6812A 3

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x369fe184f668274c06109e25c7740e2d8d90b2847afc90ac1f9f7c52d7f51683Upgrade Installa...437702862023-06-11 0:45:3417 mins ago0x735194b0ff3d9fca8561770ebf484eac90b46647 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.07528755150
0xc12078264a01d48581c030f1da8186315a5f00bd9801636c0df3013b32fecfd0Reduce Upgrade T...437701562023-06-11 0:40:5821 mins ago0x735194b0ff3d9fca8561770ebf484eac90b46647 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.07742616140
0x391cdb8ecce044d09ef256bdfd7d345442921201fa47409a8fe42138711ab9bfUpgrade Installa...437701082023-06-11 0:39:1623 mins ago0x67da637a5d8db19b16235801e2c768f369d95a0c IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.197863583596 369.067915392
0x76766ce2caf3a88930b9fe01b205e12185d7090cbf0a04276cc0e38bc087f9ceFinalize Upgrade...437700562023-06-11 0:37:2625 mins ago0x67da637a5d8db19b16235801e2c768f369d95a0c IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.070104716128 154.431661711
0xc05a458ed4d8fa95b68a1240f52b5d45cac69efadafa5600e35ebf5f6cefc4caUpgrade Installa...437699672023-06-11 0:34:1628 mins ago0x735194b0ff3d9fca8561770ebf484eac90b46647 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.07505806140
0x61c749db972e00920b80e0ad56252e2e91942cda9b0d4ebed9863dae7db4cf77Finalize Upgrade...437698692023-06-11 0:29:4433 mins ago0x735194b0ff3d9fca8561770ebf484eac90b46647 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.06402802140
0x752a976ea42b6183aa5525dfbd8f657f4634ffce6d095cd5ff696ed354e461e5Upgrade Installa...437696812023-06-11 0:22:0240 mins ago0x5cc81f1afa43f8f3c65fc9ce96d5a0568f4e285f IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.128063874364 151.823491698
0xaf59dfba68080fb399a5b4140bb9f87acbf00b5e83d04973bc8ebce8d12069a1Upgrade Installa...437696632023-06-11 0:21:2241 mins ago0xc54a79174cb43729e65a95e41028c9bac7ab4592 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.221636472574 367.919988205
0xff92842049500580db28851c1ece282540227c3503d04645ca281f0430cf295cUpgrade Installa...437695032023-06-11 0:15:4247 mins ago0x46860b4dfe30ce16e6c3100c1be4344cd5941959 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.060731957121
0x1aeac442c846273343790e08a563ac7088d72ec7dd07e72159f39c8f9f0292d9Upgrade Installa...437694842023-06-11 0:15:0247 mins ago0x984c48852f92288bd1afd6ff5d9c26e3d0a9339a IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.076532646186 152.48068144
0xf52c25ad591212cbc9d5f1231415833288854a45a87ee4c55185b76649882479Upgrade Installa...437694722023-06-11 0:14:3848 mins ago0x5cc81f1afa43f8f3c65fc9ce96d5a0568f4e285f IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.131226472666 180.635776655
0xf45e3718c030e5bc11529976fae6164ca07bbbbf431691ebed335c14f08eba23Upgrade Installa...437694322023-06-11 0:12:4050 mins ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.230078787737 458.411029452
0x05a7a327424095d78cf44a35c88d890e7d5798f806a1e3abf6f218cae65e40f9Finalize Upgrade...437694242023-06-11 0:12:2450 mins ago0x984c48852f92288bd1afd6ff5d9c26e3d0a9339a IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.083373315021 160.12482791
0x1df1656efd88dc211eceb2902abee19efe149a20f0958088dd52c8a7b912e4f5Upgrade Installa...437694132023-06-11 0:12:0050 mins ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.18130357479 385.891864697
0x6cbe5150c482850a6e4a6a5df7cb8dc34597e620fedfcc392aac1e796aa5e392Upgrade Installa...437693132023-06-11 0:07:5654 mins ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.271200746361 451.706129265
0x38e821afe616e4c89e4ebf519a062217b45b4333d708d46ecb37a1eb8f055b59Craft Installati...437692152023-06-11 0:03:4559 mins ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.173435635042 403.820453337
0x4068eacbedaafb211f6c9ec60739f2c576da70ab553f4e300b1e97f87950d4a8Craft Installati...437691962023-06-11 0:03:0559 mins ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.126761038694 426.55924937
0x7d595001e74725be1cd363a52a0f66bcb9c9b3dc3acd6ba6e27eacb14a9512f6Craft Installati...437691712023-06-11 0:02:131 hr ago0x5aae22f14eca19fb5a19be0004276aa375f255a3 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.127112065256 427.740476885
0x8ad81130b574194e543117d3145916df2916fa2a7c4cf8d4d5944acc92118754Upgrade Installa...437687642023-06-10 23:46:471 hr 16 mins ago0xe1a1d5c32888c5b140917b296e82cf3a448f37a6 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.07386652130
0x2388f969d2232c03009bc8ebfd5a29f1654854bd75eb49221269df0addd55b70Finalize Upgrade...437687222023-06-10 23:45:191 hr 17 mins ago0xe1a1d5c32888c5b140917b296e82cf3a448f37a6 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.06701344130
0x9318d8822d251f24f204fc51c584a29d04b233a8986fb15dfb7b0d179e5c4f2dUpgrade Installa...437687082023-06-10 23:44:491 hr 18 mins ago0xe1a1d5c32888c5b140917b296e82cf3a448f37a6 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.07386496130
0x6cb59370b46f09410675173df939c403c136fea1e321d059b6627dfb787bb1deFinalize Upgrade...437686802023-06-10 23:43:491 hr 19 mins ago0xe1a1d5c32888c5b140917b296e82cf3a448f37a6 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.06634836130
0x9ebbb556ce6f0adbe39ad722e24faa61ba00a649de7f6d6289f7f8cef3048eb3Upgrade Installa...437681442023-06-10 23:22:411 hr 40 mins ago0x69800c3279115d92523ae66261600c6193e25950 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.071351239496 142.154048674
0xc48ec571c900a43b0a52b8e2f3ae091b569a5a15a41fea8b6ad201ff376ec27aFinalize Upgrade...437681122023-06-10 23:21:331 hr 41 mins ago0x69800c3279115d92523ae66261600c6193e25950 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.084379021239 150.527102934
0x2d0a72f313101c2140cd5d2aec179d8de9939d720cd44a059629f5ce25367effUpgrade Installa...437676522023-06-10 23:04:081 hr 58 mins ago0xcbef46a7cbe1f46a94ab77501eaa32596ab3c538 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.092584301227 154.203338465
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
InstallationDiamond

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : InstallationDiamond.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
*
* Implementation of a diamond.
/******************************************************************************/

import {LibDiamond} from "../libraries/LibDiamond.sol";
import {IDiamondCut} from "../interfaces/IDiamondCut.sol";
import {LibAppStorageInstallation, InstallationAppStorage} from "../libraries/AppStorageInstallation.sol";

contract InstallationDiamond {
  constructor(
    address _contractOwner,
    address _diamondCutFacet,
    address _realmDiamond
  ) payable {
    LibDiamond.setContractOwner(_contractOwner);

    // Add the diamondCut external function from the diamondCutFacet
    IDiamondCut.FacetCut[] memory cut = new IDiamondCut.FacetCut[](1);
    bytes4[] memory functionSelectors = new bytes4[](1);
    functionSelectors[0] = IDiamondCut.diamondCut.selector;
    cut[0] = IDiamondCut.FacetCut({facetAddress: _diamondCutFacet, action: IDiamondCut.FacetCutAction.Add, functionSelectors: functionSelectors});
    LibDiamond.diamondCut(cut, address(0), "");

    InstallationAppStorage storage s = LibAppStorageInstallation.diamondStorage();
    s.realmDiamond = _realmDiamond;
  }

  // Find facet for function that is called and execute the
  // function if a facet is found and return any value.
  fallback() external payable {
    LibDiamond.DiamondStorage storage ds;
    bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;
    assembly {
      ds.slot := position
    }
    address facet = address(bytes20(ds.facets[msg.sig]));
    require(facet != address(0), "Diamond: Function does not exist");
    assembly {
      calldatacopy(0, 0, calldatasize())
      let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
      returndatacopy(0, 0, returndatasize())
      switch result
      case 0 {
        revert(0, returndatasize())
      }
      default {
        return(0, returndatasize())
      }
    }
  }

  receive() external payable {}
}

File 2 of 4 : LibDiamond.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/
import {IDiamondCut} from "../interfaces/IDiamondCut.sol";

library LibDiamond {
    bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");

    struct DiamondStorage {
        // maps function selectors to the facets that execute the functions.
        // and maps the selectors to their position in the selectorSlots array.
        // func selector => address facet, selector position
        mapping(bytes4 => bytes32) facets;
        // array of slots of function selectors.
        // each slot holds 8 function selectors.
        mapping(uint256 => bytes32) selectorSlots;
        // The number of function selectors in selectorSlots
        uint16 selectorCount;
        // Used to query if a contract implements an interface.
        // Used to implement ERC-165.
        mapping(bytes4 => bool) supportedInterfaces;
        // owner of the contract
        address contractOwner;
    }

    function diamondStorage() internal pure returns (DiamondStorage storage ds) {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    function setContractOwner(address _newOwner) internal {
        DiamondStorage storage ds = diamondStorage();
        address previousOwner = ds.contractOwner;
        ds.contractOwner = _newOwner;
        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() internal view {
        require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
    }

    event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);

    bytes32 constant CLEAR_ADDRESS_MASK = bytes32(uint256(0xffffffffffffffffffffffff));
    bytes32 constant CLEAR_SELECTOR_MASK = bytes32(uint256(0xffffffff << 224));

    // Internal function version of diamondCut
    // This code is almost the same as the external diamondCut,
    // except it is using 'Facet[] memory _diamondCut' instead of
    // 'Facet[] calldata _diamondCut'.
    // The code is duplicated to prevent copying calldata to memory which
    // causes an error for a two dimensional array.
    function diamondCut(
        IDiamondCut.FacetCut[] memory _diamondCut,
        address _init,
        bytes memory _calldata
    ) internal {
        DiamondStorage storage ds = diamondStorage();
        uint256 originalSelectorCount = ds.selectorCount;
        uint256 selectorCount = originalSelectorCount;
        bytes32 selectorSlot;
        // Check if last selector slot is not full
        if (selectorCount & 7 > 0) {
            // get last selectorSlot
            selectorSlot = ds.selectorSlots[selectorCount >> 3];
        }
        // loop through diamond cut
        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
            (selectorCount, selectorSlot) = addReplaceRemoveFacetSelectors(
                selectorCount,
                selectorSlot,
                _diamondCut[facetIndex].facetAddress,
                _diamondCut[facetIndex].action,
                _diamondCut[facetIndex].functionSelectors
            );
        }
        if (selectorCount != originalSelectorCount) {
            ds.selectorCount = uint16(selectorCount);
        }
        // If last selector slot is not full
        if (selectorCount & 7 > 0) {
            ds.selectorSlots[selectorCount >> 3] = selectorSlot;
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addReplaceRemoveFacetSelectors(
        uint256 _selectorCount,
        bytes32 _selectorSlot,
        address _newFacetAddress,
        IDiamondCut.FacetCutAction _action,
        bytes4[] memory _selectors
    ) internal returns (uint256, bytes32) {
        DiamondStorage storage ds = diamondStorage();
        require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut");
        if (_action == IDiamondCut.FacetCutAction.Add) {
            enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Add facet has no code");
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                bytes4 selector = _selectors[selectorIndex];

                bytes32 oldFacet = ds.facets[selector];

                require(address(bytes20(oldFacet)) == address(0), "LibDiamondCut: Can't add function that already exists");
                // add facet for selector
                ds.facets[selector] = bytes20(_newFacetAddress) | bytes32(_selectorCount);
                uint256 selectorInSlotPosition = (_selectorCount & 7) << 5;
                // clear selector position in slot and add selector
                _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition);
                // if slot is full then write it to storage
                if (selectorInSlotPosition == 224) {
                    ds.selectorSlots[_selectorCount >> 3] = _selectorSlot;
                    _selectorSlot = 0;
                }
                _selectorCount++;
            }
        } else if (_action == IDiamondCut.FacetCutAction.Replace) {
            enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Replace facet has no code");
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                bytes4 selector = _selectors[selectorIndex];
                bytes32 oldFacet = ds.facets[selector];
                address oldFacetAddress = address(bytes20(oldFacet));
                // only useful if immutable functions exist
                require(oldFacetAddress != address(this), "LibDiamondCut: Can't replace immutable function");
                require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function");
                require(oldFacetAddress != address(0), "LibDiamondCut: Can't replace function that doesn't exist");
                // replace old facet address
                ds.facets[selector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(_newFacetAddress);
            }
        } else if (_action == IDiamondCut.FacetCutAction.Remove) {
            require(_newFacetAddress == address(0), "LibDiamondCut: Remove facet address must be address(0)");
            uint256 selectorSlotCount = _selectorCount >> 3;
            uint256 selectorInSlotIndex = _selectorCount & 7;
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                if (_selectorSlot == 0) {
                    // get last selectorSlot
                    selectorSlotCount--;
                    _selectorSlot = ds.selectorSlots[selectorSlotCount];
                    selectorInSlotIndex = 7;
                } else {
                    selectorInSlotIndex--;
                }
                bytes4 lastSelector;
                uint256 oldSelectorsSlotCount;
                uint256 oldSelectorInSlotPosition;
                // adding a block here prevents stack too deep error
                {
                    bytes4 selector = _selectors[selectorIndex];
                    bytes32 oldFacet = ds.facets[selector];
                    require(address(bytes20(oldFacet)) != address(0), "LibDiamondCut: Can't remove function that doesn't exist");
                    // only useful if immutable functions exist
                    require(address(bytes20(oldFacet)) != address(this), "LibDiamondCut: Can't remove immutable function");
                    // replace selector with last selector in ds.facets
                    // gets the last selector
                    lastSelector = bytes4(_selectorSlot << (selectorInSlotIndex << 5));
                    if (lastSelector != selector) {
                        // update last selector slot position info
                        ds.facets[lastSelector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(ds.facets[lastSelector]);
                    }
                    delete ds.facets[selector];
                    uint256 oldSelectorCount = uint16(uint256(oldFacet));
                    oldSelectorsSlotCount = oldSelectorCount >> 3;
                    oldSelectorInSlotPosition = (oldSelectorCount & 7) << 5;
                }
                if (oldSelectorsSlotCount != selectorSlotCount) {
                    bytes32 oldSelectorSlot = ds.selectorSlots[oldSelectorsSlotCount];
                    // clears the selector we are deleting and puts the last selector in its place.
                    oldSelectorSlot =
                        (oldSelectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) |
                        (bytes32(lastSelector) >> oldSelectorInSlotPosition);
                    // update storage with the modified slot
                    ds.selectorSlots[oldSelectorsSlotCount] = oldSelectorSlot;
                } else {
                    // clears the selector we are deleting and puts the last selector in its place.
                    _selectorSlot =
                        (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) |
                        (bytes32(lastSelector) >> oldSelectorInSlotPosition);
                }
                if (selectorInSlotIndex == 0) {
                    delete ds.selectorSlots[selectorSlotCount];
                    _selectorSlot = 0;
                }
            }
            _selectorCount = selectorSlotCount * 8 + selectorInSlotIndex;
        } else {
            revert("LibDiamondCut: Incorrect FacetCutAction");
        }
        return (_selectorCount, _selectorSlot);
    }

    function initializeDiamondCut(address _init, bytes memory _calldata) internal {
        if (_init == address(0)) {
            require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty");
        } else {
            require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)");
            if (_init != address(this)) {
                enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
            }
            (bool success, bytes memory error) = _init.delegatecall(_calldata);
            if (!success) {
                if (error.length > 0) {
                    // bubble up the error
                    revert(string(error));
                } else {
                    revert("LibDiamondCut: _init function reverted");
                }
            }
        }
    }

    function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
        uint256 contractSize;
        assembly {
            contractSize := extcodesize(_contract)
        }
        require(contractSize > 0, _errorMessage);
    }
}

File 3 of 4 : IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

interface IDiamondCut {
    enum FacetCutAction {Add, Replace, Remove}
    // Add=0, Replace=1, Remove=2

    struct FacetCut {
        address facetAddress;
        FacetCutAction action;
        bytes4[] functionSelectors;
    }

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _diamondCut Contains the facet addresses and function selectors
    /// @param _init The address of the contract or facet to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function diamondCut(
        FacetCut[] calldata _diamondCut,
        address _init,
        bytes calldata _calldata
    ) external;

    event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}

File 4 of 4 : AppStorageInstallation.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import {LibDiamond} from "./LibDiamond.sol";

struct InstallationType {
  //slot 1
  uint8 width;
  uint8 height;
  uint16 installationType; //0 = altar, 1 = harvester, 2 = reservoir, 3 = gotchi lodge, 4 = wall, 5 = NFT display, 6 = buildqueue booster
  uint8 level; //max level 9
  uint8 alchemicaType; //0 = none 1 = fud, 2 = fomo, 3 = alpha, 4 = kek
  uint32 spillRadius;
  uint16 spillRate;
  uint8 upgradeQueueBoost;
  uint32 craftTime; // in blocks
  uint32 nextLevelId; //the ID of the next level of this installation. Used for upgrades.
  bool deprecated; //bool
  //slot 2
  uint256[4] alchemicaCost; // [fud, fomo, alpha, kek]
  //slot 3
  uint256 harvestRate;
  //slot 4
  uint256 capacity;
  //slot 5
  uint256[] prerequisites; //IDs of installations that must be present before this installation can be added
  //slot 6
  string name;
}

struct QueueItem {
  address owner;
  uint16 installationType;
  bool claimed;
  uint40 readyBlock;
  uint256 id;
}

struct UpgradeQueue {
  address owner;
  uint16 coordinateX;
  uint16 coordinateY;
  uint40 readyBlock;
  bool claimed;
  uint256 parcelId;
  uint256 installationId;
}

struct InstallationAppStorage {
  address realmDiamond;
  address aavegotchiDiamond;
  address pixelcraft;
  address aavegotchiDAO;
  address gltr;
  address[] alchemicaAddresses;
  string baseUri;
  InstallationType[] installationTypes;
  QueueItem[] craftQueue;
  uint256 nextCraftId;
  //ERC1155 vars
  mapping(address => mapping(address => bool)) operators;
  //ERC998 vars
  mapping(address => mapping(uint256 => mapping(uint256 => uint256))) nftInstallationBalances;
  mapping(address => mapping(uint256 => uint256[])) nftInstallations;
  mapping(address => mapping(uint256 => mapping(uint256 => uint256))) nftInstallationIndexes;
  mapping(address => mapping(uint256 => uint256)) ownerInstallationBalances;
  mapping(address => uint256[]) ownerInstallations;
  mapping(address => mapping(uint256 => uint256)) ownerInstallationIndexes;
  UpgradeQueue[] upgradeQueue;
}

library LibAppStorageInstallation {
  function diamondStorage() internal pure returns (InstallationAppStorage storage ds) {
    assembly {
      ds.slot := 0
    }
  }
}

contract Modifiers {
  InstallationAppStorage internal s;

  modifier onlyOwner() {
    LibDiamond.enforceIsContractOwner();
    _;
  }

  modifier onlyRealmDiamond() {
    require(msg.sender == s.realmDiamond, "LibDiamond: Must be realm diamond");
    _;
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_contractOwner","type":"address"},{"internalType":"address","name":"_diamondCutFacet","type":"address"},{"internalType":"address","name":"_realmDiamond","type":"address"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]

60806040526040516200213538038062002135833981016040819052620000269162000e18565b6200003c836200018e60201b620000b01760201c565b604080516001808252818301909252600091816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081620000535750506040805160018082528183019092529192506000919060208083019080368337019050509050631f931c1c60e01b81600081518110620000c657620000c662000e62565b6001600160e01b031990921660209283029190910182015260408051606081019091526001600160a01b038616815290810160008152602001828152508260008151811062000119576200011962000e62565b60200260200101819052506200014c826000604051806020016040528060008152506200021260201b620001331760201c565b6000620001636200039f60201b620002a31760201c565b80546001600160a01b0319166001600160a01b03959095169490941790935550620010b79350505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b03848116918217909355604051600080516020620020a1833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54600080516020620020a18339815191529061ffff811690819060009060071615620002715750600381901c60009081526001840160205260409020545b60005b87518110156200030d57620002f383838a848151811062000299576200029962000e62565b6020026020010151600001518b8581518110620002ba57620002ba62000e62565b6020026020010151602001518c8681518110620002db57620002db62000e62565b602002602001015160400151620003a460201b60201c565b909350915080620003048162000ea4565b91505062000274565b508282146200032a5760028401805461ffff191661ffff84161790555b60078216156200034d57600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051620003829392919062000f1f565b60405180910390a162000396868662000bb2565b50505050505050565b600090565b60008080600080516020620020a183398151915290506000845111620004255760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084015b60405180910390fd5b60008560028111156200043c576200043c62000e78565b1415620005c3576200046886604051806060016040528060248152602001620020c16024913962000dd7565b60005b8451811015620005bc5760008582815181106200048c576200048c62000e62565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156200052f5760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016200041c565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a811415620005945760038c901c600090815260018601602052604081209b909b555b8b620005a08162000ea4565b9c50505050508080620005b39062000ea4565b9150506200046b565b5062000ba6565b6001856002811115620005da57620005da62000e78565b1415620007f65762000606866040518060600160405280602881526020016200210d6028913962000dd7565b60005b8451811015620005bc5760008582815181106200062a576200062a62000e62565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c30811415620006c25760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b60648201526084016200041c565b896001600160a01b0316816001600160a01b031614156200073b5760405162461bcd60e51b815260206004820152603860248201526000805160206200208183398151915260448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016200041c565b6001600160a01b038116620007a85760405162461bcd60e51b815260206004820152603860248201526000805160206200208183398151915260448201527f6374696f6e207468617420646f65736e2774206578697374000000000000000060648201526084016200041c565b506001600160e01b031990911660009081526020849052604090206001600160601b03919091166001600160601b031960608a901b1617905580620007ed8162000ea4565b91505062000609565b60028560028111156200080d576200080d62000e78565b141562000b4d576001600160a01b03861615620008935760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d75737420626520616464726573732830290000000000000000000060648201526084016200041c565b600388901c6007891660005b865181101562000b285789620008dc5782620008bb8162001026565b60008181526001870160205260409020549b50935060079250620008ec9050565b81620008e88162001026565b9250505b6000806000808a858151811062000907576200090762000e62565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c620009a95760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016200041c565b606081901c30141562000a165760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016200041c565b600587901b8f901b94506001600160e01b03198086169083161462000a68576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166001600160601b0383161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e016905085821462000acf576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c17905562000af3565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b8462000b0f57600086815260018801602052604081208190559c505b505050808062000b1f9062000ea4565b9150506200089f565b508062000b3783600862001040565b62000b43919062001062565b9950505062000ba6565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084016200041c565b50959694955050505050565b6001600160a01b03821662000c3c5780511562000c385760405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d7074790000000060648201526084016200041c565b5050565b600081511162000cb55760405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f74206164647265737328302900000060648201526084016200041c565b6001600160a01b038216301462000ceb5762000ceb82604051806060016040528060288152602001620020e56028913962000dd7565b600080836001600160a01b03168360405162000d0891906200107d565b600060405180830381855af49150503d806000811462000d45576040519150601f19603f3d011682016040523d82523d6000602084013e62000d4a565b606091505b50915091508162000dd15780511562000d79578060405162461bcd60e51b81526004016200041c91906200109b565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656044820152651d995c9d195960d21b60648201526084016200041c565b50505050565b813b818162000dd15760405162461bcd60e51b81526004016200041c91906200109b565b80516001600160a01b038116811462000e1357600080fd5b919050565b60008060006060848603121562000e2e57600080fd5b62000e398462000dfb565b925062000e496020850162000dfb565b915062000e596040850162000dfb565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141562000ebb5762000ebb62000e8e565b5060010190565b60005b8381101562000edf57818101518382015260200162000ec5565b8381111562000dd15750506000910152565b6000815180845262000f0b81602086016020860162000ec2565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101562000ff457898403607f19018652815180516001600160a01b0316855283810151898601906003811062000f9057634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b8083101562000fde5783516001600160e01b031916825292860192600192909201919086019062000fb2565b5097850197955050509082019060010162000f48565b50506001600160a01b038a1690880152868103604088015262001018818962000ef1565b9a9950505050505050505050565b60008162001038576200103862000e8e565b506000190190565b60008160001904831182151516156200105d576200105d62000e8e565b500290565b6000821982111562001078576200107862000e8e565b500190565b600082516200109181846020870162000ec2565b9190910192915050565b602081526000620010b0602083018462000ef1565b9392505050565b610fba80620010c76000396000f3fe60806040523661000b57005b600080356001600160e01b0319168152600080516020610ef18339815191526020819052604090912054819060601c8061008c5760405162461bcd60e51b815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460448201526064015b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100ab573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b03848116918217909355604051600080516020610ef1833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54600080516020610ef18339815191529061ffff8116908190600090600716156101905750600381901c60009081526001840160205260409020545b60005b87518110156102175761020083838a84815181106101b3576101b3610cb7565b6020026020010151600001518b85815181106101d1576101d1610cb7565b6020026020010151602001518c86815181106101ef576101ef610cb7565b6020026020010151604001516102a8565b90935091508061020f81610ce3565b915050610193565b508282146102335760028401805461ffff191661ffff84161790555b600782161561025557600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67387878760405161028893929190610d6c565b60405180910390a161029a8686610a83565b50505050505050565b600090565b60008080600080516020610ef1833981519152905060008451116103225760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b6064820152608401610083565b600085600281111561033657610336610cfe565b14156104a45761035e86604051806060016040528060248152602001610f1160249139610c96565b60005b845181101561049e57600085828151811061037e5761037e610cb7565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156104175760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f6044820152746e207468617420616c72656164792065786973747360581b6064820152608401610083565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81141561047b5760038c901c600090815260018601602052604081209b909b555b8b61048581610ce3565b9c5050505050808061049690610ce3565b915050610361565b50610a77565b60018560028111156104b8576104b8610cfe565b14156106ea576104e086604051806060016040528060288152602001610f5d60289139610c96565b60005b845181101561049e57600085828151811061050057610500610cb7565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c308114156105965760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b6064820152608401610083565b896001600160a01b0316816001600160a01b0316141561061e5760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e00000000000000006064820152608401610083565b6001600160a01b03811661069a5760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e277420657869737400000000000000006064820152608401610083565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166001600160601b031960608a901b16179055806106e281610ce3565b9150506104e3565b60028560028111156106fe576106fe610cfe565b1415610a1f576001600160a01b0386161561077a5760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f76652066616365742061646472604482015275657373206d757374206265206164647265737328302960501b6064820152608401610083565b600388901c6007891660005b86518110156109ff57896107be578261079e81610e6c565b60008181526001870160205260409020549b509350600792506107cc9050565b816107c881610e6c565b9250505b6000806000808a85815181106107e4576107e4610cb7565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c6108845760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e27742065786973740000000000000000006064820152608401610083565b606081901c3014156108ef5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b6064820152608401610083565b600587901b8f901b94506001600160e01b031980861690831614610945576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e01690508582146109aa576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c1790556109ce565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b846109e957600086815260018801602052604081208190559c505b50505080806109f790610ce3565b915050610786565b5080610a0c836008610e83565b610a169190610ea2565b99505050610a77565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b6064820152608401610083565b50959694955050505050565b6001600160a01b038216610b0a57805115610b065760405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d707479000000006064820152608401610083565b5050565b6000815111610b815760405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f7420616464726573732830290000006064820152608401610083565b6001600160a01b0382163014610bb357610bb382604051806060016040528060288152602001610f3560289139610c96565b600080836001600160a01b031683604051610bce9190610eba565b600060405180830381855af49150503d8060008114610c09576040519150601f19603f3d011682016040523d82523d6000602084013e610c0e565b606091505b509150915081610c9057805115610c39578060405162461bcd60e51b81526004016100839190610ed6565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656044820152651d995c9d195960d21b6064820152608401610083565b50505050565b813b8181610c905760405162461bcd60e51b81526004016100839190610ed6565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415610cf757610cf7610ccd565b5060010190565b634e487b7160e01b600052602160045260246000fd5b60005b83811015610d2f578181015183820152602001610d17565b83811115610c905750506000910152565b60008151808452610d58816020860160208601610d14565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015610e3c57898403607f19018652815180516001600160a01b03168552838101518986019060038110610ddb57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015610e275783516001600160e01b0319168252928601926001929092019190860190610dfd565b50978501979550505090820190600101610d95565b50506001600160a01b038a16908801528681036040880152610e5e8189610d40565b9a9950505050505050505050565b600081610e7b57610e7b610ccd565b506000190190565b6000816000190483118215151615610e9d57610e9d610ccd565b500290565b60008219821115610eb557610eb5610ccd565b500190565b60008251610ecc818460208701610d14565b9190910192915050565b602081526000610ee96020830184610d40565b939250505056fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a26469706673582212201fdd750cef21a2a7daac8a0b14f0398d5c652b61383282207c925e82e0f9728364736f6c634300080900334c69624469616d6f6e644375743a2043616e2774207265706c6163652066756ec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f646500000000000000000000000094cb5c277fcc64c274bd30847f0821077b231022000000000000000000000000335522b66f2bf0fca51aee797f87ec8bbfa214c30000000000000000000000001d0360bac7299c86ec8e99d0c1c9a95fefaf2a11

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000094cb5c277fcc64c274bd30847f0821077b231022000000000000000000000000335522b66f2bf0fca51aee797f87ec8bbfa214c30000000000000000000000001d0360bac7299c86ec8e99d0c1c9a95fefaf2a11

-----Decoded View---------------
Arg [0] : _contractOwner (address): 0x94cb5c277fcc64c274bd30847f0821077b231022
Arg [1] : _diamondCutFacet (address): 0x335522b66f2bf0fca51aee797f87ec8bbfa214c3
Arg [2] : _realmDiamond (address): 0x1d0360bac7299c86ec8e99d0c1c9a95fefaf2a11

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000094cb5c277fcc64c274bd30847f0821077b231022
Arg [1] : 000000000000000000000000335522b66f2bf0fca51aee797f87ec8bbfa214c3
Arg [2] : 0000000000000000000000001d0360bac7299c86ec8e99d0c1c9a95fefaf2a11


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.