MATIC Price: $0.717625 (-0.38%)
Gas: 92 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040373455892022-12-27 16:20:04513 days ago1672158004IN
 Create: DiamondCutFacet
0 MATIC0.14674215131.97411555

Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DiamondCutFacet

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 3 : DiamondCutFacet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/******************************************************************************\
* 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";
import {LibDiamond} from "../libraries/LibDiamond.sol";

// Remember to add the loupe functions from DiamondLoupeFacet to the diamond.
// The loupe functions are required by the EIP2535 Diamonds standard

/**
 * @title DiamondCutFacet
 */
contract DiamondCutFacet is IDiamondCut {
    /// @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 override {
        LibDiamond.enforceIsContractOwner();
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        uint256 originalSelectorCount = ds.selectorCount;
        uint256 selectorCount = originalSelectorCount;
        bytes32 selectorSlot;
        // Check if last selector slot is not full
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8"
        if (selectorCount & 7 > 0) {
            // get last selectorSlot
            // "selectorCount >> 3" is a gas efficient division by 8 "selectorCount / 8"
            selectorSlot = ds.selectorSlots[selectorCount >> 3];
        }
        // loop through diamond cut
        for (uint256 facetIndex; facetIndex < _diamondCut.length; ) {
            (selectorCount, selectorSlot) = LibDiamond
                .addReplaceRemoveFacetSelectors(
                    selectorCount,
                    selectorSlot,
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].action,
                    _diamondCut[facetIndex].functionSelectors
                );

            unchecked {
                facetIndex++;
            }
        }
        if (selectorCount != originalSelectorCount) {
            ds.selectorCount = uint16(selectorCount);
        }
        // If last selector slot is not full
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8"
        if (selectorCount & 7 > 0) {
            // "selectorCount >> 3" is a gas efficient division by 8 "selectorCount / 8"
            ds.selectorSlots[selectorCount >> 3] = selectorSlot;
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        LibDiamond.initializeDiamondCut(_init, _calldata);
    }
}

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

/******************************************************************************\
* 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
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8"
        if (selectorCount & 7 > 0) {
            // get last selectorSlot
            // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8"
            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
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8"
        if (selectorCount & 7 > 0) {
            // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8"
            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);
                // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8"
                // " << 5 is the same as multiplying by 32 ( * 32)
                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) {
                    // "_selectorSlot >> 3" is a gas efficient division by 8 "_selectorSlot / 8"
                    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)"
            );
            // "_selectorCount >> 3" is a gas efficient division by 8 "_selectorCount / 8"
            uint256 selectorSlotCount = _selectorCount >> 3;
            // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8"
            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
                    // " << 5 is the same as multiplying by 32 ( * 32)
                    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));
                    // "oldSelectorCount >> 3" is a gas efficient division by 8 "oldSelectorCount / 8"
                    oldSelectorsSlotCount = oldSelectorCount >> 3;
                    // "oldSelectorCount & 7" is a gas efficient modulo by eight "oldSelectorCount % 8"
                    // " << 5 is the same as multiplying by 32 ( * 32)
                    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 2 of 3 : IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/******************************************************************************\
* 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);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":false,"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"indexed":false,"internalType":"address","name":"_init","type":"address"},{"indexed":false,"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"DiamondCut","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"internalType":"address","name":"_init","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"diamondCut","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50611330806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80631f931c1c14610030575b600080fd5b61004361003e366004610e4d565b610045565b005b61004d61028e565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff8116908190600090600716156100bc5750600381901c60009081526001840160205260409020545b60005b888110156101a95761019c83838c8c858181106100de576100de610eff565b90506020028101906100f09190610f15565b6100fe906020810190610f35565b8d8d8681811061011057610110610eff565b90506020028101906101229190610f15565b610133906040810190602001610f66565b8e8e8781811061014557610145610eff565b90506020028101906101579190610f15565b610165906040810190610f81565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061033792505050565b90935091506001016100bf565b508282146101e2576002840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff84161790555b600782161561020457600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673898989898960405161023b95949392919061105c565b60405180910390a16102838787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b9d92505050565b505050505050505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600401546001600160a01b031633146103355760405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201527f657200000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b565b600080807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905060008451116103d55760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f20637574000000000000000000000000000000000000000000606482015260840161032c565b60008560028111156103e9576103e9610fcb565b03610563576104108660405180606001604052806024815260200161128760249139610dc7565b60005b845181101561055d57600085828151811061043057610430610eff565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156104d15760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c7265616479206578697374730000000000000000000000606482015260840161032c565b6001600160e01b031980831660008181526020879052604090206bffffffffffffffffffffffff1960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81900361053a5760038c901c600090815260018601602052604081209b909b555b8b610544816111bc565b9c50505050508080610555906111bc565b915050610413565b50610b91565b600185600281111561057757610577610fcb565b036107b95761059e866040518060600160405280602881526020016112d360289139610dc7565b60005b845181101561055d5760008582815181106105be576105be610eff565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c3081036106615760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e0000000000000000000000000000000000606482015260840161032c565b896001600160a01b0316816001600160a01b0316036106e85760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606482015260840161032c565b6001600160a01b0381166107645760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e27742065786973740000000000000000606482015260840161032c565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166bffffffffffffffffffffffff1960608a901b16179055806107b1816111bc565b9150506105a1565b60028560028111156107cd576107cd610fcb565b03610b23576001600160a01b0386161561084f5760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d757374206265206164647265737328302900000000000000000000606482015260840161032c565b600388901c6007891660005b8651811015610b035760008a90036108975782610877816111d6565b60008181526001870160205260409020549b509350600792506108a59050565b816108a1816111d6565b9250505b6000806000808a85815181106108bd576108bd610eff565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c61095d5760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e2774206578697374000000000000000000606482015260840161032c565b30606082901c036109d65760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e000000000000000000000000000000000000606482015260840161032c565b600587901b8f901b94506001600160e01b031980861690831614610a31576001600160e01b03198516600090815260208a90526040902080546bffffffffffffffffffffffff19166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e0169050858214610a96576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c179055610acf565b80837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c816001600160e01b031960001b901c198e16179c505b84600003610aed57600086815260018801602052604081208190559c505b5050508080610afb906111bc565b91505061085b565b5080610b108360086111ed565b610b1a919061120a565b99505050610b91565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e00000000000000000000000000000000000000000000000000606482015260840161032c565b50959694955050505050565b6001600160a01b038216610c2457805115610c205760405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d70747900000000606482015260840161032c565b5050565b6000815111610c9b5760405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f742061646472657373283029000000606482015260840161032c565b6001600160a01b0382163014610ccd57610ccd826040518060600160405280602881526020016112ab60289139610dc7565b600080836001600160a01b031683604051610ce89190611241565b600060405180830381855af49150503d8060008114610d23576040519150601f19603f3d011682016040523d82523d6000602084013e610d28565b606091505b509150915081610dc157805115610d53578060405162461bcd60e51b815260040161032c9190611253565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e20726560448201527f7665727465640000000000000000000000000000000000000000000000000000606482015260840161032c565b50505050565b813b8181610dc15760405162461bcd60e51b815260040161032c9190611253565b80356001600160a01b0381168114610dff57600080fd5b919050565b60008083601f840112610e1657600080fd5b50813567ffffffffffffffff811115610e2e57600080fd5b602083019150836020828501011115610e4657600080fd5b9250929050565b600080600080600060608688031215610e6557600080fd5b853567ffffffffffffffff80821115610e7d57600080fd5b818801915088601f830112610e9157600080fd5b813581811115610ea057600080fd5b8960208260051b8501011115610eb557600080fd5b60208301975080965050610ecb60208901610de8565b94506040880135915080821115610ee157600080fd5b50610eee88828901610e04565b969995985093965092949392505050565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112610f2b57600080fd5b9190910192915050565b600060208284031215610f4757600080fd5b610f5082610de8565b9392505050565b803560038110610dff57600080fd5b600060208284031215610f7857600080fd5b610f5082610f57565b6000808335601e19843603018112610f9857600080fd5b83018035915067ffffffffffffffff821115610fb357600080fd5b6020019150600581901b3603821315610e4657600080fd5b634e487b7160e01b600052602160045260246000fd5b818352600060208085019450826000805b868110156110255782356001600160e01b03198116808214611012578384fd5b8952509683019691830191600101610ff2565b50959695505050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6060808252818101869052600090600560808085019089831b8601018a855b8b811015611173577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808884030184528135605e198e36030181126110be57600080fd5b8d016001600160a01b036110d182610de8565b16845260206110e1818301610f57565b600381106110ff57634e487b7160e01b600052602160045260246000fd5b8582015260408281013536849003601e1901811261111c57600080fd5b90920181810192903567ffffffffffffffff81111561113a57600080fd5b80891b360384131561114b57600080fd5b898288015261115d8a88018286610fe1565b978301979650505092909201915060010161107b565b50506001600160a01b0389166020870152858103604087015261119781888a611031565b9b9a5050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982036111cf576111cf6111a6565b5060010190565b6000816111e5576111e56111a6565b506000190190565b8082028115828204841417611204576112046111a6565b92915050565b80820180821115611204576112046111a6565b60005b83811015611238578181015183820152602001611220565b50506000910152565b60008251610f2b81846020870161121d565b602081526000825180602084015261127281604085016020870161121d565b601f01601f1916919091016040019291505056fe4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a2646970667358221220affeecec5e064cd8e0d12c607daa2da7f33c0044fd74f90883dbb7778e60bb3b64736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80631f931c1c14610030575b600080fd5b61004361003e366004610e4d565b610045565b005b61004d61028e565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff8116908190600090600716156100bc5750600381901c60009081526001840160205260409020545b60005b888110156101a95761019c83838c8c858181106100de576100de610eff565b90506020028101906100f09190610f15565b6100fe906020810190610f35565b8d8d8681811061011057610110610eff565b90506020028101906101229190610f15565b610133906040810190602001610f66565b8e8e8781811061014557610145610eff565b90506020028101906101579190610f15565b610165906040810190610f81565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061033792505050565b90935091506001016100bf565b508282146101e2576002840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff84161790555b600782161561020457600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673898989898960405161023b95949392919061105c565b60405180910390a16102838787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b9d92505050565b505050505050505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600401546001600160a01b031633146103355760405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201527f657200000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b565b600080807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905060008451116103d55760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f20637574000000000000000000000000000000000000000000606482015260840161032c565b60008560028111156103e9576103e9610fcb565b03610563576104108660405180606001604052806024815260200161128760249139610dc7565b60005b845181101561055d57600085828151811061043057610430610eff565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156104d15760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c7265616479206578697374730000000000000000000000606482015260840161032c565b6001600160e01b031980831660008181526020879052604090206bffffffffffffffffffffffff1960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81900361053a5760038c901c600090815260018601602052604081209b909b555b8b610544816111bc565b9c50505050508080610555906111bc565b915050610413565b50610b91565b600185600281111561057757610577610fcb565b036107b95761059e866040518060600160405280602881526020016112d360289139610dc7565b60005b845181101561055d5760008582815181106105be576105be610eff565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c3081036106615760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e0000000000000000000000000000000000606482015260840161032c565b896001600160a01b0316816001600160a01b0316036106e85760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606482015260840161032c565b6001600160a01b0381166107645760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e27742065786973740000000000000000606482015260840161032c565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166bffffffffffffffffffffffff1960608a901b16179055806107b1816111bc565b9150506105a1565b60028560028111156107cd576107cd610fcb565b03610b23576001600160a01b0386161561084f5760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d757374206265206164647265737328302900000000000000000000606482015260840161032c565b600388901c6007891660005b8651811015610b035760008a90036108975782610877816111d6565b60008181526001870160205260409020549b509350600792506108a59050565b816108a1816111d6565b9250505b6000806000808a85815181106108bd576108bd610eff565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c61095d5760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e2774206578697374000000000000000000606482015260840161032c565b30606082901c036109d65760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e000000000000000000000000000000000000606482015260840161032c565b600587901b8f901b94506001600160e01b031980861690831614610a31576001600160e01b03198516600090815260208a90526040902080546bffffffffffffffffffffffff19166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e0169050858214610a96576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c179055610acf565b80837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c816001600160e01b031960001b901c198e16179c505b84600003610aed57600086815260018801602052604081208190559c505b5050508080610afb906111bc565b91505061085b565b5080610b108360086111ed565b610b1a919061120a565b99505050610b91565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e00000000000000000000000000000000000000000000000000606482015260840161032c565b50959694955050505050565b6001600160a01b038216610c2457805115610c205760405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d70747900000000606482015260840161032c565b5050565b6000815111610c9b5760405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f742061646472657373283029000000606482015260840161032c565b6001600160a01b0382163014610ccd57610ccd826040518060600160405280602881526020016112ab60289139610dc7565b600080836001600160a01b031683604051610ce89190611241565b600060405180830381855af49150503d8060008114610d23576040519150601f19603f3d011682016040523d82523d6000602084013e610d28565b606091505b509150915081610dc157805115610d53578060405162461bcd60e51b815260040161032c9190611253565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e20726560448201527f7665727465640000000000000000000000000000000000000000000000000000606482015260840161032c565b50505050565b813b8181610dc15760405162461bcd60e51b815260040161032c9190611253565b80356001600160a01b0381168114610dff57600080fd5b919050565b60008083601f840112610e1657600080fd5b50813567ffffffffffffffff811115610e2e57600080fd5b602083019150836020828501011115610e4657600080fd5b9250929050565b600080600080600060608688031215610e6557600080fd5b853567ffffffffffffffff80821115610e7d57600080fd5b818801915088601f830112610e9157600080fd5b813581811115610ea057600080fd5b8960208260051b8501011115610eb557600080fd5b60208301975080965050610ecb60208901610de8565b94506040880135915080821115610ee157600080fd5b50610eee88828901610e04565b969995985093965092949392505050565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112610f2b57600080fd5b9190910192915050565b600060208284031215610f4757600080fd5b610f5082610de8565b9392505050565b803560038110610dff57600080fd5b600060208284031215610f7857600080fd5b610f5082610f57565b6000808335601e19843603018112610f9857600080fd5b83018035915067ffffffffffffffff821115610fb357600080fd5b6020019150600581901b3603821315610e4657600080fd5b634e487b7160e01b600052602160045260246000fd5b818352600060208085019450826000805b868110156110255782356001600160e01b03198116808214611012578384fd5b8952509683019691830191600101610ff2565b50959695505050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6060808252818101869052600090600560808085019089831b8601018a855b8b811015611173577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808884030184528135605e198e36030181126110be57600080fd5b8d016001600160a01b036110d182610de8565b16845260206110e1818301610f57565b600381106110ff57634e487b7160e01b600052602160045260246000fd5b8582015260408281013536849003601e1901811261111c57600080fd5b90920181810192903567ffffffffffffffff81111561113a57600080fd5b80891b360384131561114b57600080fd5b898288015261115d8a88018286610fe1565b978301979650505092909201915060010161107b565b50506001600160a01b0389166020870152858103604087015261119781888a611031565b9b9a5050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982036111cf576111cf6111a6565b5060010190565b6000816111e5576111e56111a6565b506000190190565b8082028115828204841417611204576112046111a6565b92915050565b80820180821115611204576112046111a6565b60005b83811015611238578181015183820152602001611220565b50506000910152565b60008251610f2b81846020870161121d565b602081526000825180602084015261127281604085016020870161121d565b601f01601f1916919091016040019291505056fe4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a2646970667358221220affeecec5e064cd8e0d12c607daa2da7f33c0044fd74f90883dbb7778e60bb3b64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.