ETH Price: $2,858.56 (-2.81%)

Contract

0x85c8F4a67F4f9AD7b38e875c8FeDE7F4c878bFAc
Transaction Hash
Block
From
To
Transfer Ownersh...3121236742025-03-04 10:15:39327 days ago1741083339IN
0x85c8F4a6...4c878bFAc
0 ETH0.000000590.01
Revoke Role3121184522025-03-04 9:53:49327 days ago1741082029IN
0x85c8F4a6...4c878bFAc
0 ETH0.000000610.01
Grant Role3121183342025-03-04 9:53:19327 days ago1741081999IN
0x85c8F4a6...4c878bFAc
0 ETH0.000000950.01
Set Pool Config3096338592025-02-25 4:26:49334 days ago1740457609IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002340.011336
Set Pool Config3096338292025-02-25 4:26:42334 days ago1740457602IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002380.011813
Set Pool Config3096338152025-02-25 4:26:38334 days ago1740457598IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002410.012054
Set Pool Config3096337832025-02-25 4:26:30334 days ago1740457590IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002440.012423
Set Pool Config3096337692025-02-25 4:26:27334 days ago1740457587IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002450.012582
Set Pool Config3096337372025-02-25 4:26:19334 days ago1740457579IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002470.012778
Set Pool Config3096337222025-02-25 4:26:15334 days ago1740457575IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002460.012647
Set Pool Config3096336922025-02-25 4:26:07334 days ago1740457567IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002450.012495
Set Pool Config3096336782025-02-25 4:26:04334 days ago1740457564IN
0x85c8F4a6...4c878bFAc
0 ETH0.000002220.012776
Set Pool Config3096300932025-02-25 4:11:10335 days ago1740456670IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001580.014954
Set Pool Config3096300792025-02-25 4:11:07335 days ago1740456667IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001580.014979
Set Pool Config3096300632025-02-25 4:11:03335 days ago1740456663IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001560.014805
Set Pool Config3096300332025-02-25 4:10:55335 days ago1740456655IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001570.014863
Set Pool Config3096300192025-02-25 4:10:52335 days ago1740456652IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001590.015066
Set Pool Config3096299892025-02-25 4:10:44335 days ago1740456644IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001640.015685
Set Pool Config3096299762025-02-25 4:10:41335 days ago1740456641IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001680.016088
Set Pool Config3096299462025-02-25 4:10:33335 days ago1740456633IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001730.016654
Set Pool Config3096299322025-02-25 4:10:30335 days ago1740456630IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001760.016973
Set Pool Config3096299032025-02-25 4:10:22335 days ago1740456622IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001840.017806
Set Pool Config3096298882025-02-25 4:10:19335 days ago1740456619IN
0x85c8F4a6...4c878bFAc
0 ETH0.000001860.018101
Set Pool Config3096298582025-02-25 4:10:11335 days ago1740456611IN
0x85c8F4a6...4c878bFAc
0 ETH0.00000190.018462
Set Pool Config3096298442025-02-25 4:10:08335 days ago1740456608IN
0x85c8F4a6...4c878bFAc
0 ETH0.00000190.018493
View all transactions

Latest 21 internal transactions

Parent Transaction Hash Block From To
3727594202025-08-27 7:19:53151 days ago1756279193
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3703746252025-08-20 9:58:31158 days ago1755683911
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3703746252025-08-20 9:58:31158 days ago1755683911
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3703746252025-08-20 9:58:31158 days ago1755683911
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3703746252025-08-20 9:58:31158 days ago1755683911
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3096258522025-02-25 3:53:26335 days ago1740455606
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3096258222025-02-25 3:53:18335 days ago1740455598
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3096258082025-02-25 3:53:15335 days ago1740455595
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3096256282025-02-25 3:52:29335 days ago1740455549
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030937442025-02-06 2:48:40354 days ago1738810120
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030937302025-02-06 2:48:36354 days ago1738810116
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030937162025-02-06 2:48:33354 days ago1738810113
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936992025-02-06 2:48:29354 days ago1738810109
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936862025-02-06 2:48:25354 days ago1738810105
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936692025-02-06 2:48:21354 days ago1738810101
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936542025-02-06 2:48:17354 days ago1738810097
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936372025-02-06 2:48:13354 days ago1738810093
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936212025-02-06 2:48:09354 days ago1738810089
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030936062025-02-06 2:48:05354 days ago1738810085
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030935862025-02-06 2:48:00354 days ago1738810080
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH
3030935712025-02-06 2:47:57354 days ago1738810077
0x85c8F4a6...4c878bFAc
 Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xBda2ac32...f688fe735
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Diamond

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : Diamond.sol
// SPDX-License-Identifier: CC0-1.0
// from https://github.com/OpenZeppelin/EIPs/blob/master/assets/eip-2535/reference/Diamond.sol

pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
/******************************************************************************/

// NOTE:
// To see the various things in this file in their proper directory structure
// please download the zip archive version of this reference implementation.
// The zip archive also includes a deployment script and tests.

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

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

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

interface IDiamondCut is IDiamond {
    /// @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;
}

///////////////////////////////////////////////
// LibDiamond
// LibDiamond defines the diamond storage that is used by this reference
// implementation.
// LibDiamond contains internal functions and no external functions.
// LibDiamond internal functions are used by DiamondCutFacet,
// DiamondLoupeFacet and the diamond proxy contract (the Diamond contract).

error NoSelectorsGivenToAdd();
error NotContractOwner(address _user, address _contractOwner);
error NoSelectorsProvidedForFacetForCut(address _facetAddress);
error CannotAddSelectorsToZeroAddress(bytes4[] _selectors);
error NoBytecodeAtAddress(address _contractAddress, string _message);
error IncorrectFacetCutAction(uint8 _action);
error CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);
error CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);
error CannotReplaceImmutableFunction(bytes4 _selector);
error CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);
error CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);
error RemoveFacetAddressMustBeZeroAddress(address _facetAddress);
error CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);
error CannotRemoveImmutableFunction(bytes4 _selector);
error InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);

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

    struct FacetAddressAndSelectorPosition {
        address facetAddress;
        uint16 selectorPosition;
    }

    struct DiamondStorage {
        // function selector => facet address and selector position in selectors array
        mapping(bytes4 => FacetAddressAndSelectorPosition) facetAddressAndSelectorPosition;
        bytes4[] selectors;
        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 {
        if (msg.sender != diamondStorage().contractOwner) {
            revert NotContractOwner(msg.sender, diamondStorage().contractOwner);
        }
    }

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

    // Internal function version of diamondCut
    function diamondCut(IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {
        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
            bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;
            address facetAddress = _diamondCut[facetIndex].facetAddress;
            if (functionSelectors.length == 0) {
                revert NoSelectorsProvidedForFacetForCut(facetAddress);
            }
            IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
            if (action == IDiamond.FacetCutAction.Add) {
                addFunctions(facetAddress, functionSelectors);
            } else if (action == IDiamond.FacetCutAction.Replace) {
                replaceFunctions(facetAddress, functionSelectors);
            } else if (action == IDiamond.FacetCutAction.Remove) {
                removeFunctions(facetAddress, functionSelectors);
            } else {
                revert IncorrectFacetCutAction(uint8(action));
            }
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
        if (_facetAddress == address(0)) {
            revert CannotAddSelectorsToZeroAddress(_functionSelectors);
        }
        DiamondStorage storage ds = diamondStorage();
        uint16 selectorCount = uint16(ds.selectors.length);
        enforceHasContractCode(_facetAddress, "LibDiamondCut: Add facet has no code");
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            if (oldFacetAddress != address(0)) {
                revert CannotAddFunctionToDiamondThatAlreadyExists(selector);
            }
            ds.facetAddressAndSelectorPosition[selector] = FacetAddressAndSelectorPosition(
                _facetAddress,
                selectorCount
            );
            ds.selectors.push(selector);
            selectorCount++;
        }
    }

    function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
        DiamondStorage storage ds = diamondStorage();
        if (_facetAddress == address(0)) {
            revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);
        }
        enforceHasContractCode(_facetAddress, "LibDiamondCut: Replace facet has no code");
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            // can't replace immutable functions -- functions defined directly in the diamond in this case
            if (oldFacetAddress == address(this)) {
                revert CannotReplaceImmutableFunction(selector);
            }
            if (oldFacetAddress == _facetAddress) {
                revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);
            }
            if (oldFacetAddress == address(0)) {
                revert CannotReplaceFunctionThatDoesNotExists(selector);
            }
            // replace old facet address
            ds.facetAddressAndSelectorPosition[selector].facetAddress = _facetAddress;
        }
    }

    function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
        DiamondStorage storage ds = diamondStorage();
        uint256 selectorCount = ds.selectors.length;
        if (_facetAddress != address(0)) {
            revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);
        }
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            FacetAddressAndSelectorPosition memory oldFacetAddressAndSelectorPosition = ds
                .facetAddressAndSelectorPosition[selector];
            if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {
                revert CannotRemoveFunctionThatDoesNotExist(selector);
            }

            // can't remove immutable functions -- functions defined directly in the diamond
            if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {
                revert CannotRemoveImmutableFunction(selector);
            }
            // replace selector with last selector
            selectorCount--;
            if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {
                bytes4 lastSelector = ds.selectors[selectorCount];
                ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;
                ds.facetAddressAndSelectorPosition[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition
                    .selectorPosition;
            }
            // delete last selector
            ds.selectors.pop();
            delete ds.facetAddressAndSelectorPosition[selector];
        }
    }

    function initializeDiamondCut(address _init, bytes memory _calldata) internal {
        if (_init == address(0)) {
            return;
        }
        enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
        (bool success, bytes memory error) = _init.delegatecall(_calldata);
        if (!success) {
            if (error.length > 0) {
                // bubble up error
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(error)
                    revert(add(32, error), returndata_size)
                }
            } else {
                revert InitializationFunctionReverted(_init, _calldata);
            }
        }
    }

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

///////////////////////////////////////////////
// These facets are added to the diamond.
///////////////////////////////////////////////

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.diamondCut(_diamondCut, _init, _calldata);
    }
}

// The functions in DiamondLoupeFacet MUST be added to a diamond.
// The EIP-2535 Diamond standard requires these functions.

interface IERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceId The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

contract DiamondLoupeFacet is IDiamondLoupe, IERC165 {
    // 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();
        uint256 selectorCount = ds.selectors.length;
        // create an array set to the maximum size possible
        facets_ = new Facet[](selectorCount);
        // create an array for counting the number of selectors for each facet
        uint16[] memory numFacetSelectors = new uint16[](selectorCount);
        // total number of facets
        uint256 numFacets;
        // loop through function selectors
        for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {
            bytes4 selector = ds.selectors[selectorIndex];
            address facetAddress_ = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            bool continueLoop = false;
            // find the functionSelectors array for selector and add selector to it
            for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {
                if (facets_[facetIndex].facetAddress == facetAddress_) {
                    facets_[facetIndex].functionSelectors[numFacetSelectors[facetIndex]] = selector;
                    numFacetSelectors[facetIndex]++;
                    continueLoop = true;
                    break;
                }
            }
            // if functionSelectors array exists for selector then continue loop
            if (continueLoop) {
                continueLoop = false;
                continue;
            }
            // create a new functionSelectors array for selector
            facets_[numFacets].facetAddress = facetAddress_;
            facets_[numFacets].functionSelectors = new bytes4[](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 selectorCount = ds.selectors.length;
        uint256 numSelectors;
        _facetFunctionSelectors = new bytes4[](selectorCount);
        // loop through function selectors
        for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {
            bytes4 selector = ds.selectors[selectorIndex];
            address facetAddress_ = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            if (_facet == facetAddress_) {
                _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();
        uint256 selectorCount = ds.selectors.length;
        // create an array set to the maximum size possible
        facetAddresses_ = new address[](selectorCount);
        uint256 numFacets;
        // loop through function selectors
        for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {
            bytes4 selector = ds.selectors[selectorIndex];
            address facetAddress_ = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            bool continueLoop = false;
            // see if we have collected the address already and break out of loop if we have
            for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {
                if (facetAddress_ == facetAddresses_[facetIndex]) {
                    continueLoop = true;
                    break;
                }
            }
            // continue loop if we already have the address
            if (continueLoop) {
                continueLoop = false;
                continue;
            }
            // include address
            facetAddresses_[numFacets] = facetAddress_;
            numFacets++;
        }
        // Set the number of facet addresses in the array
        assembly {
            mstore(facetAddresses_, numFacets)
        }
    }

    /// @notice Gets the facet address 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_ = ds.facetAddressAndSelectorPosition[_functionSelector].facetAddress;
    }

    // This implements ERC-165.
    function supportsInterface(bytes4 _interfaceId) external view override returns (bool) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        return ds.supportedInterfaces[_interfaceId];
    }
}

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

contract OwnershipFacet is IERC173 {
    function transferOwnership(address _newOwner) external override {
        LibDiamond.enforceIsContractOwner();
        LibDiamond.setContractOwner(_newOwner);
    }

    function owner() external view override returns (address owner_) {
        owner_ = LibDiamond.contractOwner();
    }
}

///////////////////////////////////////////////

///////////////////////////////////////////////
// DiamondInit
// This contract and function are used to initialize state variables and/or do other actions
// when the `diamondCut` function is called.
// It is expected that this contract is customized if you want to deploy your diamond
// with data from a deployment script. Use the init function to initialize state variables
// of your diamond. Add parameters to the init funciton if you need to.
// DiamondInit can be used during deployment or for upgrades.

// Adding parameters to the `init` or other functions you add here can make a single deployed
// DiamondInit contract reusable accross upgrades, and can be used for multiple diamonds.

contract DiamondInit {
    // You can add parameters to this function in order to pass in
    // data to set your own state variables
    function init() external {
        // adding ERC165 data
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        ds.supportedInterfaces[type(IERC165).interfaceId] = true;
        ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true;
        ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true;
        ds.supportedInterfaces[type(IERC173).interfaceId] = true;

        // add your own state variables
        // EIP-2535 specifies that the `diamondCut` function takes two optional
        // arguments: address _init and bytes calldata _calldata
        // These arguments are used to execute an arbitrary function using delegatecall
        // in order to set state variables in the diamond during deployment or an upgrade
        // More info in the EIP2535 Diamonds standard.
    }
}

///////////////////////////////////////////////
// DiamondMultiInit
// This version of DiamondInit can be used to execute multiple initialization functions.
// It is expected that this contract is customized if you want to deploy or upgrade your diamond with it.

error AddressAndCalldataLengthDoNotMatch(uint256 _addressesLength, uint256 _calldataLength);

contract DiamondMultiInit {
    // This function is provided in the third parameter of the `diamondCut` function.
    // The `diamondCut` function executes this function to execute multiple initializer functions for a single upgrade.

    function multiInit(address[] calldata _addresses, bytes[] calldata _calldata) external {
        if (_addresses.length != _calldata.length) {
            revert AddressAndCalldataLengthDoNotMatch(_addresses.length, _calldata.length);
        }
        for (uint i; i < _addresses.length; i++) {
            LibDiamond.initializeDiamondCut(_addresses[i], _calldata[i]);
        }
    }
}

///////////////////////////////////////////////
// Diamond
// The diamond proxy contract.

// When no function exists for function called
error FunctionNotFound(bytes4 _functionSelector);

// This is used in diamond constructor
// more arguments are added to this struct
// this avoids stack too deep errors
struct DiamondArgs {
    address owner;
    address init;
    bytes initCalldata;
}

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

    constructor(IDiamondCut.FacetCut[] memory _diamondCut, DiamondArgs memory _args) payable {
        LibDiamond.setContractOwner(_args.owner);
        LibDiamond.diamondCut(_diamondCut, _args.init, _args.initCalldata);

        // Code can be added here to perform actions and set state variables.
    }

    // 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;
        // get diamond storage
        assembly {
            ds.slot := position
        }
        // get facet from function selector
        address facet = ds.facetAddressAndSelectorPosition[msg.sig].facetAddress;
        if (facet == address(0)) {
            revert FunctionNotFound(msg.sig);
        }
        // Execute external function from facet using delegatecall and return any value.
        assembly {
            // copy function selector and any arguments
            calldatacopy(0, 0, calldatasize())
            // execute function call using the facet
            let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
            // get any return value
            returndatacopy(0, 0, returndatasize())
            // return any return value or error back to the caller
            switch result
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    receive() external payable {}
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamond.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamond.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"init","type":"address"},{"internalType":"bytes","name":"initCalldata","type":"bytes"}],"internalType":"struct DiamondArgs","name":"_args","type":"tuple"}],"stateMutability":"payable","type":"constructor"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotAddFunctionToDiamondThatAlreadyExists","type":"error"},{"inputs":[{"internalType":"bytes4[]","name":"_selectors","type":"bytes4[]"}],"name":"CannotAddSelectorsToZeroAddress","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotRemoveFunctionThatDoesNotExist","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotRemoveImmutableFunction","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotReplaceFunctionThatDoesNotExists","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet","type":"error"},{"inputs":[{"internalType":"bytes4[]","name":"_selectors","type":"bytes4[]"}],"name":"CannotReplaceFunctionsFromFacetWithZeroAddress","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"CannotReplaceImmutableFunction","type":"error"},{"inputs":[{"internalType":"bytes4","name":"_functionSelector","type":"bytes4"}],"name":"FunctionNotFound","type":"error"},{"inputs":[{"internalType":"uint8","name":"_action","type":"uint8"}],"name":"IncorrectFacetCutAction","type":"error"},{"inputs":[{"internalType":"address","name":"_initializationContractAddress","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"InitializationFunctionReverted","type":"error"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"string","name":"_message","type":"string"}],"name":"NoBytecodeAtAddress","type":"error"},{"inputs":[{"internalType":"address","name":"_facetAddress","type":"address"}],"name":"NoSelectorsProvidedForFacetForCut","type":"error"},{"inputs":[{"internalType":"address","name":"_facetAddress","type":"address"}],"name":"RemoveFacetAddressMustBeZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamond.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":false,"internalType":"struct IDiamond.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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]

0x6080604052610cf2803803806100148161098c565b92833981016040828203126108745781516001600160401b0381116108745782019181601f8401121561087457825190610055610050836109b1565b61098c565b93602085848152016020819460051b830101918583116108745760208101915b83831061087857505050506020810151906001600160401b0382116108745701606081840312610874576100a761094e565b6100b0826109c8565b81526100be602083016109c8565b60208201908152604083015190926001600160401b038211610874570184601f82011215610874578051906100f5610050836109dc565b95828752602083830101116108745760208288959493825f9401838a015e8701015260408101859052517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f80546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3515f926001600160a01b0390911691905b815184101561075a5760406101aa85846109f7565b510151916001600160a01b036101c086836109f7565b515116938351156107475760206101d787846109f7565b510151600381101561073357806103e1575084156103c25761ffff5f516020610cd25f395f51905f5254169261024d610210606061098c565b602481527f4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20602082015263636f646560e01b604082015287610bba565b5f935b85518510156103aa576001600160e01b031961026c86886109f7565b51165f8181525f516020610cb25f395f51905f5260205260409020546001600160a01b0316610398576102fe6102a061096d565b89815261ffff9390931660208085018281525f8581525f516020610cb25f395f51905f5290925260409091209451855491516001600160b01b03199092166001600160a01b03919091161760a09190911b61ffff60a01b1617909355565b5f516020610cd25f395f51905f525490680100000000000000008210156103845761033e82600161035b94015f516020610cd25f395f51905f5255610a43565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b61ffff81146103705760019485019401610250565b634e487b7160e01b5f52601160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b63ebbf5d0760e01b5f5260045260245ffd5b5094509490959250600191505b019291939093610195565b6040516302b8da0760e21b8152806103dd8660048301610a9b565b0390fd5b9496946001810361053a5750861561051f57919391610444610403606061098c565b602881527f4c69624469616d6f6e644375743a205265706c61636520666163657420686173602082015267206e6f20636f646560c01b604082015288610bba565b6001600160a01b038716945f5b855181101561050e576001600160e01b031961046d82886109f7565b51165f8181525f516020610cb25f395f51905f5260205260409020546001600160a01b03163081146104fb578a81146104e857156104d6575f9081525f516020610cb25f395f51905f526020526040902080546001600160a01b03191688179055600101610451565b637479f93960e01b5f5260045260245ffd5b50631ac6ce8d60e11b5f5260045260245ffd5b50632901806d60e11b5f5260045260245ffd5b5094509490955060019192506103b7565b60405163cd98a96f60e01b8152806103dd8660048301610a9b565b939493919290916002810361071d57505f516020610cd25f395f51905f5254968061070b57505f5b85518110156106fd576001600160e01b031961057e82886109f7565b511690815f525f516020610cb25f395f51905f5260205260405f20986105a261096d565b99549960018060a01b038b1680825261ffff602083019c60a01c168c52156106ea57516001600160a01b031630146106d7578015610370575f1901988961ffff82511603610663575b505f516020610cd25f395f51905f525491821561064f576001925f190161061181610a43565b63ffffffff82549160031b1b191690555f516020610cd25f395f51905f52555f525f516020610cb25f395f51905f526020525f604081205501610562565b634e487b7160e01b5f52603160045260245ffd5b6106d19061ffff6106738c610a43565b90549060031b1c60e01b9161068e8361033e84845116610a43565b516001600160e01b03199092165f9081525f516020610cb25f395f51905f5260205260409020805461ffff60a01b19169190921660a01b61ffff60a01b16179055565b896105eb565b82630df5fd6160e31b5f5260045260245ffd5b83637a08a22d60e01b5f5260045260245ffd5b5093509360019195506103b7565b63d091bc8160e01b5f5260045260245ffd5b60ff90633ff4d20f60e11b5f521660045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b8463e767f91f60e01b5f5260045260245ffd5b9392506040519060608201906060835251809152608082019060808160051b84010195915f905b8282106107de576107d087877f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67388806107c88e856020840152828103604084015286610a1f565b0390a1610ade565b60405160b89081610bfa8239f35b848803607f19018152835180516001600160a01b03168952602081015194989394929391926060830191600382101561073357604060809160209384870152015193606060408201528451809452019201905f905b80821061085157505050602080600192990192019201909291610781565b82516001600160e01b031916845260209384019390920191600190910190610833565b5f80fd5b82516001600160401b0381116108745782016060818903601f190112610874576108a061094e565b906108ad602082016109c8565b82526040810151600381101561087457602083015260608101516001600160401b03811161087457602091010188601f820112156108745780516108f3610050826109b1565b9160208084848152019260051b820101908b821161087457602001915b81831061092d575050506040820152815260209283019201610075565b82516001600160e01b03198116810361087457815260209283019201610910565b60405190606082016001600160401b0381118382101761038457604052565b60408051919082016001600160401b0381118382101761038457604052565b6040519190601f01601f191682016001600160401b0381118382101761038457604052565b6001600160401b0381116103845760051b60200190565b51906001600160a01b038216820361087457565b6001600160401b03811161038457601f01601f191660200190565b8051821015610a0b5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b905f516020610cd25f395f51905f5254821015610a0b575f516020610cd25f395f51905f525f52600382901c7fc0d727610ea16241eff4447d08bb1b4595f7d2ec4515282437a13b7d0df4b922019160021b601c1690565b60206040818301928281528451809452019201905f5b818110610abe5750505090565b82516001600160e01b031916845260209384019390920191600101610ab1565b6001600160a01b03811691908215610bb5575f8091610b41610b00606061098c565b602881527f4c69624469616d6f6e644375743a205f696e6974206164647265737320686173602082015267206e6f20636f646560c01b604082015282610bba565b83519060208501905af4913d15610bad573d92610b60610050856109dc565b9384523d5f602086013e5b15610b7557505050565b825115610b8457825160208401fd5b6103dd60405192839263192105d760e01b84526004840152604060248401526044830190610a1f565b606092610b6b565b505050565b803b15610bc5575050565b6040805163919834b960e01b81526001600160a01b03909216600483015260248201529081906103dd906044830190610a1f56fe608060405236156080575f80356001600160e01b0319168082527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040909120546001600160a01b0316908115606e575f8083368280378136915af43d5f803e15606a573d5ff35b3d5ffd5b630a82dd7360e31b5f5260045260245ffd5b00fea2646970667358221220336936b58923019825db261d3a6d6b0fd20653db394d5c1bb98f6996f8209c9b64736f6c634300081c0033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131cc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000068000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000a200000000000000000000000000000000000000000000000000000000000000ae000000000000000000000000036c1b4582654e1293725d790c7027c6d875577490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c00000000000000000000000000000000000000000000000000000000000000000000000000000000146e291d96bf1a6a9178e18ee9d81133b129ebed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000005cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed6270000000000000000000000000000000000000000000000000000000001ffc9a70000000000000000000000000000000000000000000000000000000000000000000000000000000052162c310565868e76d60b3e1fc69cc4c0ad518900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000479ba5097000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000e30c397800000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000000000000000000000000000a1418018b06147e1c3aef8d873cd95130684e03300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001249ffd567000000000000000000000000000000000000000000000000000000000606fd4f000000000000000000000000000000000000000000000000000000005315f03000000000000000000000000000000000000000000000000000000000e1e735bd000000000000000000000000000000000000000000000000000000009010d07c00000000000000000000000000000000000000000000000000000000ca15c873000000000000000000000000000000000000000000000000000000002f2ff15d0000000000000000000000000000000000000000000000000000000091d14854000000000000000000000000000000000000000000000000000000005c60da1b00000000000000000000000000000000000000000000000000000000c4d66de800000000000000000000000000000000000000000000000000000000d547741f00000000000000000000000000000000000000000000000000000000ab02b87000000000000000000000000000000000000000000000000000000000d1fd27b3000000000000000000000000000000000000000000000000000000003e13fdb60000000000000000000000000000000000000000000000000000000047f391de00000000000000000000000000000000000000000000000000000000157fdf12000000000000000000000000000000000000000000000000000000009019d0220000000000000000000000000000000000000000000000000000000064ca472900000000000000000000000000000000000000000000000000000000000000000000000000000000831dca42a5f95761f0679c8e388ae1a296c613d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001332404484000000000000000000000000000000000000000000000000000000005252f3a200000000000000000000000000000000000000000000000000000000f190e42700000000000000000000000000000000000000000000000000000000f4a72166000000000000000000000000000000000000000000000000000000008f3ccea40000000000000000000000000000000000000000000000000000000021423f6700000000000000000000000000000000000000000000000000000000b9f2aa03000000000000000000000000000000000000000000000000000000007483b72000000000000000000000000000000000000000000000000000000000c711352c00000000000000000000000000000000000000000000000000000000ec6a42b000000000000000000000000000000000000000000000000000000000f8f9063200000000000000000000000000000000000000000000000000000000a98ac3980000000000000000000000000000000000000000000000000000000077ddc08300000000000000000000000000000000000000000000000000000000657e156c000000000000000000000000000000000000000000000000000000000296f66b000000000000000000000000000000000000000000000000000000006b96843a00000000000000000000000000000000000000000000000000000000ead29b0b00000000000000000000000000000000000000000000000000000000b95ed06f00000000000000000000000000000000000000000000000000000000eec332fd000000000000000000000000000000000000000000000000000000000000000000000000000000004b1eac6dea3316be5f33b950a12bcc41482d86530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000025876dfce000000000000000000000000000000000000000000000000000000007d8faddd00000000000000000000000000000000000000000000000000000000000000000000000000000000eb678f40e2b3b208e5a89c9d1d3b08aebe109e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000029811801300000000000000000000000000000000000000000000000000000000926d2886000000000000000000000000000000000000000000000000000000000000000000000000000000007b0f526779e75490d7c7ad179a284b8c34cd997b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006d954863c0000000000000000000000000000000000000000000000000000000042ac97a10000000000000000000000000000000000000000000000000000000095e5ef67000000000000000000000000000000000000000000000000000000003817ab0c000000000000000000000000000000000000000000000000000000008e28f7e100000000000000000000000000000000000000000000000000000000d53e90520000000000000000000000000000000000000000000000000000000000000000000000000000000044cbfc3ce762fc0fee9ddd6372804b7b660176bc00000000000000000000000005d4c0d126324211eedb57eef05fd727fc8299c100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405236156080575f80356001600160e01b0319168082527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040909120546001600160a01b0316908115606e575f8083368280378136915af43d5f803e15606a573d5ff35b3d5ffd5b630a82dd7360e31b5f5260045260245ffd5b00fea2646970667358221220336936b58923019825db261d3a6d6b0fd20653db394d5c1bb98f6996f8209c9b64736f6c634300081c0033

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
0x85c8F4a67F4f9AD7b38e875c8FeDE7F4c878bFAc
Loading...
Loading
[ Download: CSV Export  ]
[ 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.