ETH Price: $3,392.12 (+6.28%)
Gas: 23 Gwei

Contract

0xf9379C53c2c5dC86FB7C9a744966b20e7c0AaFfA
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
184725192023-10-31 20:34:11257 days ago1698784451  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DiamondLoupeFacet

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
shanghai EvmVersion
File 1 of 4 : DiamondLoupeFacet.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.21;

//https://github.com/mudgen/diamond-2/blob/master/contracts/facets/DiamondLoupeFacet.sol

import {LibDiamond} from "contracts/libraries/LibDiamond.sol";
import {IDiamondLoupe} from "contracts/interfaces/IDiamondLoupe.sol";

/* solhint-disable no-inline-assembly */
contract DiamondLoupeFacet is IDiamondLoupe {
    // Diamond Loupe Functions
    ////////////////////////////////////////////////////////////////////
    /// These functions are expected to be called frequently by tools.
    //
    // struct Facet {
    //     address facetAddress;
    //     bytes4[] functionSelectors;
    // }
    /// @notice Gets all facets and their selectors.
    /// @return facets_ Facet
    function facets() external view override returns (Facet[] memory facets_) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facets_ = new Facet[](ds.selectorCount);
        uint8[] memory numFacetSelectors = new uint8[](ds.selectorCount);
        uint256 numFacets;
        uint256 selectorIndex;
        // loop through function selectors
        for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) {
            bytes32 slot = ds.selectorSlots[slotIndex];
            for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) {
                selectorIndex++;
                if (selectorIndex > ds.selectorCount) {
                    break;
                }
                bytes4 selector = bytes4(slot << (selectorSlotIndex << 5));
                address facetAddress_ = address(bytes20(ds.facets[selector]));
                bool continueLoop = false;
                for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {
                    if (facets_[facetIndex].facetAddress == facetAddress_) {
                        facets_[facetIndex].functionSelectors[numFacetSelectors[facetIndex]]
                        = selector;
                        // probably will never have more than 256 functions from one facet contract
                        require(numFacetSelectors[facetIndex] < 255, ">256 fn");
                        numFacetSelectors[facetIndex]++;
                        continueLoop = true;
                        break;
                    }
                }
                if (continueLoop) {
                    continueLoop = false;
                    continue;
                }
                facets_[numFacets].facetAddress = facetAddress_;
                facets_[numFacets].functionSelectors = new bytes4[](ds.selectorCount);
                facets_[numFacets].functionSelectors[0] = selector;
                numFacetSelectors[numFacets] = 1;
                numFacets++;
            }
        }
        for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {
            uint256 numSelectors = numFacetSelectors[facetIndex];
            bytes4[] memory selectors = facets_[facetIndex].functionSelectors;
            // setting the number of selectors
            assembly {
                mstore(selectors, numSelectors)
            }
        }
        // setting the number of facets
        assembly {
            mstore(facets_, numFacets)
        }
    }

    /// @notice Gets all the function selectors supported by a specific facet.
    /// @param _facet The facet address.
    /// @return _facetFunctionSelectors The selectors associated with a facet address.
    function facetFunctionSelectors(address _facet)
        external
        view
        override
        returns (bytes4[] memory _facetFunctionSelectors)
    {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        uint256 numSelectors;
        _facetFunctionSelectors = new bytes4[](ds.selectorCount);
        uint256 selectorIndex;
        // loop through function selectors
        for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) {
            bytes32 slot = ds.selectorSlots[slotIndex];
            for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) {
                selectorIndex++;
                if (selectorIndex > ds.selectorCount) {
                    break;
                }
                bytes4 selector = bytes4(slot << (selectorSlotIndex << 5));
                address facet = address(bytes20(ds.facets[selector]));
                if (_facet == facet) {
                    _facetFunctionSelectors[numSelectors] = selector;
                    numSelectors++;
                }
            }
        }
        // Set the number of selectors in the array
        assembly {
            mstore(_facetFunctionSelectors, numSelectors)
        }
    }

    /// @notice Get all the facet addresses used by a diamond.
    /// @return facetAddresses_
    function facetAddresses()
        external
        view
        override
        returns (address[] memory facetAddresses_)
    {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facetAddresses_ = new address[](ds.selectorCount);
        uint256 numFacets;
        uint256 selectorIndex;
        // loop through function selectors
        for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) {
            bytes32 slot = ds.selectorSlots[slotIndex];
            for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) {
                selectorIndex++;
                if (selectorIndex > ds.selectorCount) {
                    break;
                }
                bytes4 selector = bytes4(slot << (selectorSlotIndex << 5));
                address facetAddress_ = address(bytes20(ds.facets[selector]));
                bool continueLoop = false;
                for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {
                    if (facetAddress_ == facetAddresses_[facetIndex]) {
                        continueLoop = true;
                        break;
                    }
                }
                if (continueLoop) {
                    continueLoop = false;
                    continue;
                }
                facetAddresses_[numFacets] = facetAddress_;
                numFacets++;
            }
        }
        // Set the number of facet addresses in the array
        assembly {
            mstore(facetAddresses_, numFacets)
        }
    }

    /// @notice Gets the facet that supports the given selector.
    /// @dev If facet is not found return address(0).
    /// @param _functionSelector The function selector.
    /// @return facetAddress_ The facet address.
    function facetAddress(bytes4 _functionSelector)
        external
        view
        override
        returns (address facetAddress_)
    {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facetAddress_ = address(bytes20(ds.facets[_functionSelector]));
    }
}

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

/**
 * \
 * Author: Nick Mudge
 *
 * Implementation of Diamond facet.
 * Uses the diamond-2 version 1.3.4 implementation:
 * https://github.com/mudgen/diamond-2
 *
 * This is gas optimized by reducing storage reads and storage writes.
 * This code is as complex as it is to reduce gas costs.
 * /*****************************************************************************
 */

import {IDiamondCut} from "contracts/interfaces/IDiamondCut.sol";

/* solhint-disable */
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;
        // owner of the contract
        // Used to query if a contract implements an interface.
        // Used to implement ERC-165.
        mapping(bytes4 => bool) supportedInterfaces;
        // The number of function selectors in selectorSlots
        uint16 selectorCount;
        // 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 % 8 > 0) {
            // get last selectorSlot
            selectorSlot = ds.selectorSlots[selectorCount / 8];
        }
        // 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 % 8 > 0) {
            ds.selectorSlots[selectorCount / 8] = 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) {
            require(
                _newFacetAddress != address(0),
                "LibDiamondCut: Add facet can't be address(0)"
            );
            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 % 8) * 32;
                // 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 / 8] = _selectorSlot;
                    _selectorSlot = 0;
                }
                _selectorCount++;
            }
        } else if (_action == IDiamondCut.FacetCutAction.Replace) {
            require(
                _newFacetAddress != address(0),
                "LibDiamondCut: Replace facet can't be address(0)"
            );
            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 / 8;
            uint256 selectorInSlotIndex = (_selectorCount % 8) - 1;
            for (
                uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++
            ) {
                if (_selectorSlot == 0) {
                    // get last selectorSlot
                    selectorSlotCount--;
                    _selectorSlot = ds.selectorSlots[selectorSlotCount];
                    selectorInSlotIndex = 7;
                }
                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 * 32));
                    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 / 8;
                    oldSelectorInSlotPosition = (oldSelectorCount % 8) * 32;
                }
                if (oldSelectorsSlotCount != selectorSlotCount) {
                    bytes32 oldSelectorSlot = ds.selectorSlots[oldSelectorsSlotCount];
                    // clears the selector being deleted 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 being deleted 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;
                }
                selectorInSlotIndex--;
            }
            _selectorCount = selectorSlotCount * 8 + selectorInSlotIndex + 1;
        } 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 == false) {
                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 : IDiamondLoupe.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

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

// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
    /// These functions are expected to be called frequently
    /// by tools.

    struct Facet {
        address facetAddress;
        bytes4[] functionSelectors;
    }

    /// @notice Gets all facet addresses and their four byte function selectors.
    /// @return facets_ Facet
    function facets() external view returns (Facet[] memory facets_);

    /// @notice Gets all the function selectors supported by a specific facet.
    /// @param _facet The facet address.
    /// @return facetFunctionSelectors_
    function facetFunctionSelectors(address _facet)
        external
        view
        returns (bytes4[] memory facetFunctionSelectors_);

    /// @notice Get all the facet addresses used by a diamond.
    /// @return facetAddresses_
    function facetAddresses() external view returns (address[] memory facetAddresses_);

    /// @notice Gets the facet that supports the given selector.
    /// @dev If facet is not found return address(0).
    /// @param _functionSelector The function selector.
    /// @return facetAddress_ The facet address.
    function facetAddress(bytes4 _functionSelector)
        external
        view
        returns (address facetAddress_);
}

File 4 of 4 : IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
/*
 * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
 */

interface IDiamondCut {
    enum FacetCutAction {
        Add,
        Replace,
        Remove
    }

    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
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "interfaces/=interfaces/",
    "contracts/=contracts/",
    "test/=test/",
    "test-gas/=test-gas/",
    "deploy/=deploy/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@chainlink/=node_modules/@chainlink/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@prb/=node_modules/@prb/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes4","name":"_functionSelector","type":"bytes4"}],"name":"facetAddress","outputs":[{"internalType":"address","name":"facetAddress_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facetAddresses","outputs":[{"internalType":"address[]","name":"facetAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_facet","type":"address"}],"name":"facetFunctionSelectors","outputs":[{"internalType":"bytes4[]","name":"_facetFunctionSelectors","type":"bytes4[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facets","outputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondLoupe.Facet[]","name":"facets_","type":"tuple[]"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b50610d348061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c806352ef6b2c1461004e5780637a0ed6271461006c578063adfca15e14610081578063cdffacc6146100a1575b5f80fd5b610056610129565b6040516100639190610a3d565b60405180910390f35b61007461033b565b6040516100639190610af1565b61009461008f366004610b97565b610880565b6040516100639190610bd1565b6101046100af366004610be3565b7fffffffff00000000000000000000000000000000000000000000000000000000165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205460601c90565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610063565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561018c5761018c610c22565b6040519080825280602002602001820160405280156101b5578160200160208202803683370190505b5091505f805f5b600384015461ffff16821015610333575f818152600185016020526040812054905b600881101561031e57836101f181610c7c565b600388015490955061ffff168511905061031e57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020889052604081205460601c90805b888110156102b3578a818151811061025e5761025e610cb3565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036102a157600191506102b3565b806102ab81610c7c565b915050610244565b5080156102c3575061030c915050565b818a89815181106102d6576102d6610cb3565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101528761030581610c7c565b9850505050505b8061031681610c7c565b9150506101de565b5050808061032b90610c7c565b9150506101bc565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561039e5761039e610c22565b6040519080825280602002602001820160405280156103e357816020015b604080518082019091525f8152606060208201528152602001906001900390816103bc5790505b5060038201549092505f9061ffff1667ffffffffffffffff81111561040a5761040a610c22565b604051908082528060200260200182016040528015610433578160200160208202803683370190505b5090505f805f5b600385015461ffff16821015610811575f818152600186016020526040812054905b60088110156107fc578361046f81610c7c565b600389015490955061ffff16851190506107fc57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020899052604081205460601c90805b88811015610683578273ffffffffffffffffffffffffffffffffffffffff168c82815181106104f3576104f3610cb3565b60200260200101515f015173ffffffffffffffffffffffffffffffffffffffff160361067157838c828151811061052c5761052c610cb3565b6020026020010151602001518b838151811061054a5761054a610cb3565b602002602001015160ff168151811061056557610565610cb3565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060ff8a82815181106105c5576105c5610cb3565b602002602001015160ff161061063b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f3e32353620666e00000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b89818151811061064d5761064d610cb3565b60200260200101805180919061066290610ce0565b60ff1690525060019150610683565b8061067b81610c7c565b9150506104c2565b50801561069357506107ea915050565b818b89815181106106a6576106a6610cb3565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260038a015461ffff1667ffffffffffffffff8111156106ec576106ec610c22565b604051908082528060200260200182016040528015610715578160200160208202803683370190505b508b898151811061072857610728610cb3565b602002602001015160200181905250828b898151811061074a5761074a610cb3565b6020026020010151602001515f8151811061076757610767610cb3565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060018989815181106107c7576107c7610cb3565b60ff90921660209283029190910190910152876107e381610c7c565b9850505050505b806107f481610c7c565b91505061045c565b5050808061080990610c7c565b91505061043a565b505f5b82811015610875575f84828151811061082f5761082f610cb3565b602002602001015160ff1690505f87838151811061084f5761084f610cb3565b60200260200101516020015190508181525050808061086d90610c7c565b915050610814565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905f9061ffff1667ffffffffffffffff8111156108e5576108e5610c22565b60405190808252806020026020018201604052801561090e578160200160208202803683370190505b5092505f805b600384015461ffff16821015610a33575f818152600185016020526040812054905b6008811015610a1e578361094981610c7c565b600388015490955061ffff1685119050610a1e57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020889052604090205460601c73ffffffffffffffffffffffffffffffffffffffff8a16819003610a0957818988815181106109ca576109ca610cb3565b7fffffffff000000000000000000000000000000000000000000000000000000009092166020928302919091019091015286610a0581610c7c565b9750505b50508080610a1690610c7c565b915050610936565b50508080610a2b90610c7c565b915050610914565b5050825250919050565b602080825282518282018190525f9190848201906040850190845b81811015610a8a57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610a58565b50909695505050505050565b5f8151808452602080850194508084015f5b83811015610ae65781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610aa8565b509495945050505050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b83811015610b89578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff168452870151878401879052610b7687850182610a96565b9588019593505090860190600101610b16565b509098975050505050505050565b5f60208284031215610ba7575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bca575f80fd5b9392505050565b602081525f610bca6020830184610a96565b5f60208284031215610bf3575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610bca575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610cac57610cac610c4f565b5060010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff821660ff8103610cf557610cf5610c4f565b6001019291505056fea2646970667358221220304344f689c304690d3559c18ab18a9959e7ed91e07093743d5588a76efc9e3964736f6c63430008150033

Deployed Bytecode

0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c806352ef6b2c1461004e5780637a0ed6271461006c578063adfca15e14610081578063cdffacc6146100a1575b5f80fd5b610056610129565b6040516100639190610a3d565b60405180910390f35b61007461033b565b6040516100639190610af1565b61009461008f366004610b97565b610880565b6040516100639190610bd1565b6101046100af366004610be3565b7fffffffff00000000000000000000000000000000000000000000000000000000165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205460601c90565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610063565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561018c5761018c610c22565b6040519080825280602002602001820160405280156101b5578160200160208202803683370190505b5091505f805f5b600384015461ffff16821015610333575f818152600185016020526040812054905b600881101561031e57836101f181610c7c565b600388015490955061ffff168511905061031e57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020889052604081205460601c90805b888110156102b3578a818151811061025e5761025e610cb3565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036102a157600191506102b3565b806102ab81610c7c565b915050610244565b5080156102c3575061030c915050565b818a89815181106102d6576102d6610cb3565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101528761030581610c7c565b9850505050505b8061031681610c7c565b9150506101de565b5050808061032b90610c7c565b9150506101bc565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561039e5761039e610c22565b6040519080825280602002602001820160405280156103e357816020015b604080518082019091525f8152606060208201528152602001906001900390816103bc5790505b5060038201549092505f9061ffff1667ffffffffffffffff81111561040a5761040a610c22565b604051908082528060200260200182016040528015610433578160200160208202803683370190505b5090505f805f5b600385015461ffff16821015610811575f818152600186016020526040812054905b60088110156107fc578361046f81610c7c565b600389015490955061ffff16851190506107fc57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020899052604081205460601c90805b88811015610683578273ffffffffffffffffffffffffffffffffffffffff168c82815181106104f3576104f3610cb3565b60200260200101515f015173ffffffffffffffffffffffffffffffffffffffff160361067157838c828151811061052c5761052c610cb3565b6020026020010151602001518b838151811061054a5761054a610cb3565b602002602001015160ff168151811061056557610565610cb3565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060ff8a82815181106105c5576105c5610cb3565b602002602001015160ff161061063b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f3e32353620666e00000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b89818151811061064d5761064d610cb3565b60200260200101805180919061066290610ce0565b60ff1690525060019150610683565b8061067b81610c7c565b9150506104c2565b50801561069357506107ea915050565b818b89815181106106a6576106a6610cb3565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260038a015461ffff1667ffffffffffffffff8111156106ec576106ec610c22565b604051908082528060200260200182016040528015610715578160200160208202803683370190505b508b898151811061072857610728610cb3565b602002602001015160200181905250828b898151811061074a5761074a610cb3565b6020026020010151602001515f8151811061076757610767610cb3565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060018989815181106107c7576107c7610cb3565b60ff90921660209283029190910190910152876107e381610c7c565b9850505050505b806107f481610c7c565b91505061045c565b5050808061080990610c7c565b91505061043a565b505f5b82811015610875575f84828151811061082f5761082f610cb3565b602002602001015160ff1690505f87838151811061084f5761084f610cb3565b60200260200101516020015190508181525050808061086d90610c7c565b915050610814565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905f9061ffff1667ffffffffffffffff8111156108e5576108e5610c22565b60405190808252806020026020018201604052801561090e578160200160208202803683370190505b5092505f805b600384015461ffff16821015610a33575f818152600185016020526040812054905b6008811015610a1e578361094981610c7c565b600388015490955061ffff1685119050610a1e57600581901b82901b7fffffffff0000000000000000000000000000000000000000000000000000000081165f9081526020889052604090205460601c73ffffffffffffffffffffffffffffffffffffffff8a16819003610a0957818988815181106109ca576109ca610cb3565b7fffffffff000000000000000000000000000000000000000000000000000000009092166020928302919091019091015286610a0581610c7c565b9750505b50508080610a1690610c7c565b915050610936565b50508080610a2b90610c7c565b915050610914565b5050825250919050565b602080825282518282018190525f9190848201906040850190845b81811015610a8a57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610a58565b50909695505050505050565b5f8151808452602080850194508084015f5b83811015610ae65781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610aa8565b509495945050505050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b83811015610b89578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff168452870151878401879052610b7687850182610a96565b9588019593505090860190600101610b16565b509098975050505050505050565b5f60208284031215610ba7575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bca575f80fd5b9392505050565b602081525f610bca6020830184610a96565b5f60208284031215610bf3575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610bca575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610cac57610cac610c4f565b5060010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff821660ff8103610cf557610cf5610c4f565b6001019291505056fea2646970667358221220304344f689c304690d3559c18ab18a9959e7ed91e07093743d5588a76efc9e3964736f6c63430008150033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.