ETH Price: $2,083.52 (-1.74%)

Contract

0x3f2E4E5a70F2A424d7C4e4e0323c878C77c20537
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
__Bridge_init242925182026-01-22 19:48:5942 days ago1769111339IN
0x3f2E4E5a...C77c20537
0 ETH0.000014150.08815427

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
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:
Bridge

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

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

import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";

import "../interfaces/bridge/IBridge.sol";

import "../handlers/ERC20Handler.sol";
import "../handlers/ERC721Handler.sol";
import "../handlers/ERC1155Handler.sol";
import "../handlers/NativeHandler.sol";

import "../utils/Signers.sol";
import "../utils/Hashes.sol";

contract Bridge is
    IBridge,
    UUPSUpgradeable,
    Signers,
    Hashes,
    ERC20Handler,
    ERC721Handler,
    ERC1155Handler,
    NativeHandler
{
    function __Bridge_init(
        address[] calldata signers_,
        uint256 signaturesThreshold_
    ) external initializer {
        __Signers_init(signers_, signaturesThreshold_);
    }

    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}

    function withdrawERC20(
        address token_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external override {
        bytes32 signHash_ = getERC20SignHash(
            token_,
            amount_,
            receiver_,
            txHash_,
            txNonce_,
            block.chainid,
            isWrapped_
        );

        _checkAndUpdateHashes(txHash_, txNonce_);
        _checkSignatures(signHash_, signatures_);

        _withdrawERC20(token_, amount_, receiver_, isWrapped_);
    }

    function withdrawERC721(
        address token_,
        uint256 tokenId_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        string calldata tokenURI_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external override {
        bytes32 signHash_ = getERC721SignHash(
            token_,
            tokenId_,
            receiver_,
            txHash_,
            txNonce_,
            block.chainid,
            tokenURI_,
            isWrapped_
        );

        _checkAndUpdateHashes(txHash_, txNonce_);
        _checkSignatures(signHash_, signatures_);

        _withdrawERC721(token_, tokenId_, receiver_, tokenURI_, isWrapped_);
    }

    function withdrawERC1155(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        string calldata tokenURI_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external override {
        bytes32 signHash_ = getERC1155SignHash(
            token_,
            tokenId_,
            amount_,
            receiver_,
            txHash_,
            txNonce_,
            block.chainid,
            tokenURI_,
            isWrapped_
        );

        _checkAndUpdateHashes(txHash_, txNonce_);
        _checkSignatures(signHash_, signatures_);

        _withdrawERC1155(token_, tokenId_, amount_, receiver_, tokenURI_, isWrapped_);
    }

    function withdrawNative(
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        bytes[] calldata signatures_
    ) external override {
        bytes32 signHash_ = getNativeSignHash(
            amount_,
            receiver_,
            txHash_,
            txNonce_,
            block.chainid
        );

        _checkAndUpdateHashes(txHash_, txNonce_);
        _checkSignatures(signHash_, signatures_);

        _withdrawNative(amount_, receiver_);
    }

    function addHash(bytes32 txHash_, uint256 txNonce_) external onlyOwner {
        _checkAndUpdateHashes(txHash_, txNonce_);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = _setInitializedVersion(1);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        bool isTopLevelCall = _setInitializedVersion(version);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(version);
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        _setInitializedVersion(type(uint8).max);
    }

    function _setInitializedVersion(uint8 version) private returns (bool) {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
        // of initializers, because in other contexts the contract may have been reentered.
        if (_initializing) {
            require(
                version == 1 && !AddressUpgradeable.isContract(address(this)),
                "Initializable: contract is already initialized"
            );
            return false;
        } else {
            require(_initialized < version, "Initializable: contract is already initialized");
            _initialized = version;
            return true;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967Upgrade {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822.sol";
import "../ERC1967/ERC1967Upgrade.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate that the this implementation remains valid after an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 13 of 39 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 17 of 39 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";

import "../interfaces/handlers/IERC1155Handler.sol";
import "../interfaces/tokens/IERC1155MintableBurnable.sol";

abstract contract ERC1155Handler is IERC1155Handler, ERC1155Holder {
    function depositERC1155(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external override {
        require(token_ != address(0), "ERC1155Handler: zero token");
        require(amount_ > 0, "ERC1155Handler: amount is zero");

        IERC1155MintableBurnable erc1155_ = IERC1155MintableBurnable(token_);

        if (isWrapped_) {
            erc1155_.burnFrom(msg.sender, tokenId_, amount_);
        } else {
            erc1155_.safeTransferFrom(msg.sender, address(this), tokenId_, amount_, "");
        }

        emit DepositedERC1155(
            token_,
            tokenId_,
            amount_,
            receiver_,
            network_,
            isWrapped_,
            referralId_
        );
    }

    function _withdrawERC1155(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        address receiver_,
        string calldata tokenURI_,
        bool isWrapped_
    ) internal {
        require(token_ != address(0), "ERC1155Handler: zero token");
        require(receiver_ != address(0), "ERC1155Handler: zero receiver");
        require(amount_ > 0, "ERC1155Handler: amount is zero");

        IERC1155MintableBurnable erc1155_ = IERC1155MintableBurnable(token_);

        if (isWrapped_) {
            erc1155_.mintTo(receiver_, tokenId_, amount_, tokenURI_);
        } else {
            erc1155_.safeTransferFrom(address(this), receiver_, tokenId_, amount_, "");
        }
    }

    function getERC1155SignHash(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        string calldata tokenURI_,
        bool isWrapped_
    ) public pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    token_,
                    tokenId_,
                    amount_,
                    receiver_,
                    txHash_,
                    txNonce_,
                    chainId_,
                    tokenURI_,
                    isWrapped_
                )
            );
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../interfaces/tokens/IERC20MintableBurnable.sol";
import "../interfaces/handlers/IERC20Handler.sol";

abstract contract ERC20Handler is IERC20Handler {
    using SafeERC20 for IERC20MintableBurnable;

    function depositERC20(
        address token_,
        uint256 amount_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external override {
        require(token_ != address(0), "ERC20Handler: zero token");
        require(amount_ > 0, "ERC20Handler: amount is zero");

        IERC20MintableBurnable erc20_ = IERC20MintableBurnable(token_);

        if (isWrapped_) {
            erc20_.burnFrom(msg.sender, amount_);
        } else {
            erc20_.safeTransferFrom(msg.sender, address(this), amount_);
        }

        emit DepositedERC20(token_, amount_, receiver_, network_, isWrapped_, referralId_);
    }

    function _withdrawERC20(
        address token_,
        uint256 amount_,
        address receiver_,
        bool isWrapped_
    ) internal {
        require(token_ != address(0), "ERC20Handler: zero token");
        require(amount_ > 0, "ERC20Handler: amount is zero");
        require(receiver_ != address(0), "ERC20Handler: zero receiver");

        IERC20MintableBurnable erc20_ = IERC20MintableBurnable(token_);

        if (isWrapped_) {
            erc20_.mintTo(receiver_, amount_);
        } else {
            erc20_.safeTransfer(receiver_, amount_);
        }
    }

    function getERC20SignHash(
        address token_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        bool isWrapped_
    ) public pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    token_,
                    amount_,
                    receiver_,
                    txHash_,
                    txNonce_,
                    chainId_,
                    isWrapped_
                )
            );
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";

import "../interfaces/handlers/IERC721Handler.sol";
import "../interfaces/tokens/IERC721MintableBurnable.sol";

abstract contract ERC721Handler is IERC721Handler, ERC721Holder {
    function depositERC721(
        address token_,
        uint256 tokenId_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external override {
        require(token_ != address(0), "ERC721Handler: zero token");

        IERC721MintableBurnable erc721_ = IERC721MintableBurnable(token_);

        if (isWrapped_) {
            erc721_.burnFrom(msg.sender, tokenId_);
        } else {
            erc721_.safeTransferFrom(msg.sender, address(this), tokenId_);
        }

        emit DepositedERC721(token_, tokenId_, receiver_, network_, isWrapped_, referralId_);
    }

    function _withdrawERC721(
        address token_,
        uint256 tokenId_,
        address receiver_,
        string calldata tokenURI_,
        bool isWrapped_
    ) internal {
        require(token_ != address(0), "ERC721Handler: zero token");
        require(receiver_ != address(0), "ERC721Handler: zero receiver");

        IERC721MintableBurnable erc721_ = IERC721MintableBurnable(token_);

        if (isWrapped_) {
            erc721_.mintTo(receiver_, tokenId_, tokenURI_);
        } else {
            erc721_.safeTransferFrom(address(this), receiver_, tokenId_);
        }
    }

    function getERC721SignHash(
        address token_,
        uint256 tokenId_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        string calldata tokenURI_,
        bool isWrapped_
    ) public pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    token_,
                    tokenId_,
                    receiver_,
                    txHash_,
                    txNonce_,
                    chainId_,
                    tokenURI_,
                    isWrapped_
                )
            );
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "../interfaces/handlers/INativeHandler.sol";

abstract contract NativeHandler is INativeHandler {
    function depositNative(
        string calldata receiver_,
        string calldata network_,
        uint16 referralId_
    ) external payable override {
        require(msg.value > 0, "NativeHandler: zero value");

        emit DepositedNative(msg.value, receiver_, network_, referralId_);
    }

    receive() external payable {}

    function _withdrawNative(uint256 amount_, address receiver_) internal {
        require(amount_ > 0, "NativeHandler: amount is zero");
        require(receiver_ != address(0), "NativeHandler: receiver is zero");

        (bool sent_, ) = payable(receiver_).call{value: amount_}("");

        require(sent_, "NativeHandler: can't send eth");
    }

    function getNativeSignHash(
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_
    ) public pure returns (bytes32) {
        return keccak256(abi.encodePacked(amount_, receiver_, txHash_, txNonce_, chainId_));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "../handlers/IERC20Handler.sol";
import "../handlers/IERC721Handler.sol";
import "../handlers/IERC1155Handler.sol";
import "../handlers/INativeHandler.sol";

/**
 * @notice The Bridge contract
 *
 * The Bridge contract acts as a permissioned way of transfering assets (ERC20, ERC721, ERC1155, Native) between
 * 2 different blockchains.
 *
 * In order to correctly use the Bridge, one has to deploy both instances of the contract on the base chain and the
 * destination chain, as well as setup a trusted backend that will act as a `signer`.
 *
 * Each Bridge contract can either give or take the user assets when they want to transfer tokens. Both liquidity pool
 * and mint-and-burn way of transferring assets are supported.
 *
 * IMPORTANT
 *
 * All of the signers' addresses must differ in they first (the most significant) 8 bits in order to pass a bloom filtering.
 */
interface IBridge is IERC20Handler, IERC721Handler, IERC1155Handler, INativeHandler {
    /**
     * @notice function for withdrawing erc20 tokens
     * @param token_ the address of withdrawn token
     * @param amount_ the amount of withdrawn tokens
     * @param receiver_ the address of withdraw receiver
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @param signatures_ the array of signatures. Formed by signing a sign hash by each signer.
     */
    function withdrawERC20(
        address token_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external;

    /**
     * @notice function for withdrawing erc721 tokens
     * @param token_ the address of withdrawn token
     * @param tokenId_ the id of withdrawn token
     * @param receiver_ the address of withdraw receiver
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param tokenURI_ the string URI to token metadata
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @param signatures_ the array of signatures. Formed by signing a sign hash by each signer.
     */
    function withdrawERC721(
        address token_,
        uint256 tokenId_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        string calldata tokenURI_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external;

    /**
     * @notice function for withdrawing erc1155 tokens
     * @param token_ the address of withdrawn token
     * @param tokenId_ the id of withdrawn token
     * @param amount_ the amount of withdrawn tokens
     * @param receiver_ the address of withdraw receiver
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param tokenURI_ the string URI to token metadata
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @param signatures_ the array of signatures. Formed by signing a sign hash by each signer.
     */
    function withdrawERC1155(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        string calldata tokenURI_,
        bool isWrapped_,
        bytes[] calldata signatures_
    ) external;

    /**
     * @notice function for withdrawing native currency
     * @param amount_ the amount of withdrawn native currency
     * @param receiver_ the address of withdraw receiver
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param signatures_ the array of signatures. Formed by signing a sign hash by each signer.
     */
    function withdrawNative(
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        bytes[] calldata signatures_
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IERC1155Handler {
    /**
     * @notice event emits from depositERC1155 function
     */
    event DepositedERC1155(
        address token,
        uint256 tokenId,
        uint256 amount,
        string receiver,
        string network,
        bool isWrapped,
        uint16 referralId
    );

    /**
     * @notice function for depositing erc1155 tokens, emits event DepositedERC115
     * @param token_ the address of deposited tokens
     * @param tokenId_ the id of deposited tokens
     * @param amount_ the amount of deposited tokens
     * @param receiver_ the receiver address in destination network, information field for event
     * @param network_ the network name of destination network, information field for event
     * @param isWrapped_ the boolean flag, if true - tokens will burned, false - tokens will transferred
     * @param referralId_ the referral id, information field for event
     */
    function depositERC1155(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external;

    /**
     * @notice function for getting sign hash
     * @param token_ the address of withdrawn token
     * @param tokenId_ the id of deposited token
     * @param amount_ the amount of withdrawn tokens
     * @param receiver_ the receiver address in destination network
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param chainId_ the id of chain
     * @param tokenURI_ the string URI to token metadata
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @return bytes32 keccak256(abi.encodePacked(token_,tokenId_,amount_,receiver_,txHash_,txNonce_,chainId_,isWrapped_));
     */
    function getERC1155SignHash(
        address token_,
        uint256 tokenId_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        string calldata tokenURI_,
        bool isWrapped_
    ) external pure returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IERC20Handler {
    /**
     * @notice event emits from depositERC20 function
     */
    event DepositedERC20(
        address token,
        uint256 amount,
        string receiver,
        string network,
        bool isWrapped,
        uint16 referralId
    );

    /**
     * @notice function for depositing erc20 tokens, emits event DepositedERC20
     * @param token_ the address of deposited token
     * @param amount_ the amount of deposited tokens
     * @param receiver_ the receiver address in destination network, information field for event
     * @param network_ the network name of destination network, information field for event
     * @param isWrapped_ the boolean flag, if true - tokens will burned, false - tokens will transferred
     * @param referralId_ the referral id, information field for event
     */
    function depositERC20(
        address token_,
        uint256 amount_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external;

    /**
     * @notice function for getting sign hash
     * @param token_ the address of withdrawn token
     * @param amount_ the amount of withdrawn tokens
     * @param receiver_ the receiver address in destination network
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param chainId_ the id of chain
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @return bytes32 keccak256(abi.encodePacked(token_,amount_,receiver_,txHash_,txNonce_,chainId_,isWrapped_));
     */
    function getERC20SignHash(
        address token_,
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        bool isWrapped_
    ) external pure returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IERC721Handler {
    /**
     * @notice event emits from depositERC721 function
     */
    event DepositedERC721(
        address token,
        uint256 tokenId,
        string receiver,
        string network,
        bool isWrapped,
        uint16 referralId
    );

    /**
     * @notice function for depositing erc721 tokens, emits event DepositedERC721
     * @param token_ the address of deposited token
     * @param tokenId_ the id of deposited token
     * @param receiver_ the receiver address in destination network, information field for event
     * @param network_ the network name of destination network, information field for event
     * @param isWrapped_ the boolean flag, if true - token will burned, false - token will transferred
     * @param referralId_ the referral id, information field for event
     */
    function depositERC721(
        address token_,
        uint256 tokenId_,
        string calldata receiver_,
        string calldata network_,
        bool isWrapped_,
        uint16 referralId_
    ) external;

    /**
     * @notice function for getting sign hash
     * @param token_ the address of withdrawn token
     * @param tokenId_ the id of deposited token
     * @param receiver_ the receiver address in destination network
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param chainId_ the id of chain
     * @param tokenURI_ the string URI to token metadata
     * @param isWrapped_ the boolean flag, if true - tokens will minted, false - tokens will transferred
     * @return bytes32 keccak256(abi.encodePacked(token_,tokenId_,receiver_,txHash_,txNonce_,chainId_,isWrapped_));
     */
    function getERC721SignHash(
        address token_,
        uint256 tokenId_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_,
        string calldata tokenURI_,
        bool isWrapped_
    ) external pure returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface INativeHandler {
    /**
     * @notice event emits from depositNative function
     */
    event DepositedNative(uint256 amount, string receiver, string network, uint16 referralId);

    /**
     * @notice function for depositing native currency, emits event DepositedNative
     * @param receiver_ the receiver address in destination network, information field for event
     * @param network_ the network name of destination network, information field for event
     * @param referralId_ the referral id, information field for event
     */
    function depositNative(
        string calldata receiver_,
        string calldata network_,
        uint16 referralId_
    ) external payable;

    /**
     * @notice function for getting sign hash
     * @param amount_ the amount of withdrawn native currency
     * @param receiver_ the receiver address in destination network
     * @param txHash_ the hash of deposit transaction
     * @param txNonce_ the nonce of deposit transaction
     * @param chainId_ the id of chain
     * @return bytes32 keccak256(abi.encodePacked(amount_,receiver_,txHash_,txNonce_,chainId_));
     */
    function getNativeSignHash(
        uint256 amount_,
        address receiver_,
        bytes32 txHash_,
        uint256 txNonce_,
        uint256 chainId_
    ) external pure returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

interface IERC1155MintableBurnable is IERC1155 {
    function mintTo(
        address receiver_,
        uint256 tokenId_,
        uint256 amount_,
        string calldata tokenURI_
    ) external;

    function burnFrom(address payer_, uint256 tokenId_, uint256 amount_) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IERC20MintableBurnable is IERC20 {
    function mintTo(address receiver_, uint256 amount_) external;

    function burnFrom(address payer_, uint256 amount_) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IERC721MintableBurnable is IERC721 {
    function mintTo(address receiver_, uint256 tokenId_, string calldata tokenURI_) external;

    function burnFrom(address payer_, uint256 tokenId_) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

abstract contract Hashes {
    mapping(bytes32 => bool) public usedHashes; // keccak256(txHash . txNonce) => is used

    function _checkAndUpdateHashes(bytes32 txHash_, uint256 txNonce_) internal {
        bytes32 nonceHash_ = keccak256(abi.encodePacked(txHash_, txNonce_));

        require(!usedHashes[nonceHash_], "Hashes: the hash nonce is used");

        usedHashes[nonceHash_] = true;
    }

    function containsHash(bytes32 txHash_, uint256 txNonce_) external view returns (bool) {
        bytes32 nonceHash_ = keccak256(abi.encodePacked(txHash_, txNonce_));
        return usedHashes[nonceHash_];
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract Signers is OwnableUpgradeable {
    using ECDSA for bytes32;
    using EnumerableSet for EnumerableSet.AddressSet;

    uint256 public signaturesThreshold;

    EnumerableSet.AddressSet internal _signers;

    function __Signers_init(
        address[] calldata signers_,
        uint256 signaturesThreshold_
    ) public onlyInitializing {
        __Ownable_init();

        addSigners(signers_);
        setSignaturesThreshold(signaturesThreshold_);
    }

    function _checkCorrectSigners(address[] memory signers_) private view {
        uint256 bitMap;

        for (uint256 i = 0; i < signers_.length; i++) {
            require(_signers.contains(signers_[i]), "Signers: invalid signer");

            uint256 bitKey = 2 ** (uint256(uint160(signers_[i])) >> 152);

            require(bitMap & bitKey == 0, "Signers: duplicate signers");

            bitMap |= bitKey;
        }

        require(signers_.length >= signaturesThreshold, "Signers: threshold is not met");
    }

    function _checkSignatures(bytes32 signHash_, bytes[] calldata signatures_) internal view {
        address[] memory signers_ = new address[](signatures_.length);

        for (uint256 i = 0; i < signatures_.length; i++) {
            signers_[i] = signHash_.toEthSignedMessageHash().recover(signatures_[i]);
        }

        _checkCorrectSigners(signers_);
    }

    function setSignaturesThreshold(uint256 signaturesThreshold_) public onlyOwner {
        require(signaturesThreshold_ > 0, "Signers: invalid threshold");

        signaturesThreshold = signaturesThreshold_;
    }

    function addSigners(address[] calldata signers_) public onlyOwner {
        for (uint256 i = 0; i < signers_.length; i++) {
            require(signers_[i] != address(0), "Signers: zero signer");

            _signers.add(signers_[i]);
        }
    }

    function removeSigners(address[] calldata signers_) public onlyOwner {
        for (uint256 i = 0; i < signers_.length; i++) {
            _signers.remove(signers_[i]);
        }
    }

    function getSigners() external view returns (address[] memory) {
        return _signers.values();
    }
}

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"receiver","type":"string"},{"indexed":false,"internalType":"string","name":"network","type":"string"},{"indexed":false,"internalType":"bool","name":"isWrapped","type":"bool"},{"indexed":false,"internalType":"uint16","name":"referralId","type":"uint16"}],"name":"DepositedERC1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"receiver","type":"string"},{"indexed":false,"internalType":"string","name":"network","type":"string"},{"indexed":false,"internalType":"bool","name":"isWrapped","type":"bool"},{"indexed":false,"internalType":"uint16","name":"referralId","type":"uint16"}],"name":"DepositedERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"receiver","type":"string"},{"indexed":false,"internalType":"string","name":"network","type":"string"},{"indexed":false,"internalType":"bool","name":"isWrapped","type":"bool"},{"indexed":false,"internalType":"uint16","name":"referralId","type":"uint16"}],"name":"DepositedERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"receiver","type":"string"},{"indexed":false,"internalType":"string","name":"network","type":"string"},{"indexed":false,"internalType":"uint16","name":"referralId","type":"uint16"}],"name":"DepositedNative","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address[]","name":"signers_","type":"address[]"},{"internalType":"uint256","name":"signaturesThreshold_","type":"uint256"}],"name":"__Bridge_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers_","type":"address[]"},{"internalType":"uint256","name":"signaturesThreshold_","type":"uint256"}],"name":"__Signers_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"}],"name":"addHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers_","type":"address[]"}],"name":"addSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"}],"name":"containsHash","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"string","name":"receiver_","type":"string"},{"internalType":"string","name":"network_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"uint16","name":"referralId_","type":"uint16"}],"name":"depositERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"string","name":"receiver_","type":"string"},{"internalType":"string","name":"network_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"uint16","name":"referralId_","type":"uint16"}],"name":"depositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"string","name":"receiver_","type":"string"},{"internalType":"string","name":"network_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"uint16","name":"referralId_","type":"uint16"}],"name":"depositERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"receiver_","type":"string"},{"internalType":"string","name":"network_","type":"string"},{"internalType":"uint16","name":"referralId_","type":"uint16"}],"name":"depositNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"uint256","name":"chainId_","type":"uint256"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"}],"name":"getERC1155SignHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"uint256","name":"chainId_","type":"uint256"},{"internalType":"bool","name":"isWrapped_","type":"bool"}],"name":"getERC20SignHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"uint256","name":"chainId_","type":"uint256"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"}],"name":"getERC721SignHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"uint256","name":"chainId_","type":"uint256"}],"name":"getNativeSignHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSigners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers_","type":"address[]"}],"name":"removeSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"signaturesThreshold_","type":"uint256"}],"name":"setSignaturesThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signaturesThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedHashes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"bytes[]","name":"signatures_","type":"bytes[]"}],"name":"withdrawERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"bytes[]","name":"signatures_","type":"bytes[]"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"bool","name":"isWrapped_","type":"bool"},{"internalType":"bytes[]","name":"signatures_","type":"bytes[]"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"txHash_","type":"bytes32"},{"internalType":"uint256","name":"txNonce_","type":"uint256"},{"internalType":"bytes[]","name":"signatures_","type":"bytes[]"}],"name":"withdrawNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523060805234801561001457600080fd5b50608051613dc161004c600039600081816107a6015281816107e601528181610886015281816108c601526109590152613dc16000f3fe6080604052600436106101e75760003560e01c80638da5cb5b11610102578063b3953d4411610095578063bf1fe08f11610064578063bf1fe08f146105a8578063e8906a2d146105c8578063f23a6e61146105e8578063f2fde38b1461061457600080fd5b8063b3953d441461051c578063b427d67c1461053c578063bc197c811461055c578063be6f93d41461058857600080fd5b806394cf795e116100d157806394cf795e1461048a578063aaba091e146104ac578063aef18bf7146104cc578063af94570d146104fc57600080fd5b80638da5cb5b1461040f57806390946c6e1461043757806390e208ee1461045757806394995fc41461046a57600080fd5b80634f1ef2861161017a578063715018a611610149578063715018a61461039a5780637eb9d447146103af5780638338fcd8146103cf5780638d361e43146103ef57600080fd5b80634f1ef2861461033257806352d1902d146103455780635bd5429d1461035a5780635fe277561461037a57600080fd5b80631c3d9c87116101b65780631c3d9c87146102ae578063337e03a9146102ce5780633659cfe6146102fc57806339ce73c71461031c57600080fd5b806301ffc9a7146101f35780630430285a1461022857806309a5584114610248578063150b7a021461026a57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e366004612b59565b610634565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b50610213610243366004612b83565b61066b565b34801561025457600080fd5b50610268610263366004612be9565b6106ba565b005b34801561027657600080fd5b50610295610285366004612d00565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200161021f565b3480156102ba57600080fd5b506102686102c9366004612d67565b61070a565b3480156102da57600080fd5b506102ee6102e9366004612dd7565b610743565b60405190815260200161021f565b34801561030857600080fd5b50610268610317366004612e1d565b61079b565b34801561032857600080fd5b506102ee60655481565b610268610340366004612e38565b61087b565b34801561035157600080fd5b506102ee61094c565b34801561036657600080fd5b50610268610375366004612b83565b6109ff565b34801561038657600080fd5b50610268610395366004612ee6565b610a33565b3480156103a657600080fd5b50610268610c04565b3480156103bb57600080fd5b506102686103ca366004612f9a565b610c3a565b3480156103db57600080fd5b506102686103ea366004612be9565b610c7f565b3480156103fb57600080fd5b5061026861040a36600461305f565b610cfa565b34801561041b57600080fd5b506033546040516001600160a01b03909116815260200161021f565b34801561044357600080fd5b506102686104523660046130a0565b610d74565b61026861046536600461314b565b610ee9565b34801561047657600080fd5b506102686104853660046131cb565b610f81565b34801561049657600080fd5b5061049f610fc0565b60405161021f919061325e565b3480156104b857600080fd5b506102ee6104c73660046132ab565b610fd1565b3480156104d857600080fd5b506102136104e7366004613319565b60686020526000908152604090205460ff1681565b34801561050857600080fd5b506102ee610517366004613332565b61103f565b34801561052857600080fd5b506102686105373660046133d0565b611087565b34801561054857600080fd5b506102ee6105573660046134a5565b6110cf565b34801561056857600080fd5b506102956105773660046135c2565b63bc197c8160e01b95945050505050565b34801561059457600080fd5b506102686105a33660046130a0565b61111a565b3480156105b457600080fd5b506102686105c3366004613319565b611279565b3480156105d457600080fd5b506102686105e336600461305f565b6112f8565b3480156105f457600080fd5b5061029561060336600461366b565b63f23a6e6160e01b95945050505050565b34801561062057600080fd5b5061026861062f366004612e1d565b6113e9565b60006001600160e01b03198216630271189760e51b148061066557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080838360405160200161068a929190918252602082015260400190565b60408051808303601f1901815291815281516020928301206000908152606890925290205460ff16949350505050565b600054610100900460ff166106ea5760405162461bcd60e51b81526004016106e1906136cf565b60405180910390fd5b6106f2611481565b6106fc83836112f8565b61070581611279565b505050565b60006107198787878746610743565b905061072585856114b0565b610730818484611556565b61073a878761165a565b50505050505050565b6040805160208082019790975260609590951b6bffffffffffffffffffffffff191685820152605485019390935260748401919091526094808401919091528151808403909101815260b49092019052805191012090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156107e45760405162461bcd60e51b81526004016106e19061371a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661082d600080516020613d45833981519152546001600160a01b031690565b6001600160a01b0316146108535760405162461bcd60e51b81526004016106e190613766565b61085c816117a3565b60408051600080825260208201909252610878918391906117cd565b50565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108c45760405162461bcd60e51b81526004016106e19061371a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661090d600080516020613d45833981519152546001600160a01b031690565b6001600160a01b0316146109335760405162461bcd60e51b81526004016106e190613766565b61093c826117a3565b610948828260016117cd565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109ec5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106e1565b50600080516020613d4583398151915290565b6033546001600160a01b03163314610a295760405162461bcd60e51b81526004016106e1906137b2565b61094882826114b0565b6001600160a01b038916610a895760405162461bcd60e51b815260206004820152601a60248201527f4552433131353548616e646c65723a207a65726f20746f6b656e00000000000060448201526064016106e1565b60008711610ad95760405162461bcd60e51b815260206004820152601e60248201527f4552433131353548616e646c65723a20616d6f756e74206973207a65726f000060448201526064016106e1565b888215610b4c5760405163124d91e560e01b8152336004820152602481018a9052604481018990526001600160a01b0382169063124d91e590606401600060405180830381600087803b158015610b2f57600080fd5b505af1158015610b43573d6000803e3d6000fd5b50505050610bb1565b604051637921219560e11b81526001600160a01b0382169063f242432a90610b7e90339030908e908e906004016137e7565b600060405180830381600087803b158015610b9857600080fd5b505af1158015610bac573d6000803e3d6000fd5b505050505b7f6f2f9c82f8808cf5cb4332789c02c0c95fad4f7586899cc1bc426f254debf1658a8a8a8a8a8a8a8a8a604051610bf099989796959493929190613848565b60405180910390a150505050505050505050565b6033546001600160a01b03163314610c2e5760405162461bcd60e51b81526004016106e1906137b2565b610c386000611947565b565b6000610c4d8b8b8b8b8b468c8c8c61103f565b9050610c5988886114b0565b610c64818484611556565b610c728b8b8b898989611999565b5050505050505050505050565b6000610c8b6001611b15565b90508015610ca3576000805461ff0019166101001790555b610cae8484846106ba565b8015610cf4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6033546001600160a01b03163314610d245760405162461bcd60e51b81526004016106e1906137b2565b60005b8181101561070557610d61838383818110610d4457610d446138ab565b9050602002016020810190610d599190612e1d565b606690611ba2565b5080610d6c816138d7565b915050610d27565b6001600160a01b038816610dc65760405162461bcd60e51b815260206004820152601960248201527822a9219b9918a430b7323632b91d103d32b937903a37b5b2b760391b60448201526064016106e1565b878215610e325760405163079cc67960e41b8152336004820152602481018990526001600160a01b038216906379cc679090604401600060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b50505050610e99565b604051632142170760e11b8152336004820152306024820152604481018990526001600160a01b038216906342842e0e90606401600060405180830381600087803b158015610e8057600080fd5b505af1158015610e94573d6000803e3d6000fd5b505050505b7f5a035a04c3f86dbf0cfe44e37374a1c7d8ad9d3b2542a39acaab6e3cb18e97388989898989898989604051610ed69897969594939291906138f2565b60405180910390a1505050505050505050565b60003411610f395760405162461bcd60e51b815260206004820152601960248201527f4e617469766548616e646c65723a207a65726f2076616c75650000000000000060448201526064016106e1565b7f618bd7f3201fe12a7051eb9e8f45ac82a6648b19a07a79c9189ac480546e68c1348686868686604051610f729695949392919061394e565b60405180910390a15050505050565b6000610f928989898989468a610fd1565b9050610f9e86866114b0565b610fa9818484611556565b610fb589898987611bbe565b505050505050505050565b6060610fcc6066611d3e565b905090565b604080516bffffffffffffffffffffffff196060998a1b811660208084019190915260348301999099529690981b90951660548801526068870193909352608886019190915260a8850152151560f81b60c8840152805180840360a901815260c99093019052815191012090565b600089898989898989898960405160200161106299989796959493929190613993565b6040516020818303038152906040528051906020012090509998505050505050505050565b600061109b8c8c8c8c8c8c468d8d8d6110cf565b90506110a788886114b0565b6110b2818484611556565b6110c18c8c8c8c8a8a8a611d4b565b505050505050505050505050565b60008a8a8a8a8a8a8a8a8a8a6040516020016110f49a999897969594939291906139f5565b6040516020818303038152906040528051906020012090509a9950505050505050505050565b6001600160a01b03881661116b5760405162461bcd60e51b815260206004820152601860248201527722a92199182430b7323632b91d103d32b937903a37b5b2b760411b60448201526064016106e1565b600087116111bb5760405162461bcd60e51b815260206004820152601c60248201527f455243323048616e646c65723a20616d6f756e74206973207a65726f0000000060448201526064016106e1565b8782156112275760405163079cc67960e41b8152336004820152602481018990526001600160a01b038216906379cc679090604401600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b5050505061123c565b61123c6001600160a01b03821633308b611f23565b7ffc11ca985085252b65dba84249af6977f9d4cb2acc79ee95fff01985d1b562758989898989898989604051610ed69897969594939291906138f2565b6033546001600160a01b031633146112a35760405162461bcd60e51b81526004016106e1906137b2565b600081116112f35760405162461bcd60e51b815260206004820152601a60248201527f5369676e6572733a20696e76616c6964207468726573686f6c6400000000000060448201526064016106e1565b606555565b6033546001600160a01b031633146113225760405162461bcd60e51b81526004016106e1906137b2565b60005b81811015610705576000838383818110611341576113416138ab565b90506020020160208101906113569190612e1d565b6001600160a01b031614156113a45760405162461bcd60e51b815260206004820152601460248201527329b4b3b732b9399d103d32b9379039b4b3b732b960611b60448201526064016106e1565b6113d68383838181106113b9576113b96138ab565b90506020020160208101906113ce9190612e1d565b606690611f8e565b50806113e1816138d7565b915050611325565b6033546001600160a01b031633146114135760405162461bcd60e51b81526004016106e1906137b2565b6001600160a01b0381166114785760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e1565b61087881611947565b600054610100900460ff166114a85760405162461bcd60e51b81526004016106e1906136cf565b610c38611fa3565b60408051602080820185905281830184905282518083038401815260609092018352815191810191909120600081815260689092529190205460ff16156115395760405162461bcd60e51b815260206004820152601e60248201527f4861736865733a207468652068617368206e6f6e63652069732075736564000060448201526064016106e1565b6000908152606860205260409020805460ff191660011790555050565b6000816001600160401b0381111561157057611570612c4b565b604051908082528060200260200182016040528015611599578160200160208202803683370190505b50905060005b82811015611650576116148484838181106115bc576115bc6138ab565b90506020028101906115ce9190613a5e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160e9250899150611fd39050565b90612026565b828281518110611626576116266138ab565b6001600160a01b039092166020928302919091019091015280611648816138d7565b91505061159f565b50610cf48161204a565b600082116116aa5760405162461bcd60e51b815260206004820152601d60248201527f4e617469766548616e646c65723a20616d6f756e74206973207a65726f00000060448201526064016106e1565b6001600160a01b0381166117005760405162461bcd60e51b815260206004820152601f60248201527f4e617469766548616e646c65723a207265636569766572206973207a65726f0060448201526064016106e1565b6000816001600160a01b03168360405160006040518083038185875af1925050503d806000811461174d576040519150601f19603f3d011682016040523d82523d6000602084013e611752565b606091505b50509050806107055760405162461bcd60e51b815260206004820152601d60248201527f4e617469766548616e646c65723a2063616e27742073656e642065746800000060448201526064016106e1565b6033546001600160a01b031633146108785760405162461bcd60e51b81526004016106e1906137b2565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561180057610705836121c2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561183957600080fd5b505afa925050508015611869575060408051601f3d908101601f1916820190925261186691810190613aa4565b60015b6118cc5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106e1565b600080516020613d45833981519152811461193b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106e1565b5061070583838361225e565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0386166119eb5760405162461bcd60e51b815260206004820152601960248201527822a9219b9918a430b7323632b91d103d32b937903a37b5b2b760391b60448201526064016106e1565b6001600160a01b038416611a415760405162461bcd60e51b815260206004820152601c60248201527f45524337323148616e646c65723a207a65726f2072656365697665720000000060448201526064016106e1565b858115611ab157604051639f6ed25f60e01b81526001600160a01b03821690639f6ed25f90611a7a9088908a9089908990600401613abd565b600060405180830381600087803b158015611a9457600080fd5b505af1158015611aa8573d6000803e3d6000fd5b5050505061073a565b604051632142170760e11b81523060048201526001600160a01b038681166024830152604482018890528216906342842e0e90606401600060405180830381600087803b158015611b0157600080fd5b505af1158015610c72573d6000803e3d6000fd5b60008054610100900460ff1615611b5c578160ff166001148015611b385750303b155b611b545760405162461bcd60e51b81526004016106e190613ae5565b506000919050565b60005460ff808416911610611b835760405162461bcd60e51b81526004016106e190613ae5565b506000805460ff191660ff92909216919091179055600190565b919050565b6000611bb7836001600160a01b038416612283565b9392505050565b6001600160a01b038416611c0f5760405162461bcd60e51b815260206004820152601860248201527722a92199182430b7323632b91d103d32b937903a37b5b2b760411b60448201526064016106e1565b60008311611c5f5760405162461bcd60e51b815260206004820152601c60248201527f455243323048616e646c65723a20616d6f756e74206973207a65726f0000000060448201526064016106e1565b6001600160a01b038216611cb55760405162461bcd60e51b815260206004820152601b60248201527f455243323048616e646c65723a207a65726f207265636569766572000000000060448201526064016106e1565b838115611d23576040516308934a5f60e31b81526001600160a01b0384811660048301526024820186905282169063449a52f890604401600060405180830381600087803b158015611d0657600080fd5b505af1158015611d1a573d6000803e3d6000fd5b50505050611d37565b611d376001600160a01b0382168486612376565b5050505050565b60606000611bb7836123a6565b6001600160a01b038716611da15760405162461bcd60e51b815260206004820152601a60248201527f4552433131353548616e646c65723a207a65726f20746f6b656e00000000000060448201526064016106e1565b6001600160a01b038416611df75760405162461bcd60e51b815260206004820152601d60248201527f4552433131353548616e646c65723a207a65726f20726563656976657200000060448201526064016106e1565b60008511611e475760405162461bcd60e51b815260206004820152601e60248201527f4552433131353548616e646c65723a20616d6f756e74206973207a65726f000060448201526064016106e1565b868115611eb957604051633dbd5b2560e01b81526001600160a01b03821690633dbd5b2590611e829088908b908b908a908a90600401613b33565b600060405180830381600087803b158015611e9c57600080fd5b505af1158015611eb0573d6000803e3d6000fd5b50505050611f19565b604051637921219560e11b81526001600160a01b0382169063f242432a90611eeb90309089908c908c906004016137e7565b600060405180830381600087803b158015611f0557600080fd5b505af11580156110c1573d6000803e3d6000fd5b5050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610cf49085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612402565b6000611bb7836001600160a01b0384166124d4565b600054610100900460ff16611fca5760405162461bcd60e51b81526004016106e1906136cf565b610c3833611947565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006120358585612523565b9150915061204281612593565b509392505050565b6000805b825181101561216e5761208483828151811061206c5761206c6138ab565b6020026020010151606661274e90919063ffffffff16565b6120d05760405162461bcd60e51b815260206004820152601760248201527f5369676e6572733a20696e76616c6964207369676e657200000000000000000060448201526064016106e1565b600060988483815181106120e6576120e66138ab565b60200260200101516001600160a01b0316901c60026121059190613c45565b9050828116156121575760405162461bcd60e51b815260206004820152601a60248201527f5369676e6572733a206475706c6963617465207369676e65727300000000000060448201526064016106e1565b919091179080612166816138d7565b91505061204e565b50606554825110156109485760405162461bcd60e51b815260206004820152601d60248201527f5369676e6572733a207468726573686f6c64206973206e6f74206d657400000060448201526064016106e1565b6001600160a01b0381163b61222f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106e1565b600080516020613d4583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61226783612770565b6000825111806122745750805b1561070557610cf483836127b0565b6000818152600183016020526040812054801561236c5760006122a7600183613c51565b85549091506000906122bb90600190613c51565b90508181146123205760008660000182815481106122db576122db6138ab565b90600052602060002001549050808760000184815481106122fe576122fe6138ab565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233157612331613c68565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610665565b6000915050610665565b6040516001600160a01b03831660248201526044810182905261070590849063a9059cbb60e01b90606401611f57565b6060816000018054806020026020016040519081016040528092919081815260200182805480156123f657602002820191906000526020600020905b8154815260200190600101908083116123e2575b50505050509050919050565b6000612457826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127d59092919063ffffffff16565b80519091501561070557808060200190518101906124759190613c7e565b6107055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e1565b600081815260018301602052604081205461251b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610665565b506000610665565b60008082516041141561255a5760208301516040840151606085015160001a61254e878285856127ec565b9450945050505061258c565b82516040141561258457602083015160408401516125798683836128d9565b93509350505061258c565b506000905060025b9250929050565b60008160048111156125a7576125a7613c9b565b14156125b05750565b60018160048111156125c4576125c4613c9b565b14156126125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106e1565b600281600481111561262657612626613c9b565b14156126745760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106e1565b600381600481111561268857612688613c9b565b14156126e15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016106e1565b60048160048111156126f5576126f5613c9b565b14156108785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016106e1565b6001600160a01b03811660009081526001830160205260408120541515611bb7565b612779816121c2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611bb78383604051806060016040528060278152602001613d6560279139612912565b60606127e484846000856129ef565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561282357506000905060036128d0565b8460ff16601b1415801561283b57508460ff16601c14155b1561284c57506000905060046128d0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128c9576000600192509250506128d0565b9150600090505b94509492505050565b6000806001600160ff1b038316816128f660ff86901c601b613cb1565b9050612904878288856127ec565b935093505050935093915050565b60606001600160a01b0384163b61297a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106e1565b600080856001600160a01b0316856040516129959190613cf5565b600060405180830381855af49150503d80600081146129d0576040519150601f19603f3d011682016040523d82523d6000602084013e6129d5565b606091505b50915091506129e5828286612b20565b9695505050505050565b606082471015612a505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106e1565b6001600160a01b0385163b612aa75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e1565b600080866001600160a01b03168587604051612ac39190613cf5565b60006040518083038185875af1925050503d8060008114612b00576040519150601f19603f3d011682016040523d82523d6000602084013e612b05565b606091505b5091509150612b15828286612b20565b979650505050505050565b60608315612b2f575081611bb7565b825115612b3f5782518084602001fd5b8160405162461bcd60e51b81526004016106e19190613d11565b600060208284031215612b6b57600080fd5b81356001600160e01b031981168114611bb757600080fd5b60008060408385031215612b9657600080fd5b50508035926020909101359150565b60008083601f840112612bb757600080fd5b5081356001600160401b03811115612bce57600080fd5b6020830191508360208260051b850101111561258c57600080fd5b600080600060408486031215612bfe57600080fd5b83356001600160401b03811115612c1457600080fd5b612c2086828701612ba5565b909790965060209590950135949350505050565b80356001600160a01b0381168114611b9d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612c8957612c89612c4b565b604052919050565b600082601f830112612ca257600080fd5b81356001600160401b03811115612cbb57612cbb612c4b565b612cce601f8201601f1916602001612c61565b818152846020838601011115612ce357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612d1657600080fd5b612d1f85612c34565b9350612d2d60208601612c34565b92506040850135915060608501356001600160401b03811115612d4f57600080fd5b612d5b87828801612c91565b91505092959194509250565b60008060008060008060a08789031215612d8057600080fd5b86359550612d9060208801612c34565b9450604087013593506060870135925060808701356001600160401b03811115612db957600080fd5b612dc589828a01612ba5565b979a9699509497509295939492505050565b600080600080600060a08688031215612def57600080fd5b85359450612dff60208701612c34565b94979496505050506040830135926060810135926080909101359150565b600060208284031215612e2f57600080fd5b611bb782612c34565b60008060408385031215612e4b57600080fd5b612e5483612c34565b915060208301356001600160401b03811115612e6f57600080fd5b612e7b85828601612c91565b9150509250929050565b60008083601f840112612e9757600080fd5b5081356001600160401b03811115612eae57600080fd5b60208301915083602082850101111561258c57600080fd5b801515811461087857600080fd5b803561ffff81168114611b9d57600080fd5b600080600080600080600080600060e08a8c031215612f0457600080fd5b612f0d8a612c34565b985060208a0135975060408a0135965060608a01356001600160401b0380821115612f3757600080fd5b612f438d838e01612e85565b909850965060808c0135915080821115612f5c57600080fd5b50612f698c828d01612e85565b90955093505060a08a0135612f7d81612ec6565b9150612f8b60c08b01612ed4565b90509295985092959850929598565b6000806000806000806000806000806101008b8d031215612fba57600080fd5b612fc38b612c34565b995060208b01359850612fd860408c01612c34565b975060608b0135965060808b0135955060a08b01356001600160401b038082111561300257600080fd5b61300e8e838f01612e85565b909750955060c08d0135915061302382612ec6565b90935060e08c0135908082111561303957600080fd5b506130468d828e01612ba5565b915080935050809150509295989b9194979a5092959850565b6000806020838503121561307257600080fd5b82356001600160401b0381111561308857600080fd5b61309485828601612ba5565b90969095509350505050565b60008060008060008060008060c0898b0312156130bc57600080fd5b6130c589612c34565b97506020890135965060408901356001600160401b03808211156130e857600080fd5b6130f48c838d01612e85565b909850965060608b013591508082111561310d57600080fd5b5061311a8b828c01612e85565b909550935050608089013561312e81612ec6565b915061313c60a08a01612ed4565b90509295985092959890939650565b60008060008060006060868803121561316357600080fd5b85356001600160401b038082111561317a57600080fd5b61318689838a01612e85565b9097509550602088013591508082111561319f57600080fd5b506131ac88828901612e85565b90945092506131bf905060408701612ed4565b90509295509295909350565b60008060008060008060008060e0898b0312156131e757600080fd5b6131f089612c34565b97506020890135965061320560408a01612c34565b9550606089013594506080890135935060a089013561322381612ec6565b925060c08901356001600160401b0381111561323e57600080fd5b61324a8b828c01612ba5565b999c989b5096995094979396929594505050565b6020808252825182820181905260009190848201906040850190845b8181101561329f5783516001600160a01b03168352928401929184019160010161327a565b50909695505050505050565b600080600080600080600060e0888a0312156132c657600080fd5b6132cf88612c34565b9650602088013595506132e460408901612c34565b9450606088013593506080880135925060a0880135915060c088013561330981612ec6565b8091505092959891949750929550565b60006020828403121561332b57600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561335157600080fd5b61335a8a612c34565b985060208a0135975061336f60408b01612c34565b965060608a0135955060808a0135945060a08a0135935060c08a01356001600160401b0381111561339f57600080fd5b6133ab8c828d01612e85565b90945092505060e08a01356133bf81612ec6565b809150509295985092959850929598565b60008060008060008060008060008060006101208c8e0312156133f257600080fd5b6133fb8c612c34565b9a5060208c0135995060408c0135985061341760608d01612c34565b975060808c0135965060a08c013595506001600160401b038060c08e0135111561344057600080fd5b6134508e60c08f01358f01612e85565b909650945061346260e08e0135612ec6565b60e08d01359350806101008e0135111561347b57600080fd5b5061348d8d6101008e01358e01612ba5565b81935080925050509295989b509295989b9093969950565b6000806000806000806000806000806101208b8d0312156134c557600080fd5b6134ce8b612c34565b995060208b0135985060408b013597506134ea60608c01612c34565b965060808b0135955060a08b0135945060c08b0135935060e08b01356001600160401b0381111561351a57600080fd5b6135268d828e01612e85565b9094509250506101008b013561353b81612ec6565b809150509295989b9194979a5092959850565b600082601f83011261355f57600080fd5b813560206001600160401b0382111561357a5761357a612c4b565b8160051b613589828201612c61565b92835284810182019282810190878511156135a357600080fd5b83870192505b84831015612b15578235825291830191908301906135a9565b600080600080600060a086880312156135da57600080fd5b6135e386612c34565b94506135f160208701612c34565b935060408601356001600160401b038082111561360d57600080fd5b61361989838a0161354e565b9450606088013591508082111561362f57600080fd5b61363b89838a0161354e565b9350608088013591508082111561365157600080fd5b5061365e88828901612c91565b9150509295509295909350565b600080600080600060a0868803121561368357600080fd5b61368c86612c34565b945061369a60208701612c34565b9350604086013592506060860135915060808601356001600160401b038111156136c357600080fd5b61365e88828901612c91565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038a16815288602082015287604082015260e06060820152600061387660e08301888a61381f565b828103608084015261388981878961381f565b94151560a0840152505061ffff9190911660c090910152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156138eb576138eb6138c1565b5060010190565b60018060a01b038916815287602082015260c06040820152600061391a60c08301888a61381f565b828103606084015261392d81878961381f565b9415156080840152505061ffff9190911660a0909101529695505050505050565b86815260806020820152600061396860808301878961381f565b828103604084015261397b81868861381f565b91505061ffff83166060830152979650505050505050565b60006bffffffffffffffffffffffff19808c60601b1683528a6014840152808a60601b16603484015250876048830152866068830152856088830152838560a88401375090151560f81b910160a881019190915260a901979650505050505050565b60006bffffffffffffffffffffffff19808d60601b1683528b60148401528a6034840152808a60601b166054840152508760688301528660888301528560a8830152838560c88401375090151560f81b910160c881019190915260c90198975050505050505050565b6000808335601e19843603018112613a7557600080fd5b8301803591506001600160401b03821115613a8f57600080fd5b60200191503681900382131561258c57600080fd5b600060208284031215613ab657600080fd5b5051919050565b60018060a01b03851681528360208201526060604082015260006129e560608301848661381f565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60018060a01b0386168152846020820152836040820152608060608201526000612b1560808301848661381f565b600181815b80851115613b9c578160001904821115613b8257613b826138c1565b80851615613b8f57918102915b93841c9390800290613b66565b509250929050565b600082613bb357506001610665565b81613bc057506000610665565b8160018114613bd65760028114613be057613bfc565b6001915050610665565b60ff841115613bf157613bf16138c1565b50506001821b610665565b5060208310610133831016604e8410600b8410161715613c1f575081810a610665565b613c298383613b61565b8060001904821115613c3d57613c3d6138c1565b029392505050565b6000611bb78383613ba4565b600082821015613c6357613c636138c1565b500390565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613c9057600080fd5b8151611bb781612ec6565b634e487b7160e01b600052602160045260246000fd5b60008219821115613cc457613cc46138c1565b500190565b60005b83811015613ce4578181015183820152602001613ccc565b83811115610cf45750506000910152565b60008251613d07818460208701613cc9565b9190910192915050565b6020815260008251806020840152613d30816040850160208701613cc9565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207759de0aa8e40c61d23375e6ca6dd1ee308ebf35f6f530ed9ff4b61e664469e264736f6c63430008090033

Deployed Bytecode

0x6080604052600436106101e75760003560e01c80638da5cb5b11610102578063b3953d4411610095578063bf1fe08f11610064578063bf1fe08f146105a8578063e8906a2d146105c8578063f23a6e61146105e8578063f2fde38b1461061457600080fd5b8063b3953d441461051c578063b427d67c1461053c578063bc197c811461055c578063be6f93d41461058857600080fd5b806394cf795e116100d157806394cf795e1461048a578063aaba091e146104ac578063aef18bf7146104cc578063af94570d146104fc57600080fd5b80638da5cb5b1461040f57806390946c6e1461043757806390e208ee1461045757806394995fc41461046a57600080fd5b80634f1ef2861161017a578063715018a611610149578063715018a61461039a5780637eb9d447146103af5780638338fcd8146103cf5780638d361e43146103ef57600080fd5b80634f1ef2861461033257806352d1902d146103455780635bd5429d1461035a5780635fe277561461037a57600080fd5b80631c3d9c87116101b65780631c3d9c87146102ae578063337e03a9146102ce5780633659cfe6146102fc57806339ce73c71461031c57600080fd5b806301ffc9a7146101f35780630430285a1461022857806309a5584114610248578063150b7a021461026a57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e366004612b59565b610634565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b50610213610243366004612b83565b61066b565b34801561025457600080fd5b50610268610263366004612be9565b6106ba565b005b34801561027657600080fd5b50610295610285366004612d00565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200161021f565b3480156102ba57600080fd5b506102686102c9366004612d67565b61070a565b3480156102da57600080fd5b506102ee6102e9366004612dd7565b610743565b60405190815260200161021f565b34801561030857600080fd5b50610268610317366004612e1d565b61079b565b34801561032857600080fd5b506102ee60655481565b610268610340366004612e38565b61087b565b34801561035157600080fd5b506102ee61094c565b34801561036657600080fd5b50610268610375366004612b83565b6109ff565b34801561038657600080fd5b50610268610395366004612ee6565b610a33565b3480156103a657600080fd5b50610268610c04565b3480156103bb57600080fd5b506102686103ca366004612f9a565b610c3a565b3480156103db57600080fd5b506102686103ea366004612be9565b610c7f565b3480156103fb57600080fd5b5061026861040a36600461305f565b610cfa565b34801561041b57600080fd5b506033546040516001600160a01b03909116815260200161021f565b34801561044357600080fd5b506102686104523660046130a0565b610d74565b61026861046536600461314b565b610ee9565b34801561047657600080fd5b506102686104853660046131cb565b610f81565b34801561049657600080fd5b5061049f610fc0565b60405161021f919061325e565b3480156104b857600080fd5b506102ee6104c73660046132ab565b610fd1565b3480156104d857600080fd5b506102136104e7366004613319565b60686020526000908152604090205460ff1681565b34801561050857600080fd5b506102ee610517366004613332565b61103f565b34801561052857600080fd5b506102686105373660046133d0565b611087565b34801561054857600080fd5b506102ee6105573660046134a5565b6110cf565b34801561056857600080fd5b506102956105773660046135c2565b63bc197c8160e01b95945050505050565b34801561059457600080fd5b506102686105a33660046130a0565b61111a565b3480156105b457600080fd5b506102686105c3366004613319565b611279565b3480156105d457600080fd5b506102686105e336600461305f565b6112f8565b3480156105f457600080fd5b5061029561060336600461366b565b63f23a6e6160e01b95945050505050565b34801561062057600080fd5b5061026861062f366004612e1d565b6113e9565b60006001600160e01b03198216630271189760e51b148061066557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080838360405160200161068a929190918252602082015260400190565b60408051808303601f1901815291815281516020928301206000908152606890925290205460ff16949350505050565b600054610100900460ff166106ea5760405162461bcd60e51b81526004016106e1906136cf565b60405180910390fd5b6106f2611481565b6106fc83836112f8565b61070581611279565b505050565b60006107198787878746610743565b905061072585856114b0565b610730818484611556565b61073a878761165a565b50505050505050565b6040805160208082019790975260609590951b6bffffffffffffffffffffffff191685820152605485019390935260748401919091526094808401919091528151808403909101815260b49092019052805191012090565b306001600160a01b037f0000000000000000000000003f2e4e5a70f2a424d7c4e4e0323c878c77c205371614156107e45760405162461bcd60e51b81526004016106e19061371a565b7f0000000000000000000000003f2e4e5a70f2a424d7c4e4e0323c878c77c205376001600160a01b031661082d600080516020613d45833981519152546001600160a01b031690565b6001600160a01b0316146108535760405162461bcd60e51b81526004016106e190613766565b61085c816117a3565b60408051600080825260208201909252610878918391906117cd565b50565b306001600160a01b037f0000000000000000000000003f2e4e5a70f2a424d7c4e4e0323c878c77c205371614156108c45760405162461bcd60e51b81526004016106e19061371a565b7f0000000000000000000000003f2e4e5a70f2a424d7c4e4e0323c878c77c205376001600160a01b031661090d600080516020613d45833981519152546001600160a01b031690565b6001600160a01b0316146109335760405162461bcd60e51b81526004016106e190613766565b61093c826117a3565b610948828260016117cd565b5050565b6000306001600160a01b037f0000000000000000000000003f2e4e5a70f2a424d7c4e4e0323c878c77c2053716146109ec5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106e1565b50600080516020613d4583398151915290565b6033546001600160a01b03163314610a295760405162461bcd60e51b81526004016106e1906137b2565b61094882826114b0565b6001600160a01b038916610a895760405162461bcd60e51b815260206004820152601a60248201527f4552433131353548616e646c65723a207a65726f20746f6b656e00000000000060448201526064016106e1565b60008711610ad95760405162461bcd60e51b815260206004820152601e60248201527f4552433131353548616e646c65723a20616d6f756e74206973207a65726f000060448201526064016106e1565b888215610b4c5760405163124d91e560e01b8152336004820152602481018a9052604481018990526001600160a01b0382169063124d91e590606401600060405180830381600087803b158015610b2f57600080fd5b505af1158015610b43573d6000803e3d6000fd5b50505050610bb1565b604051637921219560e11b81526001600160a01b0382169063f242432a90610b7e90339030908e908e906004016137e7565b600060405180830381600087803b158015610b9857600080fd5b505af1158015610bac573d6000803e3d6000fd5b505050505b7f6f2f9c82f8808cf5cb4332789c02c0c95fad4f7586899cc1bc426f254debf1658a8a8a8a8a8a8a8a8a604051610bf099989796959493929190613848565b60405180910390a150505050505050505050565b6033546001600160a01b03163314610c2e5760405162461bcd60e51b81526004016106e1906137b2565b610c386000611947565b565b6000610c4d8b8b8b8b8b468c8c8c61103f565b9050610c5988886114b0565b610c64818484611556565b610c728b8b8b898989611999565b5050505050505050505050565b6000610c8b6001611b15565b90508015610ca3576000805461ff0019166101001790555b610cae8484846106ba565b8015610cf4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6033546001600160a01b03163314610d245760405162461bcd60e51b81526004016106e1906137b2565b60005b8181101561070557610d61838383818110610d4457610d446138ab565b9050602002016020810190610d599190612e1d565b606690611ba2565b5080610d6c816138d7565b915050610d27565b6001600160a01b038816610dc65760405162461bcd60e51b815260206004820152601960248201527822a9219b9918a430b7323632b91d103d32b937903a37b5b2b760391b60448201526064016106e1565b878215610e325760405163079cc67960e41b8152336004820152602481018990526001600160a01b038216906379cc679090604401600060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b50505050610e99565b604051632142170760e11b8152336004820152306024820152604481018990526001600160a01b038216906342842e0e90606401600060405180830381600087803b158015610e8057600080fd5b505af1158015610e94573d6000803e3d6000fd5b505050505b7f5a035a04c3f86dbf0cfe44e37374a1c7d8ad9d3b2542a39acaab6e3cb18e97388989898989898989604051610ed69897969594939291906138f2565b60405180910390a1505050505050505050565b60003411610f395760405162461bcd60e51b815260206004820152601960248201527f4e617469766548616e646c65723a207a65726f2076616c75650000000000000060448201526064016106e1565b7f618bd7f3201fe12a7051eb9e8f45ac82a6648b19a07a79c9189ac480546e68c1348686868686604051610f729695949392919061394e565b60405180910390a15050505050565b6000610f928989898989468a610fd1565b9050610f9e86866114b0565b610fa9818484611556565b610fb589898987611bbe565b505050505050505050565b6060610fcc6066611d3e565b905090565b604080516bffffffffffffffffffffffff196060998a1b811660208084019190915260348301999099529690981b90951660548801526068870193909352608886019190915260a8850152151560f81b60c8840152805180840360a901815260c99093019052815191012090565b600089898989898989898960405160200161106299989796959493929190613993565b6040516020818303038152906040528051906020012090509998505050505050505050565b600061109b8c8c8c8c8c8c468d8d8d6110cf565b90506110a788886114b0565b6110b2818484611556565b6110c18c8c8c8c8a8a8a611d4b565b505050505050505050505050565b60008a8a8a8a8a8a8a8a8a8a6040516020016110f49a999897969594939291906139f5565b6040516020818303038152906040528051906020012090509a9950505050505050505050565b6001600160a01b03881661116b5760405162461bcd60e51b815260206004820152601860248201527722a92199182430b7323632b91d103d32b937903a37b5b2b760411b60448201526064016106e1565b600087116111bb5760405162461bcd60e51b815260206004820152601c60248201527f455243323048616e646c65723a20616d6f756e74206973207a65726f0000000060448201526064016106e1565b8782156112275760405163079cc67960e41b8152336004820152602481018990526001600160a01b038216906379cc679090604401600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b5050505061123c565b61123c6001600160a01b03821633308b611f23565b7ffc11ca985085252b65dba84249af6977f9d4cb2acc79ee95fff01985d1b562758989898989898989604051610ed69897969594939291906138f2565b6033546001600160a01b031633146112a35760405162461bcd60e51b81526004016106e1906137b2565b600081116112f35760405162461bcd60e51b815260206004820152601a60248201527f5369676e6572733a20696e76616c6964207468726573686f6c6400000000000060448201526064016106e1565b606555565b6033546001600160a01b031633146113225760405162461bcd60e51b81526004016106e1906137b2565b60005b81811015610705576000838383818110611341576113416138ab565b90506020020160208101906113569190612e1d565b6001600160a01b031614156113a45760405162461bcd60e51b815260206004820152601460248201527329b4b3b732b9399d103d32b9379039b4b3b732b960611b60448201526064016106e1565b6113d68383838181106113b9576113b96138ab565b90506020020160208101906113ce9190612e1d565b606690611f8e565b50806113e1816138d7565b915050611325565b6033546001600160a01b031633146114135760405162461bcd60e51b81526004016106e1906137b2565b6001600160a01b0381166114785760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e1565b61087881611947565b600054610100900460ff166114a85760405162461bcd60e51b81526004016106e1906136cf565b610c38611fa3565b60408051602080820185905281830184905282518083038401815260609092018352815191810191909120600081815260689092529190205460ff16156115395760405162461bcd60e51b815260206004820152601e60248201527f4861736865733a207468652068617368206e6f6e63652069732075736564000060448201526064016106e1565b6000908152606860205260409020805460ff191660011790555050565b6000816001600160401b0381111561157057611570612c4b565b604051908082528060200260200182016040528015611599578160200160208202803683370190505b50905060005b82811015611650576116148484838181106115bc576115bc6138ab565b90506020028101906115ce9190613a5e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160e9250899150611fd39050565b90612026565b828281518110611626576116266138ab565b6001600160a01b039092166020928302919091019091015280611648816138d7565b91505061159f565b50610cf48161204a565b600082116116aa5760405162461bcd60e51b815260206004820152601d60248201527f4e617469766548616e646c65723a20616d6f756e74206973207a65726f00000060448201526064016106e1565b6001600160a01b0381166117005760405162461bcd60e51b815260206004820152601f60248201527f4e617469766548616e646c65723a207265636569766572206973207a65726f0060448201526064016106e1565b6000816001600160a01b03168360405160006040518083038185875af1925050503d806000811461174d576040519150601f19603f3d011682016040523d82523d6000602084013e611752565b606091505b50509050806107055760405162461bcd60e51b815260206004820152601d60248201527f4e617469766548616e646c65723a2063616e27742073656e642065746800000060448201526064016106e1565b6033546001600160a01b031633146108785760405162461bcd60e51b81526004016106e1906137b2565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561180057610705836121c2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561183957600080fd5b505afa925050508015611869575060408051601f3d908101601f1916820190925261186691810190613aa4565b60015b6118cc5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106e1565b600080516020613d45833981519152811461193b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106e1565b5061070583838361225e565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0386166119eb5760405162461bcd60e51b815260206004820152601960248201527822a9219b9918a430b7323632b91d103d32b937903a37b5b2b760391b60448201526064016106e1565b6001600160a01b038416611a415760405162461bcd60e51b815260206004820152601c60248201527f45524337323148616e646c65723a207a65726f2072656365697665720000000060448201526064016106e1565b858115611ab157604051639f6ed25f60e01b81526001600160a01b03821690639f6ed25f90611a7a9088908a9089908990600401613abd565b600060405180830381600087803b158015611a9457600080fd5b505af1158015611aa8573d6000803e3d6000fd5b5050505061073a565b604051632142170760e11b81523060048201526001600160a01b038681166024830152604482018890528216906342842e0e90606401600060405180830381600087803b158015611b0157600080fd5b505af1158015610c72573d6000803e3d6000fd5b60008054610100900460ff1615611b5c578160ff166001148015611b385750303b155b611b545760405162461bcd60e51b81526004016106e190613ae5565b506000919050565b60005460ff808416911610611b835760405162461bcd60e51b81526004016106e190613ae5565b506000805460ff191660ff92909216919091179055600190565b919050565b6000611bb7836001600160a01b038416612283565b9392505050565b6001600160a01b038416611c0f5760405162461bcd60e51b815260206004820152601860248201527722a92199182430b7323632b91d103d32b937903a37b5b2b760411b60448201526064016106e1565b60008311611c5f5760405162461bcd60e51b815260206004820152601c60248201527f455243323048616e646c65723a20616d6f756e74206973207a65726f0000000060448201526064016106e1565b6001600160a01b038216611cb55760405162461bcd60e51b815260206004820152601b60248201527f455243323048616e646c65723a207a65726f207265636569766572000000000060448201526064016106e1565b838115611d23576040516308934a5f60e31b81526001600160a01b0384811660048301526024820186905282169063449a52f890604401600060405180830381600087803b158015611d0657600080fd5b505af1158015611d1a573d6000803e3d6000fd5b50505050611d37565b611d376001600160a01b0382168486612376565b5050505050565b60606000611bb7836123a6565b6001600160a01b038716611da15760405162461bcd60e51b815260206004820152601a60248201527f4552433131353548616e646c65723a207a65726f20746f6b656e00000000000060448201526064016106e1565b6001600160a01b038416611df75760405162461bcd60e51b815260206004820152601d60248201527f4552433131353548616e646c65723a207a65726f20726563656976657200000060448201526064016106e1565b60008511611e475760405162461bcd60e51b815260206004820152601e60248201527f4552433131353548616e646c65723a20616d6f756e74206973207a65726f000060448201526064016106e1565b868115611eb957604051633dbd5b2560e01b81526001600160a01b03821690633dbd5b2590611e829088908b908b908a908a90600401613b33565b600060405180830381600087803b158015611e9c57600080fd5b505af1158015611eb0573d6000803e3d6000fd5b50505050611f19565b604051637921219560e11b81526001600160a01b0382169063f242432a90611eeb90309089908c908c906004016137e7565b600060405180830381600087803b158015611f0557600080fd5b505af11580156110c1573d6000803e3d6000fd5b5050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610cf49085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612402565b6000611bb7836001600160a01b0384166124d4565b600054610100900460ff16611fca5760405162461bcd60e51b81526004016106e1906136cf565b610c3833611947565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006120358585612523565b9150915061204281612593565b509392505050565b6000805b825181101561216e5761208483828151811061206c5761206c6138ab565b6020026020010151606661274e90919063ffffffff16565b6120d05760405162461bcd60e51b815260206004820152601760248201527f5369676e6572733a20696e76616c6964207369676e657200000000000000000060448201526064016106e1565b600060988483815181106120e6576120e66138ab565b60200260200101516001600160a01b0316901c60026121059190613c45565b9050828116156121575760405162461bcd60e51b815260206004820152601a60248201527f5369676e6572733a206475706c6963617465207369676e65727300000000000060448201526064016106e1565b919091179080612166816138d7565b91505061204e565b50606554825110156109485760405162461bcd60e51b815260206004820152601d60248201527f5369676e6572733a207468726573686f6c64206973206e6f74206d657400000060448201526064016106e1565b6001600160a01b0381163b61222f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106e1565b600080516020613d4583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61226783612770565b6000825111806122745750805b1561070557610cf483836127b0565b6000818152600183016020526040812054801561236c5760006122a7600183613c51565b85549091506000906122bb90600190613c51565b90508181146123205760008660000182815481106122db576122db6138ab565b90600052602060002001549050808760000184815481106122fe576122fe6138ab565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233157612331613c68565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610665565b6000915050610665565b6040516001600160a01b03831660248201526044810182905261070590849063a9059cbb60e01b90606401611f57565b6060816000018054806020026020016040519081016040528092919081815260200182805480156123f657602002820191906000526020600020905b8154815260200190600101908083116123e2575b50505050509050919050565b6000612457826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127d59092919063ffffffff16565b80519091501561070557808060200190518101906124759190613c7e565b6107055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e1565b600081815260018301602052604081205461251b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610665565b506000610665565b60008082516041141561255a5760208301516040840151606085015160001a61254e878285856127ec565b9450945050505061258c565b82516040141561258457602083015160408401516125798683836128d9565b93509350505061258c565b506000905060025b9250929050565b60008160048111156125a7576125a7613c9b565b14156125b05750565b60018160048111156125c4576125c4613c9b565b14156126125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106e1565b600281600481111561262657612626613c9b565b14156126745760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106e1565b600381600481111561268857612688613c9b565b14156126e15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016106e1565b60048160048111156126f5576126f5613c9b565b14156108785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016106e1565b6001600160a01b03811660009081526001830160205260408120541515611bb7565b612779816121c2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611bb78383604051806060016040528060278152602001613d6560279139612912565b60606127e484846000856129ef565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561282357506000905060036128d0565b8460ff16601b1415801561283b57508460ff16601c14155b1561284c57506000905060046128d0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128c9576000600192509250506128d0565b9150600090505b94509492505050565b6000806001600160ff1b038316816128f660ff86901c601b613cb1565b9050612904878288856127ec565b935093505050935093915050565b60606001600160a01b0384163b61297a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106e1565b600080856001600160a01b0316856040516129959190613cf5565b600060405180830381855af49150503d80600081146129d0576040519150601f19603f3d011682016040523d82523d6000602084013e6129d5565b606091505b50915091506129e5828286612b20565b9695505050505050565b606082471015612a505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106e1565b6001600160a01b0385163b612aa75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e1565b600080866001600160a01b03168587604051612ac39190613cf5565b60006040518083038185875af1925050503d8060008114612b00576040519150601f19603f3d011682016040523d82523d6000602084013e612b05565b606091505b5091509150612b15828286612b20565b979650505050505050565b60608315612b2f575081611bb7565b825115612b3f5782518084602001fd5b8160405162461bcd60e51b81526004016106e19190613d11565b600060208284031215612b6b57600080fd5b81356001600160e01b031981168114611bb757600080fd5b60008060408385031215612b9657600080fd5b50508035926020909101359150565b60008083601f840112612bb757600080fd5b5081356001600160401b03811115612bce57600080fd5b6020830191508360208260051b850101111561258c57600080fd5b600080600060408486031215612bfe57600080fd5b83356001600160401b03811115612c1457600080fd5b612c2086828701612ba5565b909790965060209590950135949350505050565b80356001600160a01b0381168114611b9d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612c8957612c89612c4b565b604052919050565b600082601f830112612ca257600080fd5b81356001600160401b03811115612cbb57612cbb612c4b565b612cce601f8201601f1916602001612c61565b818152846020838601011115612ce357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612d1657600080fd5b612d1f85612c34565b9350612d2d60208601612c34565b92506040850135915060608501356001600160401b03811115612d4f57600080fd5b612d5b87828801612c91565b91505092959194509250565b60008060008060008060a08789031215612d8057600080fd5b86359550612d9060208801612c34565b9450604087013593506060870135925060808701356001600160401b03811115612db957600080fd5b612dc589828a01612ba5565b979a9699509497509295939492505050565b600080600080600060a08688031215612def57600080fd5b85359450612dff60208701612c34565b94979496505050506040830135926060810135926080909101359150565b600060208284031215612e2f57600080fd5b611bb782612c34565b60008060408385031215612e4b57600080fd5b612e5483612c34565b915060208301356001600160401b03811115612e6f57600080fd5b612e7b85828601612c91565b9150509250929050565b60008083601f840112612e9757600080fd5b5081356001600160401b03811115612eae57600080fd5b60208301915083602082850101111561258c57600080fd5b801515811461087857600080fd5b803561ffff81168114611b9d57600080fd5b600080600080600080600080600060e08a8c031215612f0457600080fd5b612f0d8a612c34565b985060208a0135975060408a0135965060608a01356001600160401b0380821115612f3757600080fd5b612f438d838e01612e85565b909850965060808c0135915080821115612f5c57600080fd5b50612f698c828d01612e85565b90955093505060a08a0135612f7d81612ec6565b9150612f8b60c08b01612ed4565b90509295985092959850929598565b6000806000806000806000806000806101008b8d031215612fba57600080fd5b612fc38b612c34565b995060208b01359850612fd860408c01612c34565b975060608b0135965060808b0135955060a08b01356001600160401b038082111561300257600080fd5b61300e8e838f01612e85565b909750955060c08d0135915061302382612ec6565b90935060e08c0135908082111561303957600080fd5b506130468d828e01612ba5565b915080935050809150509295989b9194979a5092959850565b6000806020838503121561307257600080fd5b82356001600160401b0381111561308857600080fd5b61309485828601612ba5565b90969095509350505050565b60008060008060008060008060c0898b0312156130bc57600080fd5b6130c589612c34565b97506020890135965060408901356001600160401b03808211156130e857600080fd5b6130f48c838d01612e85565b909850965060608b013591508082111561310d57600080fd5b5061311a8b828c01612e85565b909550935050608089013561312e81612ec6565b915061313c60a08a01612ed4565b90509295985092959890939650565b60008060008060006060868803121561316357600080fd5b85356001600160401b038082111561317a57600080fd5b61318689838a01612e85565b9097509550602088013591508082111561319f57600080fd5b506131ac88828901612e85565b90945092506131bf905060408701612ed4565b90509295509295909350565b60008060008060008060008060e0898b0312156131e757600080fd5b6131f089612c34565b97506020890135965061320560408a01612c34565b9550606089013594506080890135935060a089013561322381612ec6565b925060c08901356001600160401b0381111561323e57600080fd5b61324a8b828c01612ba5565b999c989b5096995094979396929594505050565b6020808252825182820181905260009190848201906040850190845b8181101561329f5783516001600160a01b03168352928401929184019160010161327a565b50909695505050505050565b600080600080600080600060e0888a0312156132c657600080fd5b6132cf88612c34565b9650602088013595506132e460408901612c34565b9450606088013593506080880135925060a0880135915060c088013561330981612ec6565b8091505092959891949750929550565b60006020828403121561332b57600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561335157600080fd5b61335a8a612c34565b985060208a0135975061336f60408b01612c34565b965060608a0135955060808a0135945060a08a0135935060c08a01356001600160401b0381111561339f57600080fd5b6133ab8c828d01612e85565b90945092505060e08a01356133bf81612ec6565b809150509295985092959850929598565b60008060008060008060008060008060006101208c8e0312156133f257600080fd5b6133fb8c612c34565b9a5060208c0135995060408c0135985061341760608d01612c34565b975060808c0135965060a08c013595506001600160401b038060c08e0135111561344057600080fd5b6134508e60c08f01358f01612e85565b909650945061346260e08e0135612ec6565b60e08d01359350806101008e0135111561347b57600080fd5b5061348d8d6101008e01358e01612ba5565b81935080925050509295989b509295989b9093969950565b6000806000806000806000806000806101208b8d0312156134c557600080fd5b6134ce8b612c34565b995060208b0135985060408b013597506134ea60608c01612c34565b965060808b0135955060a08b0135945060c08b0135935060e08b01356001600160401b0381111561351a57600080fd5b6135268d828e01612e85565b9094509250506101008b013561353b81612ec6565b809150509295989b9194979a5092959850565b600082601f83011261355f57600080fd5b813560206001600160401b0382111561357a5761357a612c4b565b8160051b613589828201612c61565b92835284810182019282810190878511156135a357600080fd5b83870192505b84831015612b15578235825291830191908301906135a9565b600080600080600060a086880312156135da57600080fd5b6135e386612c34565b94506135f160208701612c34565b935060408601356001600160401b038082111561360d57600080fd5b61361989838a0161354e565b9450606088013591508082111561362f57600080fd5b61363b89838a0161354e565b9350608088013591508082111561365157600080fd5b5061365e88828901612c91565b9150509295509295909350565b600080600080600060a0868803121561368357600080fd5b61368c86612c34565b945061369a60208701612c34565b9350604086013592506060860135915060808601356001600160401b038111156136c357600080fd5b61365e88828901612c91565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038a16815288602082015287604082015260e06060820152600061387660e08301888a61381f565b828103608084015261388981878961381f565b94151560a0840152505061ffff9190911660c090910152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156138eb576138eb6138c1565b5060010190565b60018060a01b038916815287602082015260c06040820152600061391a60c08301888a61381f565b828103606084015261392d81878961381f565b9415156080840152505061ffff9190911660a0909101529695505050505050565b86815260806020820152600061396860808301878961381f565b828103604084015261397b81868861381f565b91505061ffff83166060830152979650505050505050565b60006bffffffffffffffffffffffff19808c60601b1683528a6014840152808a60601b16603484015250876048830152866068830152856088830152838560a88401375090151560f81b910160a881019190915260a901979650505050505050565b60006bffffffffffffffffffffffff19808d60601b1683528b60148401528a6034840152808a60601b166054840152508760688301528660888301528560a8830152838560c88401375090151560f81b910160c881019190915260c90198975050505050505050565b6000808335601e19843603018112613a7557600080fd5b8301803591506001600160401b03821115613a8f57600080fd5b60200191503681900382131561258c57600080fd5b600060208284031215613ab657600080fd5b5051919050565b60018060a01b03851681528360208201526060604082015260006129e560608301848661381f565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60018060a01b0386168152846020820152836040820152608060608201526000612b1560808301848661381f565b600181815b80851115613b9c578160001904821115613b8257613b826138c1565b80851615613b8f57918102915b93841c9390800290613b66565b509250929050565b600082613bb357506001610665565b81613bc057506000610665565b8160018114613bd65760028114613be057613bfc565b6001915050610665565b60ff841115613bf157613bf16138c1565b50506001821b610665565b5060208310610133831016604e8410600b8410161715613c1f575081810a610665565b613c298383613b61565b8060001904821115613c3d57613c3d6138c1565b029392505050565b6000611bb78383613ba4565b600082821015613c6357613c636138c1565b500390565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613c9057600080fd5b8151611bb781612ec6565b634e487b7160e01b600052602160045260246000fd5b60008219821115613cc457613cc46138c1565b500190565b60005b83811015613ce4578181015183820152602001613ccc565b83811115610cf45750506000910152565b60008251613d07818460208701613cc9565b9190910192915050565b6020815260008251806020840152613d30816040850160208701613cc9565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207759de0aa8e40c61d23375e6ca6dd1ee308ebf35f6f530ed9ff4b61e664469e264736f6c63430008090033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

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