ETH Price: $2,862.01 (-2.70%)

Contract

0xB7FDda5330DaEA72514Db2b84211afEBD19277Ca

More Info

Private Name Tags

Multichain Info

1 address found via
Transaction Hash
Block
From
To
Diamond Cut3554243382025-07-08 4:36:53202 days ago1751949413IN
0xB7FDda53...BD19277Ca
0 ETH0.000004840.01
Diamond Cut3554033992025-07-08 3:08:26202 days ago1751944106IN
0xB7FDda53...BD19277Ca
0 ETH0.000001430.01
Swap Tokens Gene...3534150432025-07-02 8:44:03207 days ago1751445843IN
0xB7FDda53...BD19277Ca
0 ETH0.000003630.01
Diamond Cut3533039152025-07-02 1:00:18208 days ago1751418018IN
0xB7FDda53...BD19277Ca
0 ETH0.000004840.01
Set Fee Recipien...3530630892025-07-01 8:15:41208 days ago1751357741IN
0xB7FDda53...BD19277Ca
0 ETH0.000000380.01
Diamond Cut3530589242025-07-01 7:58:20208 days ago1751356700IN
0xB7FDda53...BD19277Ca
0 ETH0.000001450.01
Swap Tokens Gene...3440289122025-06-05 3:06:30235 days ago1749092790IN
0xB7FDda53...BD19277Ca
0.107 ETH0.000004010.01
Swap Tokens Gene...3120724622025-03-04 6:42:04327 days ago1741070524IN
0xB7FDda53...BD19277Ca
0 ETH0.000004240.01
0x76220b802974792392025-01-20 18:02:03370 days ago1737396123IN
0xB7FDda53...BD19277Ca
0.024 ETH0.000095360.658505
0x76220b802865861882024-12-20 2:10:22402 days ago1734660622IN
0xB7FDda53...BD19277Ca
0 ETH0.000005710.013116
0x76220b802837066062024-12-11 16:08:07410 days ago1733933287IN
0xB7FDda53...BD19277Ca
0.13 ETH0.000013370.061127
0x76220b802804115802024-12-02 1:48:20420 days ago1733104100IN
0xB7FDda53...BD19277Ca
0.2 ETH0.000004980.026742
0x76220b802794245782024-11-29 4:57:37423 days ago1732856257IN
0xB7FDda53...BD19277Ca
0.05 ETH0.000001370.01
Swap Tokens Gene...2770870942024-11-22 9:33:37429 days ago1732268017IN
0xB7FDda53...BD19277Ca
0 ETH0.000008030.018831
0xa84f444c2698419622024-11-01 7:33:44450 days ago1730446424IN
0xB7FDda53...BD19277Ca
0 ETH0.000002520.01
0x76220b802691453122024-10-30 6:57:37452 days ago1730271457IN
0xB7FDda53...BD19277Ca
0 ETH0.000003330.01
Swap Tokens Gene...2660613162024-10-21 7:42:14461 days ago1729496534IN
0xB7FDda53...BD19277Ca
0 ETH0.000005760.01
0x9ac6141d2653331192024-10-19 4:52:58464 days ago1729313578IN
0xB7FDda53...BD19277Ca
0.0048 ETH0.000003750.01
Swap Tokens Gene...2602588692024-10-04 10:01:46478 days ago1728036106IN
0xB7FDda53...BD19277Ca
0 ETH0.000003170.01
Swap Tokens Gene...2600262052024-10-03 17:47:40479 days ago1727977660IN
0xB7FDda53...BD19277Ca
0 ETH0.000003630.01
0x76220b802588620252024-09-30 8:23:23482 days ago1727684603IN
0xB7FDda53...BD19277Ca
0 ETH0.000002490.01
Swap Tokens Gene...2586287482024-09-29 16:03:15483 days ago1727625795IN
0xB7FDda53...BD19277Ca
0 ETH0.000003710.01
Swap Tokens Gene...2583709262024-09-28 22:02:32484 days ago1727560952IN
0xB7FDda53...BD19277Ca
0 ETH0.000003050.01
Swap Tokens Gene...2583703112024-09-28 21:59:58484 days ago1727560798IN
0xB7FDda53...BD19277Ca
0 ETH0.000003120.01
Swap Tokens Gene...2582974182024-09-28 16:54:20484 days ago1727542460IN
0xB7FDda53...BD19277Ca
0 ETH0.00000360.01
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
3440289122025-06-05 3:06:30235 days ago1749092790
0xB7FDda53...BD19277Ca
0.107 ETH
2974792392025-01-20 18:02:03370 days ago1737396123
0xB7FDda53...BD19277Ca
0.000072 ETH
2974792392025-01-20 18:02:03370 days ago1737396123
0xB7FDda53...BD19277Ca
0.023928 ETH
2837066062024-12-11 16:08:07410 days ago1733933287
0xB7FDda53...BD19277Ca
0.00039 ETH
2837066062024-12-11 16:08:07410 days ago1733933287
0xB7FDda53...BD19277Ca
0.12961 ETH
2804115802024-12-02 1:48:20420 days ago1733104100
0xB7FDda53...BD19277Ca
0.0006 ETH
2804115802024-12-02 1:48:20420 days ago1733104100
0xB7FDda53...BD19277Ca
0.1994 ETH
2794245782024-11-29 4:57:37423 days ago1732856257
0xB7FDda53...BD19277Ca
0.00015 ETH
2794245782024-11-29 4:57:37423 days ago1732856257
0xB7FDda53...BD19277Ca
0.04985 ETH
2770870942024-11-22 9:33:37429 days ago1732268017
0xB7FDda53...BD19277Ca
0.00684253 ETH
2770870942024-11-22 9:33:37429 days ago1732268017
0xB7FDda53...BD19277Ca
0.00684253 ETH
2653331192024-10-19 4:52:58464 days ago1729313578
0xB7FDda53...BD19277Ca
0.0000144 ETH
2653331192024-10-19 4:52:58464 days ago1729313578
0xB7FDda53...BD19277Ca
0.0047856 ETH
2602588692024-10-04 10:01:46478 days ago1728036106
0xB7FDda53...BD19277Ca
0.0666993 ETH
2602588692024-10-04 10:01:46478 days ago1728036106
0xB7FDda53...BD19277Ca
0.0666993 ETH
2600262052024-10-03 17:47:40479 days ago1727977660
0xB7FDda53...BD19277Ca
0.0690921 ETH
2600262052024-10-03 17:47:40479 days ago1727977660
0xB7FDda53...BD19277Ca
0.0690921 ETH
2586287482024-09-29 16:03:15483 days ago1727625795
0xB7FDda53...BD19277Ca
0.0970081 ETH
2586287482024-09-29 16:03:15483 days ago1727625795
0xB7FDda53...BD19277Ca
0.0970081 ETH
2583709262024-09-28 22:02:32484 days ago1727560952
0xB7FDda53...BD19277Ca
0.02991 ETH
2583709262024-09-28 22:02:32484 days ago1727560952
0xB7FDda53...BD19277Ca
0.02991 ETH
2583703112024-09-28 21:59:58484 days ago1727560798
0xB7FDda53...BD19277Ca
0.0602188 ETH
2583703112024-09-28 21:59:58484 days ago1727560798
0xB7FDda53...BD19277Ca
0.0602188 ETH
2582974182024-09-28 16:54:20484 days ago1727542460
0xB7FDda53...BD19277Ca
0.0599197 ETH
2582974182024-09-28 16:54:20484 days ago1727542460
0xB7FDda53...BD19277Ca
0.0599197 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MiraidonDiamond

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {LibDiamond} from "./libraries/LibDiamond.sol";
import {IDiamondCut} from "./interfaces/IDiamondCut.sol";
import {LibUtil} from "./libraries/LibUtil.sol";
import {GenericErrors} from "./libraries/GenericErrors.sol";

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

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

    /**
     * Find facet for function that is called and execute the
     * function if a facet is found and return any value.
     * solhint-disable-next-line no-complex-fallback
     */
    fallback() external payable {
        LibDiamond.DiamondStorage storage ds;
        bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;

        // get diamond storage
        // solhint-disable-next-line no-inline-assembly
        assembly {
            ds.slot := position
        }

        // get facet from function selector
        address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress;

        require(facet != address(0), GenericErrors.E46);

        // Execute external function from facet using delegatecall and return any value.
        // solhint-disable-next-line no-inline-assembly
        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())
            }
        }
    }

    /**
     * Able to receive ether
     * solhint-disable-next-line no-empty-blocks
     */
    receive() external payable {}
}

File 2 of 6 : IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

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

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

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

File 3 of 6 : GenericErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

library GenericErrors {
    ///// TokenAddressIsZero();
    string internal constant E00 = "E00";

    ///// TokenNotSupported();
    string internal constant E01 = "E01";

    ///// CannotBridgeToSameNetwork();
    string internal constant E02 = "E02";

    ///// ZeroPostSwapBalance();
    string internal constant E03 = "E03";

    ///// NoSwapDataProvided();
    string internal constant E04 = "E04";

    ///// NativeValueWithERC();
    string internal constant E05 = "E05";

    ///// ContractCallNotAllowed();
    string internal constant E06 = "E06";

    ///// NullAddrIsNotAValidSpender();
    string internal constant E07 = "E07";

    ///// NullAddrIsNotAnERC20Token();
    string internal constant E08 = "E08";

    ///// NoTransferToNullAddress();
    string internal constant E09 = "E09";

    ///// NativeAssetTransferFailed();
    string internal constant E10 = "E10";

    ///// InvalidBridgeConfigLength();
    string internal constant E11 = "E11";

    ///// InvalidAmount();
    string internal constant E12 = "E12";

    ///// InvalidContract();
    string internal constant E13 = "E13";

    ///// InvalidConfig();
    string internal constant E14 = "E14";

    ///// UnsupportedChainId(uint256 chainId);
    string internal constant E15 = "E15";

    ///// InvalidReceiver();
    string internal constant E16 = "E16";

    ///// InvalidDestinationChain();
    string internal constant E17 = "E17";

    ///// InvalidSendingToken();
    string internal constant E18 = "E18";

    ///// InvalidCaller();
    string internal constant E19 = "E19";

    ///// AlreadyInitialized();
    string internal constant E20 = "E20";

    ///// NotInitialized();
    string internal constant E21 = "E21";

    ///// OnlyContractOwner();
    string internal constant E22 = "E22";

    ///// CannotAuthoriseSelf();
    string internal constant E23 = "E23";

    ///// RecoveryAddressCannotBeZero();
    string internal constant E24 = "E24";

    ///// CannotDepositNativeToken();
    string internal constant E25 = "E25";

    ///// InvalidCallData();
    string internal constant E26 = "E26";

    ///// NativeAssetNotSupported();
    string internal constant E27 = "E27";

    ///// UnAuthorized();
    string internal constant E28 = "E28";

    ///// NoSwapFromZeroBalance();
    string internal constant E29 = "E29";

    ///// InvalidFallbackAddress();
    string internal constant E30 = "E30";

    ///// CumulativeSlippageTooHigh(uint256 minAmount, uint256 receivedAmount);
    string internal constant E31 = "E31";

    ///// InsufficientBalance(uint256 required, uint256 balance);
    string internal constant E32 = "E32";

    ///// ZeroAmount();
    string internal constant E33 = "E33";

    ///// InvalidFee();
    string internal constant E34 = "E34";

    ///// InformationMismatch();
    string internal constant E35 = "E35";

    ///// NotAContract();
    string internal constant E36 = "E36";

    ///// NotEnoughBalance(uint256 requested, uint256 available);
    string internal constant E37 = "E37";

    ///// ReentrancyError();
    string internal constant E38 = "E38";

    ///// NotImplementError();
    string internal constant E39 = "E39";

    // Diamond specific errors
    //// error IncorrectFacetCutAction();
    string internal constant E40 = "E40";

    //// error NoSelectorsInFace();
    string internal constant E41 = "E41";

    //// error FunctionAlreadyExists();
    string internal constant E42 = "E42";

    //// error FacetAddressIsZero();
    string internal constant E43 = "E43";

    //// error FacetAddressIsNotZero();
    string internal constant E44 = "E44";

    //// error FacetContainsNoCode();
    string internal constant E45 = "E45";

    //// error FunctionDoesNotExist();
    string internal constant E46 = "E46";

    //// error FunctionIsImmutable();
    string internal constant E47 = "E47";

    //// error InitZeroButCalldataNotEmpty();
    string internal constant E48 = "E48";

    //// error CalldataEmptyButInitNotZero();
    string internal constant E49 = "E49";

    //// error InitReverted();
    string internal constant E50 = "E50";
    // ----------------

    //// // LibBytes specific errors
    string internal constant E51 = "E51";

    //// error SliceOverflow();
    string internal constant E52 = "E52";

    //// error SliceOutOfBounds();
    string internal constant E53 = "E53";

    //// error AddressOutOfBounds();
    string internal constant E54 = "E54";

    //// error UintOutOfBounds();
    string internal constant E55 = "E55";

    //// // -------------------------

    //// error InvalidRouter();
    string internal constant E56 = "E56";

    /// Stargate Errors ///
    //// error UnknownStargatePool();
    string internal constant E57 = "E57";

    //// error UnknownLayerZeroChain();
    string internal constant E58 = "E58";

    //// error InvalidStargateRouter();
    string internal constant E59 = "E59";

    //// error ContractPaused();
    string internal constant E60 = "E60";

    //// error CannotPauseSelf();
    string internal constant E61 = "E61";

    /// error InvalidFeeNumerator()
    string internal constant E62 = "E62";
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {GenericErrors} from "./GenericErrors.sol";

library LibBytes {
    // solhint-disable no-inline-assembly

    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    ) internal pure returns (bytes memory) {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(
                0x40,
                and(
                    add(add(end, iszero(add(length, mload(_preBytes)))), 31),
                    not(31) // Round down to the nearest 32 bytes.
                )
            )
        }

        return tempBytes;
    }

    function concatStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    ) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(
                and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),
                2
            )
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    ) internal pure returns (bytes memory) {
        require(_length + 31 >= _length, GenericErrors.E52);
        require(_bytes.length >= _start + _length, GenericErrors.E53);

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(
                    add(tempBytes, lengthmod),
                    mul(0x20, iszero(lengthmod))
                )
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(
                        add(
                            add(_bytes, lengthmod),
                            mul(0x20, iszero(lengthmod))
                        ),
                        _start
                    )
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (address) {
        require(_bytes.length >= _start + 20, GenericErrors.E54);
        address tempAddress;

        assembly {
            tempAddress := div(
                mload(add(add(_bytes, 0x20), _start)),
                0x1000000000000000000000000
            )
        }

        return tempAddress;
    }

    function toUint8(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1, GenericErrors.E55);
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, GenericErrors.E55);
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, GenericErrors.E55);
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, GenericErrors.E55);
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, GenericErrors.E55);
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, GenericErrors.E55);
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, GenericErrors.E55);
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, GenericErrors.E55);
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(
        bytes memory _preBytes,
        bytes memory _postBytes
    ) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                    // the next line is the loop condition:
                    // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    ) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(
                and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),
                2
            )
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        // solhint-disable-next-line no-empty-blocks
                        for {

                        } eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IDiamondCut} from "../interfaces/IDiamondCut.sol";
import {LibUtil} from "./LibUtil.sol";
import {GenericErrors} from "./GenericErrors.sol";

/// Implementation of EIP-2535 Diamond Standard
/// https://eips.ethereum.org/EIPS/eip-2535
library LibDiamond {
    bytes32 internal constant DIAMOND_STORAGE_POSITION =
        keccak256("diamond.standard.diamond.storage");

    // Diamond specific errors
    error IncorrectFacetCutAction();
    error NoSelectorsInFace();
    error FunctionAlreadyExists();
    error FacetAddressIsZero();
    error FacetAddressIsNotZero();
    error FacetContainsNoCode();
    error FunctionDoesNotExist();
    error FunctionIsImmutable();
    error InitZeroButCalldataNotEmpty();
    error CalldataEmptyButInitNotZero();
    error InitReverted();
    // ----------------

    struct FacetAddressAndPosition {
        address facetAddress;
        uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
    }

    struct FacetFunctionSelectors {
        bytes4[] functionSelectors;
        uint256 facetAddressPosition; // position of facetAddress in facetAddresses array
    }

    struct DiamondStorage {
        // maps function selector to the facet address and
        // the position of the selector in the facetFunctionSelectors.selectors array
        mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
        // maps facet addresses to function selectors
        mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
        // facet addresses
        address[] facetAddresses;
        // 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;
        // solhint-disable-next-line no-inline-assembly
        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,
            GenericErrors.E22
        );
        //if (msg.sender != diamondStorage().contractOwner)
        //revert OnlyContractOwner();
    }

    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++
        ) {
            IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
            require(
                action == IDiamondCut.FacetCutAction.Add ||
                    action == IDiamondCut.FacetCutAction.Replace ||
                    action == IDiamondCut.FacetCutAction.Remove,
                GenericErrors.E40
            );
            if (action == IDiamondCut.FacetCutAction.Add) {
                addFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            } else if (action == IDiamondCut.FacetCutAction.Replace) {
                replaceFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            } else if (action == IDiamondCut.FacetCutAction.Remove) {
                removeFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            }
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(_functionSelectors.length != 0, GenericErrors.E41);
        DiamondStorage storage ds = diamondStorage();
        require(!LibUtil.isZeroAddress(_facetAddress), GenericErrors.E43);
        uint96 selectorPosition = uint96(
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.length
        );
        // add new facet address if it does not exist
        if (selectorPosition == 0) {
            addFacet(ds, _facetAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;

        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            require(LibUtil.isZeroAddress(oldFacetAddress), GenericErrors.E44);
            addFunction(ds, selector, selectorPosition, _facetAddress);
            unchecked {
                ++selectorPosition;
                ++selectorIndex;
            }
        }
    }

    function replaceFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(_functionSelectors.length != 0, GenericErrors.E41);
        DiamondStorage storage ds = diamondStorage();
        require(!LibUtil.isZeroAddress(_facetAddress), GenericErrors.E43);
        uint96 selectorPosition = uint96(
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.length
        );
        // add new facet address if it does not exist
        if (selectorPosition == 0) {
            addFacet(ds, _facetAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;

        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            require(oldFacetAddress != _facetAddress, GenericErrors.E42);
            removeFunction(ds, oldFacetAddress, selector);
            addFunction(ds, selector, selectorPosition, _facetAddress);
            unchecked {
                ++selectorPosition;
                ++selectorIndex;
            }
        }
    }

    function removeFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(_functionSelectors.length != 0, GenericErrors.E41);
        DiamondStorage storage ds = diamondStorage();
        // if function does not exist then do nothing and return
        require(!LibUtil.isZeroAddress(_facetAddress), GenericErrors.E43);
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;

        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldfacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            removeFunction(ds, oldfacetAddress, selector);
            unchecked {
                ++selectorIndex;
            }
        }
    }

    function addFacet(
        DiamondStorage storage ds,
        address _facetAddress
    ) internal {
        enforceHasContractCode(_facetAddress);
        ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds
            .facetAddresses
            .length;
        ds.facetAddresses.push(_facetAddress);
    }

    function addFunction(
        DiamondStorage storage ds,
        bytes4 _selector,
        uint96 _selectorPosition,
        address _facetAddress
    ) internal {
        ds
            .selectorToFacetAndPosition[_selector]
            .functionSelectorPosition = _selectorPosition;
        ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(
            _selector
        );
        ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;
    }

    function removeFunction(
        DiamondStorage storage ds,
        address _facetAddress,
        bytes4 _selector
    ) internal {
        require(!LibUtil.isZeroAddress(_facetAddress), GenericErrors.E46);
        // an immutable function is a function defined directly in a diamond
        require(_facetAddress != address(this), GenericErrors.E47);
        // replace selector with last selector, then delete last selector
        uint256 selectorPosition = ds
            .selectorToFacetAndPosition[_selector]
            .functionSelectorPosition;
        uint256 lastSelectorPosition = ds
            .facetFunctionSelectors[_facetAddress]
            .functionSelectors
            .length - 1;
        // if not the same then replace _selector with lastSelector
        if (selectorPosition != lastSelectorPosition) {
            bytes4 lastSelector = ds
                .facetFunctionSelectors[_facetAddress]
                .functionSelectors[lastSelectorPosition];
            ds.facetFunctionSelectors[_facetAddress].functionSelectors[
                selectorPosition
            ] = lastSelector;
            ds
                .selectorToFacetAndPosition[lastSelector]
                .functionSelectorPosition = uint96(selectorPosition);
        }
        // delete the last selector
        ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();
        delete ds.selectorToFacetAndPosition[_selector];

        // if no more selectors for facet address then delete the facet address
        if (lastSelectorPosition == 0) {
            // replace facet address with last facet address and delete last facet address
            uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
            uint256 facetAddressPosition = ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition;
            if (facetAddressPosition != lastFacetAddressPosition) {
                address lastFacetAddress = ds.facetAddresses[
                    lastFacetAddressPosition
                ];
                ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
                ds
                    .facetFunctionSelectors[lastFacetAddress]
                    .facetAddressPosition = facetAddressPosition;
            }
            ds.facetAddresses.pop();
            delete ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition;
        }
    }

    function initializeDiamondCut(
        address _init,
        bytes memory _calldata
    ) internal {
        if (LibUtil.isZeroAddress(_init)) {
            require(_calldata.length == 0, GenericErrors.E48);
        } else {
            require(_calldata.length != 0, GenericErrors.E49);
            if (_init != address(this)) {
                enforceHasContractCode(_init);
            }
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, bytes memory error) = _init.delegatecall(_calldata);
            if (!success) {
                if (error.length > 0) {
                    // bubble up the error
                    revert(string(error));
                } else {
                    revert InitReverted();
                }
            }
        }
    }

    function enforceHasContractCode(address _contract) internal view {
        uint256 contractSize;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            contractSize := extcodesize(_contract)
        }
        require(contractSize != 0, GenericErrors.E45);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "./LibBytes.sol";

library LibUtil {
    using LibBytes for bytes;

    function getRevertMsg(
        bytes memory _res
    ) internal pure returns (string memory) {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_res.length < 68) return "Transaction reverted silently";
        bytes memory revertData = _res.slice(4, _res.length - 4); // Remove the selector which is the first 4 bytes
        return abi.decode(revertData, (string)); // All that remains is the revert string
    }

    /// @notice Determines whether the given address is the zero address
    /// @param addr The address to verify
    /// @return Boolean indicating if the address is the zero address
    function isZeroAddress(address addr) internal pure returns (bool) {
        return addr == address(0);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 500,
    "details": {
      "yul": false
    }
  },
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

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

60806040526040516200239638038062002396833981016040819052620000269162000fb5565b6200003c826200015660201b620000bc1760201c565b604080516001808252818301909252600091816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081620000535750506040805160018082528183019092529192506000919060208083019080368337019050509050631f931c1c60e01b81600081518110620000c657620000c662000ff8565b6001600160e01b031990921660209283029190910182015260408051606081019091526001600160a01b038516815290810160008152602001828152508260008151811062000119576200011962000ff8565b60200260200101819052506200014c82600060405180602001604052806000815250620001da60201b620001511760201c565b50505050620012ed565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b0384811691821790935560405160008051602062002376833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b835181101562000428576000848281518110620001fe57620001fe62000ff8565b6020026020010151602001519050600060028111156200022257620002226200100e565b8160028111156200023757620002376200100e565b148062000258575060018160028111156200025657620002566200100e565b145b8062000278575060028160028111156200027657620002766200100e565b145b6040518060400160405280600381526020016204534360ec1b81525090620002be5760405162461bcd60e51b8152600401620002b591906200107f565b60405180910390fd5b506000816002811115620002d657620002d66200100e565b0362000334576200032e858381518110620002f557620002f562000ff8565b60200260200101516000015186848151811062000316576200031662000ff8565b6020026020010151604001516200047760201b60201c565b62000412565b60018160028111156200034b576200034b6200100e565b03620003a3576200032e8583815181106200036a576200036a62000ff8565b6020026020010151600001518684815181106200038b576200038b62000ff8565b602002602001015160400151620006ae60201b60201c565b6002816002811115620003ba57620003ba6200100e565b03620004125762000412858381518110620003d957620003d962000ff8565b602002602001015160000151868481518110620003fa57620003fa62000ff8565b602002602001015160400151620008da60201b60201c565b50806200041f81620010af565b915050620001dd565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb6738383836040516200045e9392919062001256565b60405180910390a1620004728282620009f5565b505050565b805160408051808201909152600381526245343160e81b602082015290620004b45760405162461bcd60e51b8152600401620002b591906200107f565b506000600080516020620023768339815191529050620004df8362000b5060201b620003921760201c565b156040518060400160405280600381526020016245343360e81b815250906200051d5760405162461bcd60e51b8152600401620002b591906200107f565b506001600160a01b0383166000908152600182016020526040812054906001600160601b0382169003620005575762000557828562000b5d565b60005b8351811015620006a75760008482815181106200057b576200057b62000ff8565b6020908102919091018101516001600160e01b03198116600090815286835260409020549092506001600160a01b031690620005c29082906200039262000b50821b17901c565b60405180604001604052806003815260200162114d0d60ea1b81525090620005ff5760405162461bcd60e51b8152600401620002b591906200107f565b506001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b0319161790555050600191820191016200055a565b5050505050565b805160408051808201909152600381526245343160e81b602082015290620006eb5760405162461bcd60e51b8152600401620002b591906200107f565b506000600080516020620023768339815191529050620007168362000b5060201b620003921760201c565b156040518060400160405280600381526020016245343360e81b81525090620007545760405162461bcd60e51b8152600401620002b591906200107f565b506001600160a01b0383166000908152600182016020526040812054906001600160601b03821690036200078e576200078e828562000b5d565b60005b8351811015620006a7576000848281518110620007b257620007b262000ff8565b6020908102919091018101516001600160e01b0319811660009081528683526040908190205481518083019092526003825262229a1960e91b938201939093529092506001600160a01b039182169188168203620008255760405162461bcd60e51b8152600401620002b591906200107f565b506200083385828462000bb0565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b03191617905550506001918201910162000791565b805160408051808201909152600381526245343160e81b602082015290620009175760405162461bcd60e51b8152600401620002b591906200107f565b506000600080516020620023768339815191529050620009428362000b5060201b620003921760201c565b156040518060400160405280600381526020016245343360e81b81525090620009805760405162461bcd60e51b8152600401620002b591906200107f565b5060005b8251811015620009ef576000838281518110620009a557620009a562000ff8565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b0316620009e484828462000bb0565b505060010162000984565b50505050565b62000a0b8262000b5060201b620003921760201c565b1562000a4f57805160408051808201909152600381526208a68760eb1b60208201529015620004725760405162461bcd60e51b8152600401620002b591906200107f565b805160408051808201909152600381526245343960e81b60208201529062000a8c5760405162461bcd60e51b8152600401620002b591906200107f565b506001600160a01b038216301462000aa95762000aa98262000f3d565b600080836001600160a01b03168360405162000ac69190620012b3565b600060405180830381855af49150503d806000811462000b03576040519150601f19603f3d011682016040523d82523d6000602084013e62000b08565b606091505b509150915081620009ef5780511562000b37578060405162461bcd60e51b8152600401620002b591906200107f565b60405163c53ebed560e01b815260040160405180910390fd5b6001600160a01b03161590565b62000b688162000f3d565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b62000bc68262000b5060201b620003921760201c565b1560405180604001604052806003815260200162229a1b60e91b8152509062000c045760405162461bcd60e51b8152600401620002b591906200107f565b5060408051808201909152600381526245343760e81b60208201526001600160a01b038316300362000c4b5760405162461bcd60e51b8152600401620002b591906200107f565b506001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046001600160601b0316929162000c9d91620012c1565b905080821462000d96576001600160a01b0384166000908152600186016020526040812080548390811062000cd65762000cd662000ff8565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b92508291908590811062000d2a5762000d2a62000ff8565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6001600160601b038516021790555b6001600160a01b0384166000908152600186016020526040902080548062000dc25762000dc2620012d7565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003620006a757600285015460009062000e2890600190620012c1565b6001600160a01b038616600090815260018089016020526040909120015490915080821462000ede57600087600201838154811062000e6b5762000e6b62000ff8565b6000918252602090912001546002890180546001600160a01b03909216925082918490811062000e9f5762000e9f62000ff8565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b8660020180548062000ef45762000ef4620012d7565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b60408051808201909152600381526245343560e81b6020820152813b9081620004725760405162461bcd60e51b8152600401620002b591906200107f565b60006001600160a01b0382165b92915050565b62000f998162000f7b565b811462000fa557600080fd5b50565b805162000f888162000f8e565b6000806040838503121562000fcd5762000fcd600080fd5b600062000fdb858562000fa8565b925050602062000fee8582860162000fa8565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b838110156200104157818101518382015260200162001027565b50506000910152565b600062001055825190565b8084526020840193506200106e81856020860162001024565b601f01601f19169290920192915050565b602080825281016200109281846200104a565b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006000198203620010c557620010c562001099565b5060010190565b620010d78162000f7b565b82525050565b6003811062000fa55762000fa56200100e565b80620010fc81620010dd565b919050565b600062000f8882620010f0565b620010d78162001101565b6001600160e01b03198116620010d7565b600062001138838362001119565b505060200190565b60006200114b825190565b80845260209384019383018060005b83811015620011835781516200117188826200112a565b9750602083019250506001016200115a565b509495945050505050565b80516000906060840190620011a48582620010cc565b506020830151620011b960208601826200110e565b5060408301518482036040860152620011d3828262001140565b95945050505050565b60006200109283836200118e565b6000620011f5825190565b80845260208401935083602082028501620012108560200190565b8060005b85811015620012495784840389528151620012308582620011dc565b94506020830160209a909a019992505060010162001214565b5091979650505050505050565b60608082528101620012698186620011ea565b90506200127a6020830185620010cc565b8181036040830152620011d381846200104a565b600062001299825190565b620012a981856020860162001024565b9290920192915050565b60006200109282846200128e565b8181038181111562000f885762000f8862001099565b634e487b7160e01b600052603160045260246000fd5b61107980620012fd6000396000f3fe60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60208181526040928390205483518085019094526003845262229a1b60e91b91840191909152909182916001600160a01b031690816100975760405162461bcd60e51b815260040161008e9190610df0565b60405180910390fd5b503660008037600080366000845af43d6000803e8080156100b7573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b038481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b835181101561034757600084828151811061017157610171610e08565b60200260200101516020015190506000600281111561019257610192610e1e565b8160028111156101a4576101a4610e1e565b14806101c1575060018160028111156101bf576101bf610e1e565b145b806101dd575060028160028111156101db576101db610e1e565b145b6040518060400160405280600381526020016204534360ec1b815250906102175760405162461bcd60e51b815260040161008e9190610df0565b50600081600281111561022c5761022c610e1e565b0361027a5761027585838151811061024657610246610e08565b60200260200101516000015186848151811061026457610264610e08565b60200260200101516040015161039f565b610334565b600181600281111561028e5761028e610e1e565b036102d7576102758583815181106102a8576102a8610e08565b6020026020010151600001518684815181106102c6576102c6610e08565b602002602001015160400151610529565b60028160028111156102eb576102eb610e1e565b036103345761033485838151811061030557610305610e08565b60200260200101516000015186848151811061032357610323610e08565b6020026020010151604001516106b9565b508061033f81610e4a565b915050610154565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161037b93929190610fe3565b60405180910390a161038d82826107c5565b505050565b6001600160a01b03161590565b805160408051808201909152600381526245343160e81b6020820152906103d95760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b03841661043d5760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610479576104798285610901565b60005b835181101561052257600084828151811061049957610499610e08565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b0316801560405180604001604052806003815260200162114d0d60ea1b815250906105075760405162461bcd60e51b815260040161008e9190610df0565b506105148583868a610952565b50506001918201910161047c565b5050505050565b805160408051808201909152600381526245343160e81b6020820152906105635760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b0384166105c75760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610603576106038285610901565b60005b835181101561052257600084828151811061062357610623610e08565b6020908102919091018101516001600160e01b0319811660009081528683526040908190205481518083019092526003825262229a1960e91b938201939093529092506001600160a01b0391821691881682036106935760405162461bcd60e51b815260040161008e9190610df0565b5061069f8582846109f7565b6106ab8583868a610952565b505060019182019101610606565b805160408051808201909152600381526245343160e81b6020820152906106f35760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b0384166107575760405162461bcd60e51b815260040161008e9190610df0565b5060005b82518110156107bf57600083828151811061077857610778610e08565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b03166107b58482846109f7565b505060010161075b565b50505050565b6001600160a01b03821661080e57805160408051808201909152600381526208a68760eb1b6020820152901561038d5760405162461bcd60e51b815260040161008e9190610df0565b805160408051808201909152600381526245343960e81b6020820152906108485760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b03821630146108625761086282610d5f565b600080836001600160a01b03168360405161087d9190611037565b600060405180830381855af49150503d80600081146108b8576040519150601f19603f3d011682016040523d82523d6000602084013e6108bd565b606091505b5091509150816107bf578051156108e8578060405162461bcd60e51b815260040161008e9190610df0565b60405163c53ebed560e01b815260040160405180910390fd5b61090a81610d5f565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b6001600160e01b0319831660008181526020868152604080832080546bffffffffffffffffffffffff909716600160a01b026001600160a01b0397881617815594909516808352600180890183529583208054968701815583528183206008870401805460e09890981c60046007909816979097026101000a96870263ffffffff9097021990971695909517909555529290915281546001600160a01b031916179055565b604080518082019091526003815262229a1b60e91b60208201526001600160a01b038316610a385760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343760e81b60208201526001600160a01b0383163003610a7c5760405162461bcd60e51b815260040161008e9190610df0565b506001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046bffffffffffffffffffffffff169291610ad191611043565b9050808214610bc8576001600160a01b03841660009081526001860160205260408120805483908110610b0657610b06610e08565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610b5757610b57610e08565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6bffffffffffffffffffffffff8516021790555b6001600160a01b03841660009081526001860160205260409020805480610bf157610bf1611056565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003610522576002850154600090610c5490600190611043565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610d03576000876002018381548110610c9357610c93610e08565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610cc457610cc4610e08565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610d1657610d16611056565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b60408051808201909152600381526245343560e81b6020820152813b908161038d5760405162461bcd60e51b815260040161008e9190610df0565b60005b83811015610db5578181015183820152602001610d9d565b50506000910152565b6000610dc8825190565b808452602084019350610ddf818560208601610d9a565b601f01601f19169290920192915050565b60208082528101610e018184610dbe565b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198203610e5d57610e5d610e34565b5060010190565b60006001600160a01b0382165b92915050565b610e8081610e64565b82525050565b60038110610e9657610e96610e1e565b50565b80610ea381610e86565b919050565b6000610e7182610e99565b610e8081610ea8565b6001600160e01b03198116610e80565b6000610ed88383610ebc565b505060200190565b6000610eea825190565b80845260209384019383018060005b83811015610f1e578151610f0d8882610ecc565b975060208301925050600101610ef9565b509495945050505050565b80516000906060840190610f3d8582610e77565b506020830151610f506020860182610eb3565b5060408301518482036040860152610f688282610ee0565b95945050505050565b6000610e018383610f29565b6000610f87825190565b80845260208401935083602082028501610fa18560200190565b8060005b85811015610fd65784840389528151610fbe8582610f71565b94506020830160209a909a0199925050600101610fa5565b5091979650505050505050565b60608082528101610ff48186610f7d565b90506110036020830185610e77565b8181036040830152610f688184610dbe565b600061101f825190565b61102d818560208601610d9a565b9290920192915050565b6000610e018284611015565b81810381811115610e7157610e71610e34565b634e487b7160e01b600052603160045260246000fdfea164736f6c6343000811000ac8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c0000000000000000000000002f92f98f1ca398cf37ab9c6e97861a648647e45a000000000000000000000000ef52aa76e28acb61a4ec24fbd3f753fb414ccd43

Deployed Bytecode

0x60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60208181526040928390205483518085019094526003845262229a1b60e91b91840191909152909182916001600160a01b031690816100975760405162461bcd60e51b815260040161008e9190610df0565b60405180910390fd5b503660008037600080366000845af43d6000803e8080156100b7573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b038481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b835181101561034757600084828151811061017157610171610e08565b60200260200101516020015190506000600281111561019257610192610e1e565b8160028111156101a4576101a4610e1e565b14806101c1575060018160028111156101bf576101bf610e1e565b145b806101dd575060028160028111156101db576101db610e1e565b145b6040518060400160405280600381526020016204534360ec1b815250906102175760405162461bcd60e51b815260040161008e9190610df0565b50600081600281111561022c5761022c610e1e565b0361027a5761027585838151811061024657610246610e08565b60200260200101516000015186848151811061026457610264610e08565b60200260200101516040015161039f565b610334565b600181600281111561028e5761028e610e1e565b036102d7576102758583815181106102a8576102a8610e08565b6020026020010151600001518684815181106102c6576102c6610e08565b602002602001015160400151610529565b60028160028111156102eb576102eb610e1e565b036103345761033485838151811061030557610305610e08565b60200260200101516000015186848151811061032357610323610e08565b6020026020010151604001516106b9565b508061033f81610e4a565b915050610154565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161037b93929190610fe3565b60405180910390a161038d82826107c5565b505050565b6001600160a01b03161590565b805160408051808201909152600381526245343160e81b6020820152906103d95760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b03841661043d5760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610479576104798285610901565b60005b835181101561052257600084828151811061049957610499610e08565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b0316801560405180604001604052806003815260200162114d0d60ea1b815250906105075760405162461bcd60e51b815260040161008e9190610df0565b506105148583868a610952565b50506001918201910161047c565b5050505050565b805160408051808201909152600381526245343160e81b6020820152906105635760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b0384166105c75760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610603576106038285610901565b60005b835181101561052257600084828151811061062357610623610e08565b6020908102919091018101516001600160e01b0319811660009081528683526040908190205481518083019092526003825262229a1960e91b938201939093529092506001600160a01b0391821691881682036106935760405162461bcd60e51b815260040161008e9190610df0565b5061069f8582846109f7565b6106ab8583868a610952565b505060019182019101610606565b805160408051808201909152600381526245343160e81b6020820152906106f35760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343360e81b60208201527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c906001600160a01b0384166107575760405162461bcd60e51b815260040161008e9190610df0565b5060005b82518110156107bf57600083828151811061077857610778610e08565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b03166107b58482846109f7565b505060010161075b565b50505050565b6001600160a01b03821661080e57805160408051808201909152600381526208a68760eb1b6020820152901561038d5760405162461bcd60e51b815260040161008e9190610df0565b805160408051808201909152600381526245343960e81b6020820152906108485760405162461bcd60e51b815260040161008e9190610df0565b506001600160a01b03821630146108625761086282610d5f565b600080836001600160a01b03168360405161087d9190611037565b600060405180830381855af49150503d80600081146108b8576040519150601f19603f3d011682016040523d82523d6000602084013e6108bd565b606091505b5091509150816107bf578051156108e8578060405162461bcd60e51b815260040161008e9190610df0565b60405163c53ebed560e01b815260040160405180910390fd5b61090a81610d5f565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b6001600160e01b0319831660008181526020868152604080832080546bffffffffffffffffffffffff909716600160a01b026001600160a01b0397881617815594909516808352600180890183529583208054968701815583528183206008870401805460e09890981c60046007909816979097026101000a96870263ffffffff9097021990971695909517909555529290915281546001600160a01b031916179055565b604080518082019091526003815262229a1b60e91b60208201526001600160a01b038316610a385760405162461bcd60e51b815260040161008e9190610df0565b5060408051808201909152600381526245343760e81b60208201526001600160a01b0383163003610a7c5760405162461bcd60e51b815260040161008e9190610df0565b506001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046bffffffffffffffffffffffff169291610ad191611043565b9050808214610bc8576001600160a01b03841660009081526001860160205260408120805483908110610b0657610b06610e08565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610b5757610b57610e08565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6bffffffffffffffffffffffff8516021790555b6001600160a01b03841660009081526001860160205260409020805480610bf157610bf1611056565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003610522576002850154600090610c5490600190611043565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610d03576000876002018381548110610c9357610c93610e08565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610cc457610cc4610e08565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610d1657610d16611056565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b60408051808201909152600381526245343560e81b6020820152813b908161038d5760405162461bcd60e51b815260040161008e9190610df0565b60005b83811015610db5578181015183820152602001610d9d565b50506000910152565b6000610dc8825190565b808452602084019350610ddf818560208601610d9a565b601f01601f19169290920192915050565b60208082528101610e018184610dbe565b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198203610e5d57610e5d610e34565b5060010190565b60006001600160a01b0382165b92915050565b610e8081610e64565b82525050565b60038110610e9657610e96610e1e565b50565b80610ea381610e86565b919050565b6000610e7182610e99565b610e8081610ea8565b6001600160e01b03198116610e80565b6000610ed88383610ebc565b505060200190565b6000610eea825190565b80845260209384019383018060005b83811015610f1e578151610f0d8882610ecc565b975060208301925050600101610ef9565b509495945050505050565b80516000906060840190610f3d8582610e77565b506020830151610f506020860182610eb3565b5060408301518482036040860152610f688282610ee0565b95945050505050565b6000610e018383610f29565b6000610f87825190565b80845260208401935083602082028501610fa18560200190565b8060005b85811015610fd65784840389528151610fbe8582610f71565b94506020830160209a909a0199925050600101610fa5565b5091979650505050505050565b60608082528101610ff48186610f7d565b90506110036020830185610e77565b8181036040830152610f688184610dbe565b600061101f825190565b61102d818560208601610d9a565b9290920192915050565b6000610e018284611015565b81810381811115610e7157610e71610e34565b634e487b7160e01b600052603160045260246000fdfea164736f6c6343000811000a

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

0000000000000000000000002f92f98f1ca398cf37ab9c6e97861a648647e45a000000000000000000000000ef52aa76e28acb61a4ec24fbd3f753fb414ccd43

-----Decoded View---------------
Arg [0] : _contractOwner (address): 0x2f92F98F1CA398Cf37ab9C6e97861a648647E45A
Arg [1] : _diamondCutFacet (address): 0xEF52AA76e28AcB61a4Ec24fbD3f753fB414cCD43

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002f92f98f1ca398cf37ab9c6e97861a648647e45a
Arg [1] : 000000000000000000000000ef52aa76e28acb61a4ec24fbd3f753fb414ccd43


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
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.