Contract 0x19f870bd94a34b3adaa9caa439d333da18d6812a 1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x223d47b231896a9ae6575e5ced2d25181132ac73ffdd4b4f7554e9a7409326a40xf5741bb8316842982022-08-09 5:23:3939 secs ago0x2848b9f2d4faebaa4838c41071684c70688b455d IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.031319415 45
0xc378234465976dc3474c72d2269f5a5fca979c1bc2523b70703c4472c66146cc0xf5741bb8316842912022-08-09 5:23:111 min ago0x2848b9f2d4faebaa4838c41071684c70688b455d IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.03555522 45
0xb1b1fe30462f6d3ec81b46120bef2ef7a3e5e577279d6c9aa0a8978bc9efc57d0xf5741bb8316842882022-08-09 5:22:591 min ago0x2848b9f2d4faebaa4838c41071684c70688b455d IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.033914655 45
0x57abd0eac0124635dd1451b32551d04051b0bd1ec1c18548e45907918e4633f1Reduce Upgrade T...316842642022-08-09 5:22:052 mins ago0x1d4ddcb0e96d99f417919bc9c94b8348dc837a32 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.040116576402 76.38750048
0xd17b39fd0a7d86758363d6bba1600f5a4cbff32e9e2e04058983300d30d41fd80xf5741bb8316842582022-08-09 5:21:532 mins ago0xf2b9ec5724dc97362a53907c0b4cc0aa72369e63 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.023202011964 38.79999994
0xd8adb1af353644e9e75b1ef35d61f5e49c86fef98387fc2b3d58e0488a4da1280xf5741bb8316842572022-08-09 5:21:512 mins ago0x09a1a849974d021a0f74366e5020884ff73e3abb IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.023202139786 41.153868969
0x8aa690287d2e3f8b14924b4755a1fa9372315b842e17fe87e9f06ff89fdaa988Craft Installati...316842542022-08-09 5:21:452 mins ago0x2848b9f2d4faebaa4838c41071684c70688b455d IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.025346745 45
0xde2c1d8d7a867db9484682f173242835dc6b9765a09a8cfeaee9486001fc68920xf5741bb8316842482022-08-09 5:21:332 mins ago0x59ae16b92d9ba31867bbfcf8552e7145cd211318 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.055439175433 75.000000587
0x3fc194208720bdbacd6d896fa3794ce743400a52f9656c1f9fa0f9d4b4a7c7be0xf5741bb8316842422022-08-09 5:21:212 mins ago0x6b3be6c88c8875168c694e57e62d1de554ee6902 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.025369991047 43.649999909
0xbe4076fc9537eb399c53b3853ce750040c3bb9e55f5f13cc7e7fd5dc4df8d70dFinalize Upgrade...316842362022-08-09 5:21:093 mins ago0x0d349331310abd72872da19cf4e4980a79105d49 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.016114413873 33.219568147
0xa205114b0dab8ce1fcfcfa583db2660d550adaa49df0c6d74c125cad122ab207Reduce Upgrade T...316842032022-08-09 5:19:594 mins ago0x59ae16b92d9ba31867bbfcf8552e7145cd211318 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.037317586382 76.387502062
0x9f2ca30e0a625cbeb5d0577c539a31eef8784e8697460d64c5f8965943d52390Finalize Upgrade...316841962022-08-09 5:19:454 mins ago0x6b3be6c88c8875168c694e57e62d1de554ee6902 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.023204242585 48.499999134
0x8c973d780555d6ea95c0b61041578d85969b7b517c51117e7411af0c3d34eff6Finalize Upgrade...316841792022-08-09 5:19:115 mins ago0x572e311c231e8cf4f7eaea8f54bc69ddda674d64 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.018340269278 39.45959921
0x2e10d9ac4b72a517796c906a44cc259515b9ccc85dc22a972789161577ad09a10xf5741bb8316841412022-08-09 5:17:157 mins ago0x1b7abf246d12d2fb501d1af7ab1996589e34fdb4 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.042286051508 75.000002675
0x334246231baa5d35d2c5608d52c31b86d476b5f666836952de62ea08b80df6ae0xf5741bb8316841152022-08-09 5:15:318 mins ago0x1b7abf246d12d2fb501d1af7ab1996589e34fdb4 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.044851050301 75.000000505
0x5f2aee3e0f036070becca7c73bd5e03fa89431e61cb1c1fc7bb42f691e7feea6Craft Installati...316840782022-08-09 5:13:3310 mins ago0x25d3ee8cb4c2c6a41afcaa97d077d07dbecc3138 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.014890118839 37.635999949
0xeb1ae5229f6fcb05936fc528f3d943f997119e2896b9846ba4d14c48f8f2e879Craft Installati...316840272022-08-09 5:11:4712 mins ago0x25d3ee8cb4c2c6a41afcaa97d077d07dbecc3138 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.01237305011 30.000000269
0xe20d362a82af42b83a2cb6cee95254d46b9a0e2e7915e7e3e32cbccd8f836071Craft Installati...316839932022-08-09 5:10:3913 mins ago0x25d3ee8cb4c2c6a41afcaa97d077d07dbecc3138 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.012815317777 31.072333282
0x6282049591ba1df1d9c70c51136981b3551ee1d1c8ac9f55959fc45ab257926c0xf5741bb8316838402022-08-09 5:05:2518 mins ago0x0a38c3a976b169574bd16412b654c1ee0db92e1b IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.045482032208 75.000135562
0x2c5d935b01f607f7efa7a45315332849793474253b5c24c72025ab738b07d6fd0xf5741bb8316837852022-08-09 5:03:3120 mins ago0xd281f988242c900d67ff2aafabe683b8004ee778 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.03611555 50
0xebe54ef42185fbe90070068ada029784fa8e4a554073165038a1207c5de43fdd0xf5741bb8316837682022-08-09 5:02:3921 mins ago0xf9246804076fcaabc248c2d3f10d260e4b840e47 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.044851131566 75.000136395
0xef921c3bb64e99f091846e73b615a9f732fa26783ee3652b2a5d95a77061bbf20xf5741bb8316837632022-08-09 5:02:1921 mins ago0xd281f988242c900d67ff2aafabe683b8004ee778 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.03915255 50
0x02a44b3a9c40f298093415074785f690caf79f6ea46829ae9337392a6843e0800xf5741bb8316837432022-08-09 5:00:5923 mins ago0xd281f988242c900d67ff2aafabe683b8004ee778 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.0386533 50
0xa84460958d888f4f15cbb8f06c0a57d794ca453a23ec0790ae1874061de1f30f0xf5741bb8316837362022-08-09 5:00:3123 mins ago0xd281f988242c900d67ff2aafabe683b8004ee778 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.03710895 50
0xc832e87ba1fb2f9ee1dc122d99ae8f24c5a6c0cbaf37af2979161e41302928ed0xf5741bb8316837242022-08-09 4:59:4324 mins ago0x47403b790e9fbbf7ea6d3da50fcebaa878067642 IN  0x19f870bd94a34b3adaa9caa439d333da18d6812a0 MATIC0.042286126708 75.000136052
[ 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.