ETH Price: $1,970.89 (-5.68%)
 

More Info

Private Name Tags

Multichain Info

Transaction Hash
Method
Block
From
To
0xfc33e7199d68223f6cca75fe2a69b98f7e3045bc72092ffd46b1580a071bf054 Request L2Transa...(pending)2026-02-15 12:39:1610 hrs ago1771159156IN
zkSync Era: Diamond Proxy
0.0007275906 ETH(Pending)(Pending)
0x33bd203bff35a14cf02a2d4a5e08f584e8df65f00fa339b180e3f147942cef17 Request L2Transa...(pending)2026-02-15 3:38:5219 hrs ago1771126732IN
zkSync Era: Diamond Proxy
0.005847349 ETH(Pending)(Pending)
0x34d9822661bcdd1483dd2dc8a5d1a10ad42651a0aa6affb60623a2eb9cdcb946 Request L2Transa...(pending)2026-02-15 3:20:4019 hrs ago1771125640IN
zkSync Era: Diamond Proxy
0.010381454 ETH(Pending)(Pending)
Request L2Transa...244576102026-02-14 21:06:3525 hrs ago1771103195IN
zkSync Era: Diamond Proxy
124.994 ETH0.000479192.03116375
Finalize Eth Wit...244568282026-02-14 18:28:5928 hrs ago1771093739IN
zkSync Era: Diamond Proxy
0 ETH0.000420362.15527011
Request L2Transa...244504362026-02-13 21:06:352 days ago1771016795IN
zkSync Era: Diamond Proxy
115.044 ETH0.000472172.0683963
Finalize Eth Wit...244488582026-02-13 15:48:592 days ago1770997739IN
zkSync Era: Diamond Proxy
0 ETH0.000069020.35387325
Request L2Transa...244467362026-02-13 8:42:352 days ago1770972155IN
zkSync Era: Diamond Proxy
0.00210536 ETH0.00001190.05101866
Request L2Transa...244464002026-02-13 7:34:352 days ago1770968075IN
zkSync Era: Diamond Proxy
0.0155 ETH0.000015490.066425
Request L2Transa...244436792026-02-12 22:28:113 days ago1770935291IN
zkSync Era: Diamond Proxy
0.00218411 ETH0.000017110.0733433
Request L2Transa...244418392026-02-12 16:17:593 days ago1770913079IN
zkSync Era: Diamond Proxy
0.00218887 ETH0.00012980.55630802
Request L2Transa...244361092026-02-11 21:06:354 days ago1770843995IN
zkSync Era: Diamond Proxy
114.954 ETH0.000487162.08757889
Request L2Transa...244342342026-02-11 14:49:594 days ago1770821399IN
zkSync Era: Diamond Proxy
0.00161451 ETH0.000104490.44778148
Request L2Transa...244289452026-02-10 21:06:355 days ago1770757595IN
zkSync Era: Diamond Proxy
132.014 ETH0.000485992.08255944
Request L2Transa...244278952026-02-10 17:34:355 days ago1770744875IN
zkSync Era: Diamond Proxy
0.0031058 ETH0.000027880.11948904
Request L2Transa...244274442026-02-10 16:03:235 days ago1770739403IN
zkSync Era: Diamond Proxy
0.00150501 ETH0.000011430.21834282
Request L2Transa...244246662026-02-10 6:45:115 days ago1770705911IN
zkSync Era: Diamond Proxy
0.0006 ETH0.000015660.06712562
Request L2Transa...244217872026-02-09 21:06:356 days ago1770671195IN
zkSync Era: Diamond Proxy
158.814 ETH0.000510942.18948176
Request L2Transa...244146322026-02-08 21:06:357 days ago1770584795IN
zkSync Era: Diamond Proxy
154.904 ETH0.000479052.05280924
Request L2Transa...244075272026-02-07 21:06:478 days ago1770498407IN
zkSync Era: Diamond Proxy
150.944 ETH0.000484182.07479455
Request L2Transa...244003602026-02-06 21:06:359 days ago1770411995IN
zkSync Era: Diamond Proxy
144.974 ETH0.000524742.24861336
Request L2Transa...243926092026-02-05 19:06:3510 days ago1770318395IN
zkSync Era: Diamond Proxy
104.694 ETH0.00100214.29419037
Finalize Eth Wit...243913182026-02-05 14:47:2310 days ago1770302843IN
zkSync Era: Diamond Proxy
0 ETH0.000447091.87261154
Request L2Transa...243860542026-02-04 21:06:4711 days ago1770239207IN
zkSync Era: Diamond Proxy
143.584 ETH0.000535572.29503027
Request L2Transa...243789012026-02-03 21:06:3512 days ago1770152795IN
zkSync Era: Diamond Proxy
168.204 ETH0.000621822.66461264
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Bridgehub Deposi...244603802026-02-15 6:22:2316 hrs ago1771136543
zkSync Era: Diamond Proxy
0.00019716 ETH
Request L2Transa...244603802026-02-15 6:22:2316 hrs ago1771136543
zkSync Era: Diamond Proxy
0.00019716 ETH
Bridgehub Deposi...244576102026-02-14 21:06:3525 hrs ago1771103195
zkSync Era: Diamond Proxy
124.994 ETH
Bridgehub Deposi...244532362026-02-14 6:28:3540 hrs ago1771050515
zkSync Era: Diamond Proxy
0.00019717 ETH
Request L2Transa...244532362026-02-14 6:28:3540 hrs ago1771050515
zkSync Era: Diamond Proxy
0.00019717 ETH
Bridgehub Deposi...244505222026-02-13 21:23:472 days ago1771017827
zkSync Era: Diamond Proxy
0.00019737 ETH
Request L2Transa...244505222026-02-13 21:23:472 days ago1771017827
zkSync Era: Diamond Proxy
0.00019737 ETH
Bridgehub Deposi...244504362026-02-13 21:06:352 days ago1771016795
zkSync Era: Diamond Proxy
115.044 ETH
Bridgehub Deposi...244467362026-02-13 8:42:352 days ago1770972155
zkSync Era: Diamond Proxy
0.00210536 ETH
Bridgehub Deposi...244464002026-02-13 7:34:352 days ago1770968075
zkSync Era: Diamond Proxy
0.0155 ETH
Bridgehub Deposi...244436792026-02-12 22:28:113 days ago1770935291
zkSync Era: Diamond Proxy
0.00218411 ETH
Bridgehub Deposi...244418392026-02-12 16:17:593 days ago1770913079
zkSync Era: Diamond Proxy
0.00218887 ETH
Bridgehub Deposi...244388502026-02-12 6:17:233 days ago1770877043
zkSync Era: Diamond Proxy
0.00021611 ETH
Request L2Transa...244388502026-02-12 6:17:233 days ago1770877043
zkSync Era: Diamond Proxy
0.00021611 ETH
Bridgehub Deposi...244361092026-02-11 21:06:354 days ago1770843995
zkSync Era: Diamond Proxy
114.954 ETH
Bridgehub Deposi...244342342026-02-11 14:49:594 days ago1770821399
zkSync Era: Diamond Proxy
0.00161451 ETH
Bridgehub Deposi...244316952026-02-11 6:19:474 days ago1770790787
zkSync Era: Diamond Proxy
0.00021627 ETH
Request L2Transa...244316952026-02-11 6:19:474 days ago1770790787
zkSync Era: Diamond Proxy
0.00021627 ETH
Bridgehub Deposi...244289452026-02-10 21:06:355 days ago1770757595
zkSync Era: Diamond Proxy
132.014 ETH
Bridgehub Deposi...244278952026-02-10 17:34:355 days ago1770744875
zkSync Era: Diamond Proxy
0.0031058 ETH
Bridgehub Deposi...244246662026-02-10 6:45:115 days ago1770705911
zkSync Era: Diamond Proxy
0.0006 ETH
Bridgehub Deposi...244245422026-02-10 6:19:595 days ago1770704399
zkSync Era: Diamond Proxy
0.00021599 ETH
Request L2Transa...244245422026-02-10 6:19:595 days ago1770704399
zkSync Era: Diamond Proxy
0.00021599 ETH
Bridgehub Deposi...244217872026-02-09 21:06:356 days ago1770671195
zkSync Era: Diamond Proxy
158.814 ETH
Bridgehub Deposi...244174042026-02-09 6:25:116 days ago1770618311
zkSync Era: Diamond Proxy
0.00021597 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DiamondProxy

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : DiamondProxy.sol
pragma solidity ^0.8.0;

// SPDX-License-Identifier: MIT



import "./libraries/Diamond.sol";

/// @title Diamond Proxy Contract (EIP-2535)
/// @author Matter Labs
contract DiamondProxy {
    constructor(uint256 _chainId, Diamond.DiamondCutData memory _diamondCut) {
        // Check that the contract is deployed on the expected chain.
        // Thus, the contract deployed by the same Create2 factory on the different chain will have different addresses!
        require(_chainId == block.chainid, "pr");
        Diamond.diamondCut(_diamondCut);
    }

    /// @dev 1. Find the facet for the function that is called.
    /// @dev 2. Delegate the execution to the found facet via `delegatecall`.
    fallback() external payable {
        Diamond.DiamondStorage storage diamondStorage = Diamond.getDiamondStorage();
        // Check whether the data contains a "full" selector or it is empty.
        // Required because Diamond proxy finds a facet by function signature,
        // which is not defined for data length in range [1, 3].
        require(msg.data.length >= 4 || msg.data.length == 0, "Ut");
        // Get facet from function selector
        Diamond.SelectorToFacet memory facet = diamondStorage.selectorToFacet[msg.sig];
        address facetAddress = facet.facetAddress;

        require(facetAddress != address(0), "F"); // Proxy has no facet for this selector
        require(!diamondStorage.isFrozen || !facet.isFreezable, "q1"); // Facet is frozen

        assembly {
            // The pointer to the free memory slot
            let ptr := mload(0x40)
            // Copy function signature and arguments from calldata at zero position into memory at pointer position
            calldatacopy(ptr, 0, calldatasize())
            // Delegatecall method of the implementation contract returns 0 on error
            let result := delegatecall(gas(), facetAddress, ptr, calldatasize(), 0, 0)
            // Get the size of the last return data
            let size := returndatasize()
            // Copy the size length of bytes from return data at zero position to pointer position
            returndatacopy(ptr, 0, size)
            // Depending on the result value
            switch result
            case 0 {
                // End execution and revert state changes
                revert(ptr, size)
            }
            default {
                // Return data with length of size at pointers position
                return(ptr, size)
            }
        }
    }
}

File 2 of 4 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v2.5._
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v2.5._
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v2.5._
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v2.5._
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v2.5._
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     *
     * _Available since v3.0._
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.7._
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.7._
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

pragma solidity ^0.8.0;

// SPDX-License-Identifier: MIT



library UncheckedMath {
    function uncheckedInc(uint256 _number) internal pure returns (uint256) {
        unchecked {
            return _number + 1;
        }
    }

    function uncheckedAdd(uint256 _lhs, uint256 _rhs) internal pure returns (uint256) {
        unchecked {
            return _lhs + _rhs;
        }
    }
}

pragma solidity ^0.8.0;

// SPDX-License-Identifier: MIT



import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "../../common/libraries/UncheckedMath.sol";

/// @author Matter Labs
/// @notice The helper library for managing the EIP-2535 diamond proxy.
library Diamond {
    using UncheckedMath for uint256;
    using SafeCast for uint256;

    /// @dev Magic value that should be returned by diamond cut initialize contracts.
    /// @dev Used to distinguish calls to contracts that were supposed to be used as diamond initializer from other contracts.
    bytes32 constant DIAMOND_INIT_SUCCESS_RETURN_VALUE =
        0x33774e659306e47509050e97cb651e731180a42d458212294d30751925c551a2; // keccak256("diamond.zksync.init") - 1

    /// @dev Storage position of `DiamondStorage` structure.
    bytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b; // keccak256("diamond.standard.diamond.storage") - 1;

    event DiamondCut(FacetCut[] facetCuts, address initAddress, bytes initCalldata);

    /// @dev Utility struct that contains associated facet & meta information of selector
    /// @param facetAddress address of the facet which is connected with selector
    /// @param selectorPosition index in `FacetToSelectors.selectors` array, where is selector stored
    /// @param isFreezable denotes whether the selector can be frozen.
    struct SelectorToFacet {
        address facetAddress;
        uint16 selectorPosition;
        bool isFreezable;
    }

    /// @dev Utility struct that contains associated selectors & meta information of facet
    /// @param selectors list of all selectors that belong to the facet
    /// @param facetPosition index in `DiamondStorage.facets` array, where is facet stored
    struct FacetToSelectors {
        bytes4[] selectors;
        uint16 facetPosition;
    }

    /// @notice The structure that holds all diamond proxy associated parameters
    /// @dev According to the EIP-2535 should be stored on a special storage key - `DIAMOND_STORAGE_POSITION`
    /// @param selectorToFacet A mapping from the selector to the facet address and its meta information
    /// @param facetToSelectors A mapping from facet address to its selector with meta information
    /// @param facets The array of all unique facet addresses that belong to the diamond proxy
    /// @param isFrozen Denotes whether the diamond proxy is frozen and all freezable facets are not accessible
    struct DiamondStorage {
        mapping(bytes4 => SelectorToFacet) selectorToFacet;
        mapping(address => FacetToSelectors) facetToSelectors;
        address[] facets;
        bool isFrozen;
    }

    /// @dev Parameters for diamond changes that touch one of the facets
    /// @param facet The address of facet that's affected by the cut
    /// @param action The action that is made on the facet
    /// @param isFreezable Denotes whether the facet & all their selectors can be frozen
    /// @param selectors An array of unique selectors that belongs to the facet address
    struct FacetCut {
        address facet;
        Action action;
        bool isFreezable;
        bytes4[] selectors;
    }

    /// @dev Structure of the diamond proxy changes
    /// @param facetCuts The set of changes (adding/removing/replacement) of implementation contracts
    /// @param initAddress The address that's delegate called after setting up new facet changes
    /// @param initCalldata Calldata for the delegate call to `initAddress`
    struct DiamondCutData {
        FacetCut[] facetCuts;
        address initAddress;
        bytes initCalldata;
    }

    /// @dev Type of change over diamond: add/replace/remove facets
    enum Action {
        Add,
        Replace,
        Remove
    }

    /// @return diamondStorage The pointer to the storage where all specific diamond proxy parameters stored
    function getDiamondStorage() internal pure returns (DiamondStorage storage diamondStorage) {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            diamondStorage.slot := position
        }
    }

    /// @dev Add/replace/remove any number of selectors and optionally execute a function with delegatecall
    /// @param _diamondCut Diamond's facet changes and the parameters to optional initialization delegatecall
    function diamondCut(DiamondCutData memory _diamondCut) internal {
        FacetCut[] memory facetCuts = _diamondCut.facetCuts;
        address initAddress = _diamondCut.initAddress;
        bytes memory initCalldata = _diamondCut.initCalldata;
        uint256 facetCutsLength = facetCuts.length;
        for (uint256 i = 0; i < facetCutsLength; i = i.uncheckedInc()) {
            Action action = facetCuts[i].action;
            address facet = facetCuts[i].facet;
            bool isFacetFreezable = facetCuts[i].isFreezable;
            bytes4[] memory selectors = facetCuts[i].selectors;

            require(selectors.length > 0, "B"); // no functions for diamond cut

            if (action == Action.Add) {
                _addFunctions(facet, selectors, isFacetFreezable);
            } else if (action == Action.Replace) {
                _replaceFunctions(facet, selectors, isFacetFreezable);
            } else if (action == Action.Remove) {
                _removeFunctions(facet, selectors);
            } else {
                revert("C"); // undefined diamond cut action
            }
        }

        _initializeDiamondCut(initAddress, initCalldata);
        emit DiamondCut(facetCuts, initAddress, initCalldata);
    }

    /// @dev Add new functions to the diamond proxy
    /// NOTE: expect but NOT enforce that `_selectors` is NON-EMPTY array
    function _addFunctions(
        address _facet,
        bytes4[] memory _selectors,
        bool _isFacetFreezable
    ) private {
        DiamondStorage storage ds = getDiamondStorage();

        require(_facet != address(0), "G"); // facet with zero address cannot be added

        // Add facet to the list of facets if the facet address is new one
        _saveFacetIfNew(_facet);

        uint256 selectorsLength = _selectors.length;
        for (uint256 i = 0; i < selectorsLength; i = i.uncheckedInc()) {
            bytes4 selector = _selectors[i];
            SelectorToFacet memory oldFacet = ds.selectorToFacet[selector];
            require(oldFacet.facetAddress == address(0), "J"); // facet for this selector already exists

            _addOneFunction(_facet, selector, _isFacetFreezable);
        }
    }

    /// @dev Change associated facets to already known function selectors
    /// NOTE: expect but NOT enforce that `_selectors` is NON-EMPTY array
    function _replaceFunctions(
        address _facet,
        bytes4[] memory _selectors,
        bool _isFacetFreezable
    ) private {
        DiamondStorage storage ds = getDiamondStorage();

        require(_facet != address(0), "K"); // cannot replace facet with zero address

        uint256 selectorsLength = _selectors.length;
        for (uint256 i = 0; i < selectorsLength; i = i.uncheckedInc()) {
            bytes4 selector = _selectors[i];
            SelectorToFacet memory oldFacet = ds.selectorToFacet[selector];
            require(oldFacet.facetAddress != address(0), "L"); // it is impossible to replace the facet with zero address

            _removeOneFunction(oldFacet.facetAddress, selector);
            // Add facet to the list of facets if the facet address is a new one
            _saveFacetIfNew(_facet);
            _addOneFunction(_facet, selector, _isFacetFreezable);
        }
    }

    /// @dev Remove association with function and facet
    /// NOTE: expect but NOT enforce that `_selectors` is NON-EMPTY array
    function _removeFunctions(address _facet, bytes4[] memory _selectors) private {
        DiamondStorage storage ds = getDiamondStorage();

        require(_facet == address(0), "a1"); // facet address must be zero

        uint256 selectorsLength = _selectors.length;
        for (uint256 i = 0; i < selectorsLength; i = i.uncheckedInc()) {
            bytes4 selector = _selectors[i];
            SelectorToFacet memory oldFacet = ds.selectorToFacet[selector];
            require(oldFacet.facetAddress != address(0), "a2"); // Can't delete a non-existent facet

            _removeOneFunction(oldFacet.facetAddress, selector);
        }
    }

    /// @dev Add address to the list of known facets if it is not on the list yet
    /// NOTE: should be called ONLY before adding a new selector associated with the address
    function _saveFacetIfNew(address _facet) private {
        DiamondStorage storage ds = getDiamondStorage();

        uint256 selectorsLength = ds.facetToSelectors[_facet].selectors.length;
        // If there are no selectors associated with facet then save facet as new one
        if (selectorsLength == 0) {
            ds.facetToSelectors[_facet].facetPosition = ds.facets.length.toUint16();
            ds.facets.push(_facet);
        }
    }

    /// @dev Add one function to the already known facet
    /// NOTE: It is expected but NOT enforced that:
    /// - `_facet` is NON-ZERO address
    /// - `_facet` is already stored address in `DiamondStorage.facets`
    /// - `_selector` is NOT associated by another facet
    function _addOneFunction(
        address _facet,
        bytes4 _selector,
        bool _isSelectorFreezable
    ) private {
        DiamondStorage storage ds = getDiamondStorage();

        uint16 selectorPosition = (ds.facetToSelectors[_facet].selectors.length).toUint16();

        // if selectorPosition is nonzero, it means it is not a new facet
        // so the freezability of the first selector must be matched to _isSelectorFreezable
        // so all the selectors in a facet will have the same freezability
        if (selectorPosition != 0) {
            bytes4 selector0 = ds.facetToSelectors[_facet].selectors[0];
            require(_isSelectorFreezable == ds.selectorToFacet[selector0].isFreezable, "J1");
        }

        ds.selectorToFacet[_selector] = SelectorToFacet({
            facetAddress: _facet,
            selectorPosition: selectorPosition,
            isFreezable: _isSelectorFreezable
        });
        ds.facetToSelectors[_facet].selectors.push(_selector);
    }

    /// @dev Remove one associated function with facet
    /// NOTE: It is expected but NOT enforced that `_facet` is NON-ZERO address
    function _removeOneFunction(address _facet, bytes4 _selector) private {
        DiamondStorage storage ds = getDiamondStorage();

        // Get index of `FacetToSelectors.selectors` of the selector and last element of array
        uint256 selectorPosition = ds.selectorToFacet[_selector].selectorPosition;
        uint256 lastSelectorPosition = ds.facetToSelectors[_facet].selectors.length - 1;

        // If the selector is not at the end of the array then move the last element to the selector position
        if (selectorPosition != lastSelectorPosition) {
            bytes4 lastSelector = ds.facetToSelectors[_facet].selectors[lastSelectorPosition];

            ds.facetToSelectors[_facet].selectors[selectorPosition] = lastSelector;
            ds.selectorToFacet[lastSelector].selectorPosition = selectorPosition.toUint16();
        }

        // Remove last element from the selectors array
        ds.facetToSelectors[_facet].selectors.pop();

        // Finally, clean up the association with facet
        delete ds.selectorToFacet[_selector];

        // If there are no selectors for facet then remove the facet from the list of known facets
        if (lastSelectorPosition == 0) {
            _removeFacet(_facet);
        }
    }

    /// @dev remove facet from the list of known facets
    /// NOTE: It is expected but NOT enforced that there are no selectors associated with `_facet`
    function _removeFacet(address _facet) private {
        DiamondStorage storage ds = getDiamondStorage();

        // Get index of `DiamondStorage.facets` of the facet and last element of array
        uint256 facetPosition = ds.facetToSelectors[_facet].facetPosition;
        uint256 lastFacetPosition = ds.facets.length - 1;

        // If the facet is not at the end of the array then move the last element to the facet position
        if (facetPosition != lastFacetPosition) {
            address lastFacet = ds.facets[lastFacetPosition];

            ds.facets[facetPosition] = lastFacet;
            ds.facetToSelectors[lastFacet].facetPosition = facetPosition.toUint16();
        }

        // Remove last element from the facets array
        ds.facets.pop();
    }

    /// @dev Delegates call to the initialization address with provided calldata
    /// @dev Used as a final step of diamond cut to execute the logic of the initialization for changed facets
    function _initializeDiamondCut(address _init, bytes memory _calldata) private {
        if (_init == address(0)) {
            require(_calldata.length == 0, "H"); // Non-empty calldata for zero address
        } else {
            // Do not check whether `_init` is a contract since later we check that it returns data.
            (bool success, bytes memory data) = _init.delegatecall(_calldata);
            require(success, "I"); // delegatecall failed

            // Check that called contract returns magic value to make sure that contract logic
            // supposed to be used as diamond cut initializer.
            require(data.length == 32, "lp");
            require(abi.decode(data, (bytes32)) == DIAMOND_INIT_SUCCESS_RETURN_VALUE, "lp1");
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"components":[{"components":[{"internalType":"address","name":"facet","type":"address"},{"internalType":"enum Diamond.Action","name":"action","type":"uint8"},{"internalType":"bool","name":"isFreezable","type":"bool"},{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"internalType":"struct Diamond.FacetCut[]","name":"facetCuts","type":"tuple[]"},{"internalType":"address","name":"initAddress","type":"address"},{"internalType":"bytes","name":"initCalldata","type":"bytes"}],"internalType":"struct Diamond.DiamondCutData","name":"_diamondCut","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}]

60806040523480156200001157600080fd5b50604051620024f7380380620024f783398101604081905262000034916200107e565b4682146200006e5760405162461bcd60e51b8152602060048201526002602482015261383960f11b60448201526064015b60405180910390fd5b62000084816200008c60201b6200014b1760201c565b505062001410565b805160208201516040830151825160005b8181101562000243576000858281518110620000bd57620000bd6200122f565b60200260200101516020015190506000868381518110620000e257620000e26200122f565b602002602001015160000151905060008784815181106200010757620001076200122f565b602002602001015160400151905060008885815181106200012c576200012c6200122f565b60200260200101516060015190506000815111620001715760405162461bcd60e51b81526020600482015260016024820152602160f91b604482015260640162000065565b600084600281111562000188576200018862001245565b03620001a1576200019b83828462000294565b62000221565b6001846002811115620001b857620001b862001245565b03620001cb576200019b838284620003dd565b6002846002811115620001e257620001e262001245565b03620001f4576200019b83826200052b565b60405162461bcd60e51b81526020600482015260016024820152604360f81b604482015260640162000065565b505050506200023b816200066b60201b6200031f1760201c565b90506200009d565b5062000250838362000671565b7f87b829356b3403d36217eff1f66ee48eacd0a69015153aba4f0de29fe5340c30848484604051620002859392919062001289565b60405180910390a15050505050565b600080516020620024d78339815191526001600160a01b038416620002e05760405162461bcd60e51b81526020600482015260016024820152604760f81b604482015260640162000065565b620002eb84620007fd565b825160005b81811015620003d55760008582815181106200031057620003106200122f565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff161515918101919091529092509015620003a85760405162461bcd60e51b81526020600482015260016024820152602560f91b604482015260640162000065565b620003b5888388620008b8565b5050620003cd816200066b60201b6200031f1760201c565b9050620002f0565b505050505050565b600080516020620024d78339815191526001600160a01b038416620004295760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640162000065565b825160005b81811015620003d55760008582815181106200044e576200044e6200122f565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff1615159181019190915290925090620004e55760405162461bcd60e51b81526020600482015260016024820152601360fa1b604482015260640162000065565b8051620004f3908362000a8d565b620004fe88620007fd565b6200050b888388620008b8565b505062000523816200066b60201b6200031f1760201c565b90506200042e565b600080516020620024d78339815191526001600160a01b03831615620005795760405162461bcd60e51b8152602060048201526002602482015261613160f01b604482015260640162000065565b815160005b81811015620006645760008482815181106200059e576200059e6200122f565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff1615159181019190915290925090620006365760405162461bcd60e51b8152602060048201526002602482015261309960f11b604482015260640162000065565b805162000644908362000a8d565b50506200065c816200066b60201b6200031f1760201c565b90506200057e565b5050505050565b60010190565b6001600160a01b038216620006b957805115620006b55760405162461bcd60e51b81526020600482015260016024820152600960fb1b604482015260640162000065565b5050565b600080836001600160a01b031683604051620006d691906200139a565b600060405180830381855af49150503d806000811462000713576040519150601f19603f3d011682016040523d82523d6000602084013e62000718565b606091505b509150915081620007505760405162461bcd60e51b81526020600482015260016024820152604960f81b604482015260640162000065565b8051602014620007885760405162461bcd60e51b815260206004820152600260248201526106c760f41b604482015260640162000065565b7f33774e659306e47509050e97cb651e731180a42d458212294d30751925c551a260001b81806020019051810190620007c29190620013b8565b14620007f75760405162461bcd60e51b81526020600482015260036024820152626c703160e81b604482015260640162000065565b50505050565b6001600160a01b0381166000908152600080516020620024b78339815191526020526040812054600080516020620024d783398151915291819003620008b3576200085a826002018054905062000c9660201b620003251760201c565b6001600160a01b038416600081815260018581016020908152604083208201805461ffff191661ffff96909616959095179094556002860180549182018155825292902090910180546001600160a01b03191690911790555b505050565b6001600160a01b0383166000908152600080516020620024b783398151915260209081526040822054600080516020620024d7833981519152929162000908919062000c96811b6200032517901c565b905061ffff811615620009c3576001600160a01b03851660009081526001830160205260408120805482906200094257620009426200122f565b6000918252602080832060088304015460079092166004026101000a90910460e01b6001600160e01b03198116835290859052604090912054909150600160b01b900460ff16151584151514620009c15760405162461bcd60e51b81526020600482015260026024820152614a3160f01b604482015260640162000065565b505b604080516060810182526001600160a01b0396871680825261ffff93841660208084019182529615158385019081526001600160e01b03198916600090815287895285812094518554935192519b166001600160b01b031990931692909217600160a01b91909616029490941760ff60b01b1916600160b01b981515989098029790971790559481526001918201835293842080549182018155845292206008830401805463ffffffff60079094166004026101000a938402191660e09290921c92909202179055565b6001600160e01b031981166000908152600080516020620024d783398151915260208181526040808420546001600160a01b0387168552600080516020620024b78339815191529092528320549192600160a01b90910461ffff169162000af790600190620013d2565b905080821462000c04576001600160a01b0385166000908152600184016020526040812080548390811062000b305762000b306200122f565b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b92508291908590811062000b845762000b846200122f565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908360e01c021790555062000bca8362000c9660201b620003251760201c565b6001600160e01b03199091166000908152602085905260409020805461ffff92909216600160a01b0261ffff60a01b199092169190911790555b6001600160a01b0385166000908152600184016020526040902080548062000c305762000c30620013fa565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040812080546001600160b81b03191690558190036200066457620006648562000cff565b600061ffff82111562000cfb5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201526536206269747360d01b606482015260840162000065565b5090565b6001600160a01b0381166000908152600080516020620024b7833981519152602052604081206001908101547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54600080516020620024d78339815191529361ffff9092169262000d7091620013d2565b905080821462000e3f57600083600201828154811062000d945762000d946200122f565b6000918252602090912001546002850180546001600160a01b03909216925082918590811062000dc85762000dc86200122f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555062000e0c8362000c9660201b620003251760201c565b6001600160a01b039190911660009081526001858101602052604090912001805461ffff191661ffff9092169190911790555b8260020180548062000e555762000e55620013fa565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b038111828210171562000eb85762000eb862000e7d565b60405290565b604051608081016001600160401b038111828210171562000eb85762000eb862000e7d565b604051601f8201601f191681016001600160401b038111828210171562000f0e5762000f0e62000e7d565b604052919050565b60006001600160401b0382111562000f325762000f3262000e7d565b5060051b60200190565b80516001600160a01b038116811462000f5457600080fd5b919050565b600082601f83011262000f6b57600080fd5b8151602062000f8462000f7e8362000f16565b62000ee3565b82815260059290921b8401810191818101908684111562000fa457600080fd5b8286015b8481101562000fd95780516001600160e01b03198116811462000fcb5760008081fd5b835291830191830162000fa8565b509695505050505050565b60005b838110156200100157818101518382015260200162000fe7565b50506000910152565b600082601f8301126200101c57600080fd5b81516001600160401b0381111562001038576200103862000e7d565b6200104d601f8201601f191660200162000ee3565b8181528460208386010111156200106357600080fd5b6200107682602083016020870162000fe4565b949350505050565b600080604083850312156200109257600080fd5b825160208401519092506001600160401b0380821115620010b257600080fd5b9084019060608287031215620010c757600080fd5b620010d162000e93565b825182811115620010e157600080fd5b8301601f81018813620010f357600080fd5b80516200110462000f7e8262000f16565b8082825260208201915060208360051b85010192508a8311156200112757600080fd5b602084015b83811015620011e1578051878111156200114557600080fd5b85016080818e03601f190112156200115c57600080fd5b6200116662000ebe565b620011746020830162000f3c565b81526040820151600381106200118957600080fd5b602082015260608201518015158114620011a257600080fd5b6040820152608082015189811115620011ba57600080fd5b620011cb8f60208386010162000f59565b606083015250845250602092830192016200112c565b50845250620011f69150506020840162000f3c565b60208201526040830151828111156200120e57600080fd5b6200121c888286016200100a565b6040830152508093505050509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b600081518084526200127581602086016020860162000fe4565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b848110156200136857898403607f19018652815180516001600160a01b03168552838101518886019060038110620012fa57634e487b7160e01b600052602160045260246000fd5b868601526040828101511515908701529089015189860189905280519182905284019060009060a08701905b80831015620013525783516001600160e01b031916825292860192600192909201919086019062001326565b50978501979550505090820190600101620012b2565b50506001600160a01b038a169088015286810360408801526200138c81896200125b565b9a9950505050505050505050565b60008251620013ae81846020870162000fe4565b9190910192915050565b600060208284031215620013cb57600080fd5b5051919050565b81810381811115620013f457634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fd5b61109780620014206000396000f3fe6080604052600080516020611042833981519152600436101580610021575036155b6100575760405162461bcd60e51b8152602060048201526002602482015261155d60f21b60448201526064015b60405180910390fd5b600080356001600160e01b03191681526020828152604091829020825160608101845290546001600160a01b038116808352600160a01b820461ffff1693830193909352600160b01b900460ff16151592810192909252806100df5760405162461bcd60e51b81526020600482015260016024820152602360f91b604482015260640161004e565b600383015460ff1615806100f557508160400151155b6101265760405162461bcd60e51b8152602060048201526002602482015261713160f01b604482015260640161004e565b60405136600082376000803683855af43d806000843e818015610147578184f35b8184fd5b805160208201516040830151825160005b818110156102d257600085828151811061017857610178610e29565b6020026020010151602001519050600086838151811061019a5761019a610e29565b602002602001015160000151905060008784815181106101bc576101bc610e29565b602002602001015160400151905060008885815181106101de576101de610e29565b602002602001015160600151905060008151116102215760405162461bcd60e51b81526020600482015260016024820152602160f91b604482015260640161004e565b600084600281111561023557610235610e3f565b0361024a5761024583828461038c565b6102bd565b600184600281111561025e5761025e610e3f565b0361026e576102458382846104b2565b600284600281111561028257610282610e3f565b036102915761024583826105db565b60405162461bcd60e51b81526020600482015260016024820152604360f81b604482015260640161004e565b505050506102cb8160010190565b905061015c565b506102dd83836106fa565b7f87b829356b3403d36217eff1f66ee48eacd0a69015153aba4f0de29fe5340c3084848460405161031093929190610ea5565b60405180910390a15050505050565b60010190565b600061ffff8211156103885760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201526536206269747360d01b606482015260840161004e565b5090565b6000805160206110428339815191526001600160a01b0384166103d55760405162461bcd60e51b81526020600482015260016024820152604760f81b604482015260640161004e565b6103de84610877565b825160005b818110156104aa5760008582815181106103ff576103ff610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff1615159181019190915290925090156104955760405162461bcd60e51b81526020600482015260016024820152602560f91b604482015260640161004e565b6104a0888388610920565b50506001016103e3565b505050505050565b6000805160206110428339815191526001600160a01b0384166104fb5760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640161004e565b825160005b818110156104aa57600085828151811061051c5761051c610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff16151591810191909152909250906105b15760405162461bcd60e51b81526020600482015260016024820152601360fa1b604482015260640161004e565b80516105bd9083610adf565b6105c688610877565b6105d1888388610920565b5050600101610500565b6000805160206110428339815191526001600160a01b038316156106265760405162461bcd60e51b8152602060048201526002602482015261613160f01b604482015260640161004e565b815160005b818110156106f357600084828151811061064757610647610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff16151591810191909152909250906106dd5760405162461bcd60e51b8152602060048201526002602482015261309960f11b604482015260640161004e565b80516106e99083610adf565b505060010161062b565b5050505050565b6001600160a01b03821661073f5780511561073b5760405162461bcd60e51b81526020600482015260016024820152600960fb1b604482015260640161004e565b5050565b600080836001600160a01b03168360405161075a9190610faf565b600060405180830381855af49150503d8060008114610795576040519150601f19603f3d011682016040523d82523d6000602084013e61079a565b606091505b5091509150816107d05760405162461bcd60e51b81526020600482015260016024820152604960f81b604482015260640161004e565b80516020146108065760405162461bcd60e51b815260206004820152600260248201526106c760f41b604482015260640161004e565b7f33774e659306e47509050e97cb651e731180a42d458212294d30751925c551a260001b8180602001905181019061083e9190610fcb565b146108715760405162461bcd60e51b81526020600482015260036024820152626c703160e81b604482015260640161004e565b50505050565b6001600160a01b038116600090815260008051602061102283398151915260205260408120546000805160206110428339815191529181900361091b5760028201546108c290610325565b6001600160a01b038416600081815260018581016020908152604083208201805461ffff191661ffff96909616959095179094556002860180549182018155825292902090910180546001600160a01b03191690911790555b505050565b6001600160a01b03831660009081526000805160206110228339815191526020526040812054600080516020611042833981519152919061096090610325565b905061ffff811615610a15576001600160a01b038516600090815260018301602052604081208054829061099657610996610e29565b6000918252602080832060088304015460079092166004026101000a90910460e01b6001600160e01b03198116835290859052604090912054909150600160b01b900460ff16151584151514610a135760405162461bcd60e51b81526020600482015260026024820152614a3160f01b604482015260640161004e565b505b604080516060810182526001600160a01b0396871680825261ffff93841660208084019182529615158385019081526001600160e01b03198916600090815287895285812094518554935192519b166001600160b01b031990931692909217600160a01b91909616029490941760ff60b01b1916600160b01b981515989098029790971790559481526001918201835293842080549182018155845292206008830401805463ffffffff60079094166004026101000a938402191660e09290921c92909202179055565b6001600160e01b03198116600090815260008051602061104283398151915260208181526040808420546001600160a01b03871685526000805160206110228339815191529092528320549192600160a01b90910461ffff1691610b4590600190610fe4565b9050808214610c3e576001600160a01b03851660009081526001840160205260408120805483908110610b7a57610b7a610e29565b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b925082919085908110610bcb57610bcb610e29565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908360e01c0217905550610c0483610325565b6001600160e01b03199091166000908152602085905260409020805461ffff92909216600160a01b0261ffff60a01b199092169190911790555b6001600160a01b03851660009081526001840160205260409020805480610c6757610c6761100b565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040812080546001600160b81b03191690558190036106f3576001600160a01b0385166000908152600080516020611022833981519152602052604081206001908101547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d546106f39389936000805160206110428339815191529361ffff1692610d339190610fe4565b9050808214610dee576000836002018281548110610d5357610d53610e29565b6000918252602090912001546002850180546001600160a01b039092169250829185908110610d8457610d84610e29565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610dbb83610325565b6001600160a01b039190911660009081526001858101602052604090912001805461ffff191661ffff9092169190911790555b82600201805480610e0157610e0161100b565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015610e70578181015183820152602001610e58565b50506000910152565b60008151808452610e91816020860160208601610e55565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015610f7f57898403607f19018652815180516001600160a01b03168552838101518886019060038110610f1457634e487b7160e01b600052602160045260246000fd5b868601526040828101511515908701529089015189860189905280519182905284019060009060a08701905b80831015610f6a5783516001600160e01b0319168252928601926001929092019190860190610f40565b50978501979550505090820190600101610ece565b50506001600160a01b038a16908801528681036040880152610fa18189610e79565b9a9950505050505050505050565b60008251610fc1818460208701610e55565b9190910192915050565b600060208284031215610fdd57600080fd5b5051919050565b8181038181111561100557634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fdfec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131cc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ba2646970667358221220321b01261069b5a16f3e8ffab503a6323741f79d0634fcd86190942b13f5966764736f6c63430008110033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131cc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000b91d905a698c28b73c61af60c63919b754fcf4de0000000000000000000000000000000000000000000000000000000000000ba0000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000960000000000000000000000000c48d496459e1358d055a79173bea41efb7449028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000873fb92970000000000000000000000000000000000000000000000000000000036d4eb840000000000000000000000000000000000000000000000000000000027ae4c16000000000000000000000000000000000000000000000000000000000551448c000000000000000000000000000000000000000000000000000000008043760a00000000000000000000000000000000000000000000000000000000beda4b12000000000000000000000000000000000000000000000000000000001733894500000000000000000000000000000000000000000000000000000000587809c700000000000000000000000000000000000000000000000000000000000000000000000000000000c30af84a6aff43d5fd06feda6ba20bdfed539f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001fcdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed62700000000000000000000000000000000000000000000000000000000fe10226d0000000000000000000000000000000000000000000000000000000079823c9a000000000000000000000000000000000000000000000000000000004fc07d7500000000000000000000000000000000000000000000000000000000d86970d800000000000000000000000000000000000000000000000000000000fd791f3c000000000000000000000000000000000000000000000000000000008665b15000000000000000000000000000000000000000000000000000000000631f4bac000000000000000000000000000000000000000000000000000000001b60e62600000000000000000000000000000000000000000000000000000000e39d3bff000000000000000000000000000000000000000000000000000000000ef240a000000000000000000000000000000000000000000000000000000000fe26699e000000000000000000000000000000000000000000000000000000003960738200000000000000000000000000000000000000000000000000000000af6a2dcd00000000000000000000000000000000000000000000000000000000a1954fc500000000000000000000000000000000000000000000000000000000a39980a00000000000000000000000000000000000000000000000000000000046657fe90000000000000000000000000000000000000000000000000000000018e3a941000000000000000000000000000000000000000000000000000000002cc8412a000000000000000000000000000000000000000000000000000000003db920ce0000000000000000000000000000000000000000000000000000000029b98c6700000000000000000000000000000000000000000000000000000000bd7c541200000000000000000000000000000000000000000000000000000000c3bbd2d700000000000000000000000000000000000000000000000000000000e81e0ba100000000000000000000000000000000000000000000000000000000facd743b000000000000000000000000000000000000000000000000000000009cd939e40000000000000000000000000000000000000000000000000000000056142d7a0000000000000000000000000000000000000000000000000000000074f4d30d000000000000000000000000000000000000000000000000000000000000000000000000000000002ea0cfb9c942058ee5a84411ef2e37c6de5bfe5c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000076c0960f900000000000000000000000000000000000000000000000000000000b473318e00000000000000000000000000000000000000000000000000000000042901c700000000000000000000000000000000000000000000000000000000263b7f8e00000000000000000000000000000000000000000000000000000000e4948f4300000000000000000000000000000000000000000000000000000000eb67241900000000000000000000000000000000000000000000000000000000f36dc9150000000000000000000000000000000000000000000000000000000000000000000000000000000098e900eb2e5fde9786f736e86d6bfbfdb3e4683b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000040c4dd81000000000000000000000000000000000000000000000000000000000ce9dcf16000000000000000000000000000000000000000000000000000000007739cbe700000000000000000000000000000000000000000000000000000000a9a2d18a00000000000000000000000000000000000000000000000000000000000000000000000000000000a7e8a8f71c3cc43946601cc99997f8cd6828a9b90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000009e58bb6390000000000000000000000000000000000000000000000000000000086cb9909000000000000000000000000000000000000000000000000000000000707ac0900000000000000000000000000000000000000000000000000000000f235757f000000000000000000000000000000000000000000000000000000001cc5d10300000000000000000000000000000000000000000000000000000000be6f11cf000000000000000000000000000000000000000000000000000000004623c91d000000000000000000000000000000000000000000000000000000005437988d000000000000000000000000000000000000000000000000000000000b5088830000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c4e916f8530000000000000000000000006a28b1bc6123fe525ff46d881ff80871d0eb3f0200000000000000000000000029df43f75149d0552475a6f9b2ac96e28796ed0b000000000000000000000000112200eaa6d57120c86b8b51a8b6049d56b82211bc59c242d551e3939b9b2939b8b686efa77ba3833183045d548aa5f53357ba950000000000000000000000000000000000000000000000000000000000000015034fb8586032c0d6f07b4a8db319590095e390bd0dbf84976f8d009ad16cd18d000000000000000000000000185e050ec1c22c45445a9adea99b12e1a1372eba1186ec268d49f1905f8d9c1e9d39fc33e98c74f91d91a21b8f7ef78bd09a8db8101e08b00193e529145ee09823378ef51a3bc8966504064f1f6ba3f1ba8632100af0d77503b93a15fedd086638b7326cd3d169a2f388e568f41ea906c7a6eb9300000000000000000000000000000000000000000000000000000000000000000100038581be3d0e201b3cc45d151ef5cc59eb3a0f146ad44f0f72abf00b594c0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c00000000000000000000000000000000000000000000000000000000044aa20000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600080516020611042833981519152600436101580610021575036155b6100575760405162461bcd60e51b8152602060048201526002602482015261155d60f21b60448201526064015b60405180910390fd5b600080356001600160e01b03191681526020828152604091829020825160608101845290546001600160a01b038116808352600160a01b820461ffff1693830193909352600160b01b900460ff16151592810192909252806100df5760405162461bcd60e51b81526020600482015260016024820152602360f91b604482015260640161004e565b600383015460ff1615806100f557508160400151155b6101265760405162461bcd60e51b8152602060048201526002602482015261713160f01b604482015260640161004e565b60405136600082376000803683855af43d806000843e818015610147578184f35b8184fd5b805160208201516040830151825160005b818110156102d257600085828151811061017857610178610e29565b6020026020010151602001519050600086838151811061019a5761019a610e29565b602002602001015160000151905060008784815181106101bc576101bc610e29565b602002602001015160400151905060008885815181106101de576101de610e29565b602002602001015160600151905060008151116102215760405162461bcd60e51b81526020600482015260016024820152602160f91b604482015260640161004e565b600084600281111561023557610235610e3f565b0361024a5761024583828461038c565b6102bd565b600184600281111561025e5761025e610e3f565b0361026e576102458382846104b2565b600284600281111561028257610282610e3f565b036102915761024583826105db565b60405162461bcd60e51b81526020600482015260016024820152604360f81b604482015260640161004e565b505050506102cb8160010190565b905061015c565b506102dd83836106fa565b7f87b829356b3403d36217eff1f66ee48eacd0a69015153aba4f0de29fe5340c3084848460405161031093929190610ea5565b60405180910390a15050505050565b60010190565b600061ffff8211156103885760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201526536206269747360d01b606482015260840161004e565b5090565b6000805160206110428339815191526001600160a01b0384166103d55760405162461bcd60e51b81526020600482015260016024820152604760f81b604482015260640161004e565b6103de84610877565b825160005b818110156104aa5760008582815181106103ff576103ff610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff1615159181019190915290925090156104955760405162461bcd60e51b81526020600482015260016024820152602560f91b604482015260640161004e565b6104a0888388610920565b50506001016103e3565b505050505050565b6000805160206110428339815191526001600160a01b0384166104fb5760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640161004e565b825160005b818110156104aa57600085828151811061051c5761051c610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff16151591810191909152909250906105b15760405162461bcd60e51b81526020600482015260016024820152601360fa1b604482015260640161004e565b80516105bd9083610adf565b6105c688610877565b6105d1888388610920565b5050600101610500565b6000805160206110428339815191526001600160a01b038316156106265760405162461bcd60e51b8152602060048201526002602482015261613160f01b604482015260640161004e565b815160005b818110156106f357600084828151811061064757610647610e29565b6020908102919091018101516001600160e01b031981166000908152868352604090819020815160608101835290546001600160a01b038116808352600160a01b820461ffff1695830195909552600160b01b900460ff16151591810191909152909250906106dd5760405162461bcd60e51b8152602060048201526002602482015261309960f11b604482015260640161004e565b80516106e99083610adf565b505060010161062b565b5050505050565b6001600160a01b03821661073f5780511561073b5760405162461bcd60e51b81526020600482015260016024820152600960fb1b604482015260640161004e565b5050565b600080836001600160a01b03168360405161075a9190610faf565b600060405180830381855af49150503d8060008114610795576040519150601f19603f3d011682016040523d82523d6000602084013e61079a565b606091505b5091509150816107d05760405162461bcd60e51b81526020600482015260016024820152604960f81b604482015260640161004e565b80516020146108065760405162461bcd60e51b815260206004820152600260248201526106c760f41b604482015260640161004e565b7f33774e659306e47509050e97cb651e731180a42d458212294d30751925c551a260001b8180602001905181019061083e9190610fcb565b146108715760405162461bcd60e51b81526020600482015260036024820152626c703160e81b604482015260640161004e565b50505050565b6001600160a01b038116600090815260008051602061102283398151915260205260408120546000805160206110428339815191529181900361091b5760028201546108c290610325565b6001600160a01b038416600081815260018581016020908152604083208201805461ffff191661ffff96909616959095179094556002860180549182018155825292902090910180546001600160a01b03191690911790555b505050565b6001600160a01b03831660009081526000805160206110228339815191526020526040812054600080516020611042833981519152919061096090610325565b905061ffff811615610a15576001600160a01b038516600090815260018301602052604081208054829061099657610996610e29565b6000918252602080832060088304015460079092166004026101000a90910460e01b6001600160e01b03198116835290859052604090912054909150600160b01b900460ff16151584151514610a135760405162461bcd60e51b81526020600482015260026024820152614a3160f01b604482015260640161004e565b505b604080516060810182526001600160a01b0396871680825261ffff93841660208084019182529615158385019081526001600160e01b03198916600090815287895285812094518554935192519b166001600160b01b031990931692909217600160a01b91909616029490941760ff60b01b1916600160b01b981515989098029790971790559481526001918201835293842080549182018155845292206008830401805463ffffffff60079094166004026101000a938402191660e09290921c92909202179055565b6001600160e01b03198116600090815260008051602061104283398151915260208181526040808420546001600160a01b03871685526000805160206110228339815191529092528320549192600160a01b90910461ffff1691610b4590600190610fe4565b9050808214610c3e576001600160a01b03851660009081526001840160205260408120805483908110610b7a57610b7a610e29565b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b925082919085908110610bcb57610bcb610e29565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908360e01c0217905550610c0483610325565b6001600160e01b03199091166000908152602085905260409020805461ffff92909216600160a01b0261ffff60a01b199092169190911790555b6001600160a01b03851660009081526001840160205260409020805480610c6757610c6761100b565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040812080546001600160b81b03191690558190036106f3576001600160a01b0385166000908152600080516020611022833981519152602052604081206001908101547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d546106f39389936000805160206110428339815191529361ffff1692610d339190610fe4565b9050808214610dee576000836002018281548110610d5357610d53610e29565b6000918252602090912001546002850180546001600160a01b039092169250829185908110610d8457610d84610e29565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610dbb83610325565b6001600160a01b039190911660009081526001858101602052604090912001805461ffff191661ffff9092169190911790555b82600201805480610e0157610e0161100b565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015610e70578181015183820152602001610e58565b50506000910152565b60008151808452610e91816020860160208601610e55565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015610f7f57898403607f19018652815180516001600160a01b03168552838101518886019060038110610f1457634e487b7160e01b600052602160045260246000fd5b868601526040828101511515908701529089015189860189905280519182905284019060009060a08701905b80831015610f6a5783516001600160e01b0319168252928601926001929092019190860190610f40565b50978501979550505090820190600101610ece565b50506001600160a01b038a16908801528681036040880152610fa18189610e79565b9a9950505050505050505050565b60008251610fc1818460208701610e55565b9190910192915050565b600060208284031215610fdd57600080fd5b5051919050565b8181038181111561100557634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fdfec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131cc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ba2646970667358221220321b01261069b5a16f3e8ffab503a6323741f79d0634fcd86190942b13f5966764736f6c63430008110033

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

000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000b91d905a698c28b73c61af60c63919b754fcf4de0000000000000000000000000000000000000000000000000000000000000ba0000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000960000000000000000000000000c48d496459e1358d055a79173bea41efb7449028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000873fb92970000000000000000000000000000000000000000000000000000000036d4eb840000000000000000000000000000000000000000000000000000000027ae4c16000000000000000000000000000000000000000000000000000000000551448c000000000000000000000000000000000000000000000000000000008043760a00000000000000000000000000000000000000000000000000000000beda4b12000000000000000000000000000000000000000000000000000000001733894500000000000000000000000000000000000000000000000000000000587809c700000000000000000000000000000000000000000000000000000000000000000000000000000000c30af84a6aff43d5fd06feda6ba20bdfed539f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001fcdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed62700000000000000000000000000000000000000000000000000000000fe10226d0000000000000000000000000000000000000000000000000000000079823c9a000000000000000000000000000000000000000000000000000000004fc07d7500000000000000000000000000000000000000000000000000000000d86970d800000000000000000000000000000000000000000000000000000000fd791f3c000000000000000000000000000000000000000000000000000000008665b15000000000000000000000000000000000000000000000000000000000631f4bac000000000000000000000000000000000000000000000000000000001b60e62600000000000000000000000000000000000000000000000000000000e39d3bff000000000000000000000000000000000000000000000000000000000ef240a000000000000000000000000000000000000000000000000000000000fe26699e000000000000000000000000000000000000000000000000000000003960738200000000000000000000000000000000000000000000000000000000af6a2dcd00000000000000000000000000000000000000000000000000000000a1954fc500000000000000000000000000000000000000000000000000000000a39980a00000000000000000000000000000000000000000000000000000000046657fe90000000000000000000000000000000000000000000000000000000018e3a941000000000000000000000000000000000000000000000000000000002cc8412a000000000000000000000000000000000000000000000000000000003db920ce0000000000000000000000000000000000000000000000000000000029b98c6700000000000000000000000000000000000000000000000000000000bd7c541200000000000000000000000000000000000000000000000000000000c3bbd2d700000000000000000000000000000000000000000000000000000000e81e0ba100000000000000000000000000000000000000000000000000000000facd743b000000000000000000000000000000000000000000000000000000009cd939e40000000000000000000000000000000000000000000000000000000056142d7a0000000000000000000000000000000000000000000000000000000074f4d30d000000000000000000000000000000000000000000000000000000000000000000000000000000002ea0cfb9c942058ee5a84411ef2e37c6de5bfe5c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000076c0960f900000000000000000000000000000000000000000000000000000000b473318e00000000000000000000000000000000000000000000000000000000042901c700000000000000000000000000000000000000000000000000000000263b7f8e00000000000000000000000000000000000000000000000000000000e4948f4300000000000000000000000000000000000000000000000000000000eb67241900000000000000000000000000000000000000000000000000000000f36dc9150000000000000000000000000000000000000000000000000000000000000000000000000000000098e900eb2e5fde9786f736e86d6bfbfdb3e4683b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000040c4dd81000000000000000000000000000000000000000000000000000000000ce9dcf16000000000000000000000000000000000000000000000000000000007739cbe700000000000000000000000000000000000000000000000000000000a9a2d18a00000000000000000000000000000000000000000000000000000000000000000000000000000000a7e8a8f71c3cc43946601cc99997f8cd6828a9b90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000009e58bb6390000000000000000000000000000000000000000000000000000000086cb9909000000000000000000000000000000000000000000000000000000000707ac0900000000000000000000000000000000000000000000000000000000f235757f000000000000000000000000000000000000000000000000000000001cc5d10300000000000000000000000000000000000000000000000000000000be6f11cf000000000000000000000000000000000000000000000000000000004623c91d000000000000000000000000000000000000000000000000000000005437988d000000000000000000000000000000000000000000000000000000000b5088830000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c4e916f8530000000000000000000000006a28b1bc6123fe525ff46d881ff80871d0eb3f0200000000000000000000000029df43f75149d0552475a6f9b2ac96e28796ed0b000000000000000000000000112200eaa6d57120c86b8b51a8b6049d56b82211bc59c242d551e3939b9b2939b8b686efa77ba3833183045d548aa5f53357ba950000000000000000000000000000000000000000000000000000000000000015034fb8586032c0d6f07b4a8db319590095e390bd0dbf84976f8d009ad16cd18d000000000000000000000000185e050ec1c22c45445a9adea99b12e1a1372eba1186ec268d49f1905f8d9c1e9d39fc33e98c74f91d91a21b8f7ef78bd09a8db8101e08b00193e529145ee09823378ef51a3bc8966504064f1f6ba3f1ba8632100af0d77503b93a15fedd086638b7326cd3d169a2f388e568f41ea906c7a6eb9300000000000000000000000000000000000000000000000000000000000000000100038581be3d0e201b3cc45d151ef5cc59eb3a0f146ad44f0f72abf00b594c0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c00000000000000000000000000000000000000000000000000000000044aa20000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _chainId (uint256): 1
Arg [1] : _diamondCut (tuple):
Arg [1] : facetCuts (tuple[]):
Arg [1] : facet (address): 0xC48d496459e1358D055a79173BEA41efb7449028
Arg [2] : action (uint8): 0
Arg [3] : isFreezable (bool): False
Arg [4] : selectors (bytes4[]): 0x587809c
,
Arg [1] : facet (address): 0xc30af84A6aFF43D5fd06FEdA6bA20BdfeD539F6C
Arg [2] : action (uint8): 0
Arg [3] : isFreezable (bool): False
Arg [4] : selectors (bytes4[]): 0x74f4d30
,
Arg [1] : facet (address): 0x2EA0CFB9C942058ee5A84411EF2E37C6DE5bfe5c
Arg [2] : action (uint8): 0
Arg [3] : isFreezable (bool): True
Arg [4] : selectors (bytes4[]): 0xf36dc91
,
Arg [1] : facet (address): 0x98E900Eb2e5fdE9786f736e86d6BFBfDb3E4683b
Arg [2] : action (uint8): 0
Arg [3] : isFreezable (bool): True
Arg [4] : selectors (bytes4[]): 0xa9a2d18
,
Arg [1] : facet (address): 0xa7E8a8F71c3cC43946601CC99997f8Cd6828a9B9
Arg [2] : action (uint8): 0
Arg [3] : isFreezable (bool): True
Arg [4] : selectors (bytes4[]): 0x0b50888

Arg [2] : initAddress (address): 0xb91d905A698c28b73C61aF60C63919b754FCF4DE
Arg [3] : initCalldata (bytes): 0xe916f8530000000000000000000000006a28b1bc6123fe525ff46d881ff80871d0eb3f0200000000000000000000000029df43f75149d0552475a6f9b2ac96e28796ed0b000000000000000000000000112200eaa6d57120c86b8b51a8b6049d56b82211bc59c242d551e3939b9b2939b8b686efa77ba3833183045d548aa5f53357ba950000000000000000000000000000000000000000000000000000000000000015034fb8586032c0d6f07b4a8db319590095e390bd0dbf84976f8d009ad16cd18d000000000000000000000000185e050ec1c22c45445a9adea99b12e1a1372eba1186ec268d49f1905f8d9c1e9d39fc33e98c74f91d91a21b8f7ef78bd09a8db8101e08b00193e529145ee09823378ef51a3bc8966504064f1f6ba3f1ba8632100af0d77503b93a15fedd086638b7326cd3d169a2f388e568f41ea906c7a6eb9300000000000000000000000000000000000000000000000000000000000000000100038581be3d0e201b3cc45d151ef5cc59eb3a0f146ad44f0f72abf00b594c0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c00000000000000000000000000000000000000000000000000000000044aa200


-----Encoded View---------------
111 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 000000000000000000000000b91d905a698c28b73c61af60c63919b754fcf4de
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000ba0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [8] : 00000000000000000000000000000000000000000000000000000000000006c0
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000840
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000960
Arg [11] : 000000000000000000000000c48d496459e1358d055a79173bea41efb7449028
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [16] : 73fb929700000000000000000000000000000000000000000000000000000000
Arg [17] : 36d4eb8400000000000000000000000000000000000000000000000000000000
Arg [18] : 27ae4c1600000000000000000000000000000000000000000000000000000000
Arg [19] : 0551448c00000000000000000000000000000000000000000000000000000000
Arg [20] : 8043760a00000000000000000000000000000000000000000000000000000000
Arg [21] : beda4b1200000000000000000000000000000000000000000000000000000000
Arg [22] : 1733894500000000000000000000000000000000000000000000000000000000
Arg [23] : 587809c700000000000000000000000000000000000000000000000000000000
Arg [24] : 000000000000000000000000c30af84a6aff43d5fd06feda6ba20bdfed539f6c
Arg [25] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [26] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [27] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [28] : 000000000000000000000000000000000000000000000000000000000000001f
Arg [29] : cdffacc600000000000000000000000000000000000000000000000000000000
Arg [30] : 52ef6b2c00000000000000000000000000000000000000000000000000000000
Arg [31] : adfca15e00000000000000000000000000000000000000000000000000000000
Arg [32] : 7a0ed62700000000000000000000000000000000000000000000000000000000
Arg [33] : fe10226d00000000000000000000000000000000000000000000000000000000
Arg [34] : 79823c9a00000000000000000000000000000000000000000000000000000000
Arg [35] : 4fc07d7500000000000000000000000000000000000000000000000000000000
Arg [36] : d86970d800000000000000000000000000000000000000000000000000000000
Arg [37] : fd791f3c00000000000000000000000000000000000000000000000000000000
Arg [38] : 8665b15000000000000000000000000000000000000000000000000000000000
Arg [39] : 631f4bac00000000000000000000000000000000000000000000000000000000
Arg [40] : 1b60e62600000000000000000000000000000000000000000000000000000000
Arg [41] : e39d3bff00000000000000000000000000000000000000000000000000000000
Arg [42] : 0ef240a000000000000000000000000000000000000000000000000000000000
Arg [43] : fe26699e00000000000000000000000000000000000000000000000000000000
Arg [44] : 3960738200000000000000000000000000000000000000000000000000000000
Arg [45] : af6a2dcd00000000000000000000000000000000000000000000000000000000
Arg [46] : a1954fc500000000000000000000000000000000000000000000000000000000
Arg [47] : a39980a000000000000000000000000000000000000000000000000000000000
Arg [48] : 46657fe900000000000000000000000000000000000000000000000000000000
Arg [49] : 18e3a94100000000000000000000000000000000000000000000000000000000
Arg [50] : 2cc8412a00000000000000000000000000000000000000000000000000000000
Arg [51] : 3db920ce00000000000000000000000000000000000000000000000000000000
Arg [52] : 29b98c6700000000000000000000000000000000000000000000000000000000
Arg [53] : bd7c541200000000000000000000000000000000000000000000000000000000
Arg [54] : c3bbd2d700000000000000000000000000000000000000000000000000000000
Arg [55] : e81e0ba100000000000000000000000000000000000000000000000000000000
Arg [56] : facd743b00000000000000000000000000000000000000000000000000000000
Arg [57] : 9cd939e400000000000000000000000000000000000000000000000000000000
Arg [58] : 56142d7a00000000000000000000000000000000000000000000000000000000
Arg [59] : 74f4d30d00000000000000000000000000000000000000000000000000000000
Arg [60] : 0000000000000000000000002ea0cfb9c942058ee5a84411ef2e37c6de5bfe5c
Arg [61] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [62] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [63] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [64] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [65] : 6c0960f900000000000000000000000000000000000000000000000000000000
Arg [66] : b473318e00000000000000000000000000000000000000000000000000000000
Arg [67] : 042901c700000000000000000000000000000000000000000000000000000000
Arg [68] : 263b7f8e00000000000000000000000000000000000000000000000000000000
Arg [69] : e4948f4300000000000000000000000000000000000000000000000000000000
Arg [70] : eb67241900000000000000000000000000000000000000000000000000000000
Arg [71] : f36dc91500000000000000000000000000000000000000000000000000000000
Arg [72] : 00000000000000000000000098e900eb2e5fde9786f736e86d6bfbfdb3e4683b
Arg [73] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [74] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [75] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [76] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [77] : 0c4dd81000000000000000000000000000000000000000000000000000000000
Arg [78] : ce9dcf1600000000000000000000000000000000000000000000000000000000
Arg [79] : 7739cbe700000000000000000000000000000000000000000000000000000000
Arg [80] : a9a2d18a00000000000000000000000000000000000000000000000000000000
Arg [81] : 000000000000000000000000a7e8a8f71c3cc43946601cc99997f8cd6828a9b9
Arg [82] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [83] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [84] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [85] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [86] : e58bb63900000000000000000000000000000000000000000000000000000000
Arg [87] : 86cb990900000000000000000000000000000000000000000000000000000000
Arg [88] : 0707ac0900000000000000000000000000000000000000000000000000000000
Arg [89] : f235757f00000000000000000000000000000000000000000000000000000000
Arg [90] : 1cc5d10300000000000000000000000000000000000000000000000000000000
Arg [91] : be6f11cf00000000000000000000000000000000000000000000000000000000
Arg [92] : 4623c91d00000000000000000000000000000000000000000000000000000000
Arg [93] : 5437988d00000000000000000000000000000000000000000000000000000000
Arg [94] : 0b50888300000000000000000000000000000000000000000000000000000000
Arg [95] : 00000000000000000000000000000000000000000000000000000000000001c4
Arg [96] : e916f8530000000000000000000000006a28b1bc6123fe525ff46d881ff80871
Arg [97] : d0eb3f0200000000000000000000000029df43f75149d0552475a6f9b2ac96e2
Arg [98] : 8796ed0b000000000000000000000000112200eaa6d57120c86b8b51a8b6049d
Arg [99] : 56b82211bc59c242d551e3939b9b2939b8b686efa77ba3833183045d548aa5f5
Arg [100] : 3357ba9500000000000000000000000000000000000000000000000000000000
Arg [101] : 00000015034fb8586032c0d6f07b4a8db319590095e390bd0dbf84976f8d009a
Arg [102] : d16cd18d000000000000000000000000185e050ec1c22c45445a9adea99b12e1
Arg [103] : a1372eba1186ec268d49f1905f8d9c1e9d39fc33e98c74f91d91a21b8f7ef78b
Arg [104] : d09a8db8101e08b00193e529145ee09823378ef51a3bc8966504064f1f6ba3f1
Arg [105] : ba8632100af0d77503b93a15fedd086638b7326cd3d169a2f388e568f41ea906
Arg [106] : c7a6eb9300000000000000000000000000000000000000000000000000000000
Arg [107] : 000000000100038581be3d0e201b3cc45d151ef5cc59eb3a0f146ad44f0f72ab
Arg [108] : f00b594c0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550
Arg [109] : b703f41c00000000000000000000000000000000000000000000000000000000
Arg [110] : 044aa20000000000000000000000000000000000000000000000000000000000


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
0x32400084C286CF3E17e7B677ea9583e60a000324
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.

`; } let ensZeroWidthWarningHtml = ""; if ($("#hdnIsEnsContainZeroWidthChars").val() == "true") { ensZeroWidthWarningHtml = `
${zeroWidthWarningMessage} Check the actual text at ENS.
`; } const contentHtml = `
Additional Info
Full Name:
ENS Name


Note:
  • Name tag is displayed due to forward and reverse resolution. Find out more.
  • A Domain Name is not necessarily held by a person popularly associated with the name.
${ensUnicodeWarningHtml} ${ensZeroWidthWarningHtml}
`; $('#ensName').popover({ html: true, content: contentHtml, trigger: 'manual', placement: 'right' }); $('#ensName').click(function (event) { $("#ensName").popover('toggle'); event.stopPropagation(); }); $('#ensName').on('shown.bs.popover', async () => { //disable tooltip when hovering over ens name in the main page $("[rel='tooltipEns']").each(function () { $(this).tooltip('hide'); $(this).tooltip('disable'); }); //call ajax here to get result if (!otherENSNamesHtml) { const resolvedAddressesModel = await getEnsResolvedAddress($("#hdnAddress").val(), $("#hdnEnsText").val()); otherENSNamesHtml = generateEnsPopoverGrid(resolvedAddressesModel.d); if (!otherENSNamesHtml) { otherENSNamesHtml = "There are no other names resolving to this address." } } $(".popOverEnsOwnedAddressTable").html(otherENSNamesHtml); $("#divENSDisplayName").html(ensDisplayName); // append more copy button for ENS let domainName = $("#hdnEnsText").val(); const copyEnsButtonHtml = ` `; $("#spanCopyENSAddress").html(copyEnsButtonHtml); $("[data-bs-toggle='tooltip']").tooltip(); }); $('#ensName').on('hidden.bs.popover', () => { $("[rel='tooltipEns']").each(function () { $(this).tooltip('enable'); }); }); $('#ensName').on('hide.bs.popover', () => { $("[data-bs-toggle='tooltip']").tooltip('hide'); }); $(document).click(function (e) { //$("#ensName").popover('hide'); const popoverElement = document.getElementById('popover-ens-preview'); const popoverTrigger = document.getElementById('ensName'); if (!popoverTrigger.contains(e.target) && (!popoverElement || !popoverElement.contains(e.target))) { $("#ensName").popover('hide'); } }) } async function getEnsResolvedAddress(address, currentEnsText) { try { const requestModel = { "lookupAddress": address, "primaryDomainName": currentEnsText, "provider": "ENS" }; const response = await $.ajax({ url: "/name-lookup-search.aspx/GetOtherDomainNameForAddress", type: "POST", contentType: "application/json", dataType: "json", data: JSON.stringify({ requestModel: requestModel }) }) return response; } catch { return ""; } } function generateEnsPopoverGrid(model) { if (!model || model.DomainNames.length == 0) { return ""; } let listOtherENSNames = ""; model.DomainNames.forEach(x => listOtherENSNames += x.Name); let moreOtherENSNames = ""; if (model.Total > 5) { moreOtherENSNames = `More ` } const result = `
Other names resolving to this address:
${listOtherENSNames} ${moreOtherENSNames}
`; return result; } // ===== end ENS name tag const tooltipForTokenHolding = '56 Token Contracts'; var adjustPosition = 0; $(document).ready(function () { switchAmountToValue(document.getElementById("headerAmountValue"), 'Value (USD)', 'Amount', true); switchAmountToValue(document.getElementById("headerIntAmountValue"), 'Value (USD)', 'Amount', true); switchMethodColumn(document.getElementById("headerMethod"), 'Method', 'Action', true); switchMethodColumn(document.getElementById("headerMethod_internaltx"), 'Method', 'Action', true); onDocumentReady(); $("[rel='tooltip']").tooltip(); $("[data-bs-toggle-second='tooltip']").tooltip({ trigger: 'hover' }); $("[rel='tooltipEns']").each(function () { $(this).tooltip({ title: $(this).attr("tooltip-title") }); }); //if (hash != '') { // activaTab(hash); //}; onAddressDocReady(); //// Note: this is causing "Copied" tooltip not showing when copy button is clicked in V3, and seems like not applicable to v3, comment out first in case there is issue //$('[data-bs-toggle="tooltip"]').click(function () { // $('[data-bs-toggle="tooltip"]').tooltip("hide"); //}); if (document.getElementById("copyaddressbutton")) { document.getElementById("copyaddressbutton").classList.remove("disabled"); } if ($("#txtSearchContract").length) { initialiseKeyupOnDocReady(); } if (!!$('#ensName')[0]) { initEnsNamePopOver(); } handleToggle(); $("#btnLoginRequired").attr("href", "/login?ref=" + window.location.pathname.slice(1)); if (window.matchMedia("(max-width: 767px)").matches) { // Mobile adjustPosition = 90; } else { // Others adjustPosition = 50; } if (tooltipForTokenHolding) { const dropdownMenuBalance = document.getElementById("dropdownMenuBalance"); if (dropdownMenuBalance) { const dropdownWrapper = dropdownMenuBalance.closest(".dropdown"); if (dropdownWrapper) { dropdownWrapper.setAttribute("title", tooltipForTokenHolding); new bootstrap.Tooltip(dropdownWrapper); } } } setIOState(); setFiltersStatus(); }); function displayAudit() { $('html, body').animate({ scrollTop: $("#auditReportId").offset().top - adjustPosition }); } function handleToggle() { var className = document.getElementsByClassName('editor'); var classNameCount = className.length; for (var j = 0; j t.innerWidth()) { if (mb + d > tb) { t.css('padding-bottom', ((mb + d) - tb)); } } else { t.css('overflow', 'visible'); } }).on('hidden.bs.dropdown', function () { $(this).css({ 'padding-bottom': '', 'overflow': '' }); }); var btn_ERC20_sort = { count: 0, reminder_count: 2, list: [], default_list: [], ERC20_sort_start: function (count) { if (document.getElementsByClassName('list-custom-divider-ERC20')[0]) { var self = this if (count != undefined) { self.count = count } var before_el = document.getElementsByClassName('list-custom-divider-ERC20')[0] var parent_el = before_el.parentNode var element_selector = parent_el.querySelectorAll(".list-custom-ERC20"); if (self.list.length == 0) { element_selector.forEach(function (e) { self.list.push(e); self.default_list.push(e); }); } $(".list-custom-ERC20").remove() var type = self.count % self.reminder_count self.sortList(type, parent_el, before_el); self.count++ } }, sortList: function (type, parent_el, before_el) { var self = this var sorted_list = [] var icon_el = $(before_el).find('button').find('i') switch (type) { case 1: icon_el.attr("class", "fad fa-sort-up") sorted_list = self.sortUsdAsc() break; default: icon_el.attr("class", "fad fa-sort-down") sorted_list = self.sortUsdDesc() } for (var i = sorted_list.length - 1; i >= 0; i--) { before_el.insertAdjacentElement('afterend', sorted_list[i]) } }, sortUsdAsc: function () { var self = this var sort_list = self.list sort_list.sort(function (a, b) { var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1); var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1); if (target_a_value == -1 || target_b_value == -1) { return 1; } if (target_a_value target_b_value) { return 1; } return 0 }); return sort_list }, sortUsdDesc: function () { var self = this var sort_list = self.list sort_list.sort(function (a, b) { var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1); var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1); if (target_a_value target_b_value) { return -1; } return 0 }); return sort_list }, formatCurrencyToNumber: function (strCurrency) { if (typeof strCurrency == "number") return strCurrency else return Number(strCurrency.replace(/[^0-9.-]+/g, "")); }, } $("#btn_ERC20_sort").on("click", function (event) { event.preventDefault(); setTimeout(function () { btn_ERC20_sort.ERC20_sort_start() }, 10) }) function hrefTokenHolding() { var location = "/tokenholdings?a=0x32400084c286cf3e17e7b677ea9583e60a000324" var queryString = $("input.form-control.form-control-xs.search.mb-3")[0].value if (queryString) { location += "&q=" + queryString } window.location.href = location } function toggleLoginModal() { $('#loginRequiredModal').modal('toggle'); } function setIOState() { const mainAddress = $("#hdnAddress").val()?.toLowerCase(); const currentFilters = new URLSearchParams(window.location.search); const faddr = currentFilters.get("fadd")?.toLowerCase(); const taddr = currentFilters.get("tadd")?.toLowerCase(); $(".dropdown-item-io").removeClass("active"); if (taddr) { if (taddr.indexOf(mainAddress) != -1) { $("#btnInTxFilter").addClass("active"); $("#btnInIntlTxFilter").addClass("active"); $(".js-listbox-item").text("IN"); } else { $("#btnOutTxFilter").addClass("active"); $("#btnOutIntlTxFilter").addClass("active"); $(".js-listbox-item").text("OUT"); } } else if (faddr) { if (faddr.indexOf(mainAddress) != -1) { $("#btnOutTxFilter").addClass("active"); $("#btnOutIntlTxFilter").addClass("active"); $(".js-listbox-item").text("OUT"); } else { $("#btnInTxFilter").addClass("active"); $("#btnInIntlTxFilter").addClass("active"); $(".js-listbox-item").text("IN"); } } else { $("#btnAnyTxFilter").addClass("active"); $("#btnAnyIntlTxFilter").addClass("active"); $(".js-listbox-item").text("ANY"); } } function setFiltersStatus() { if (isSignedIn == "0") { disableControl("#dropdownMethod"); disableControl("#dropdownAge"); disableControl("#dropdownFrom"); disableControl("#dropdownIO"); disableControl("#dropdownTo"); disableControl("#btnDropdownAmount"); disableControl("#dropdownAgeIntlTxns"); disableControl("#dropdownFromIntlTxns"); disableControl("#dropdownIOIntlTxns"); disableControl("#dropdownToIntlTxns"); disableControl("#btnDropdownAmountIntlTxns"); $(".dropdown-filters").tooltip(); } } function disableControl(selector) { $(selector).prop("disabled", true); }