ETH Price: $2,437.06 (+1.46%)

Contract

0x327F25B05a291817fD10bab26053F0EB66c16158
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...209032682024-10-06 1:36:595 days ago1728178619IN
0x327F25B0...B66c16158
0 ETH0.000346917.47429792
Set Approval For...202556922024-07-07 16:01:1195 days ago1720368071IN
0x327F25B0...B66c16158
0 ETH0.000059832.43605865
Set Approval For...198264062024-05-08 16:03:23155 days ago1715184203IN
0x327F25B0...B66c16158
0 ETH0.000322016.93078104
Set Approval For...197697422024-04-30 17:53:23163 days ago1714499603IN
0x327F25B0...B66c16158
0 ETH0.000752416.1898977
Safe Transfer Fr...189176232024-01-02 5:27:11283 days ago1704173231IN
0x327F25B0...B66c16158
0 ETH0.0008210315.44277464
Safe Transfer Fr...189169732024-01-02 3:16:47283 days ago1704165407IN
0x327F25B0...B66c16158
0 ETH0.0007390313.90049523
Set Approval For...187501782023-12-09 17:32:59306 days ago1702143179IN
0x327F25B0...B66c16158
0 ETH0.0019210241.41032506
Set Approval For...187398722023-12-08 6:52:11308 days ago1702018331IN
0x327F25B0...B66c16158
0 ETH0.0018396939.65720549
Set Approval For...186066092023-11-19 15:00:35327 days ago1700406035IN
0x327F25B0...B66c16158
0 ETH0.0005159521.00636458
Set Approval For...183646832023-10-16 18:19:23360 days ago1697480363IN
0x327F25B0...B66c16158
0 ETH0.0003499614.29730417
Transfer From182733262023-10-03 23:37:59373 days ago1696376279IN
0x327F25B0...B66c16158
0 ETH0.000543268.06416457
Transfer From182402592023-09-29 8:43:47378 days ago1695977027IN
0x327F25B0...B66c16158
0 ETH0.000509057.55637972
Transfer From180204402023-08-29 13:02:11409 days ago1693314131IN
0x327F25B0...B66c16158
0 ETH0.0013053128.70844234
Transfer From180204372023-08-29 13:01:35409 days ago1693314095IN
0x327F25B0...B66c16158
0 ETH0.0013072926.00649125
Transfer From180203922023-08-29 12:52:35409 days ago1693313555IN
0x327F25B0...B66c16158
0 ETH0.0009561319.02071423
Transfer From180203672023-08-29 12:47:35409 days ago1693313255IN
0x327F25B0...B66c16158
0 ETH0.0011032821.9481498
Transfer From180203492023-08-29 12:43:59409 days ago1693313039IN
0x327F25B0...B66c16158
0 ETH0.0011762423.40506549
Transfer From180203262023-08-29 12:39:23409 days ago1693312763IN
0x327F25B0...B66c16158
0 ETH0.0011633623.14332809
Transfer From177584202023-07-23 21:13:11445 days ago1690146791IN
0x327F25B0...B66c16158
0 ETH0.0015170522.52295991
Set Approval For...172419722023-05-12 5:09:11518 days ago1683868151IN
0x327F25B0...B66c16158
0 ETH0.0026306256.70680329
Transfer From168319822023-03-15 8:01:11576 days ago1678867271IN
0x327F25B0...B66c16158
0 ETH0.0014147221
Set Approval For...168243582023-03-14 6:18:35577 days ago1678774715IN
0x327F25B0...B66c16158
0 ETH0.000395916.11861748
Safe Transfer Fr...167599192023-03-05 4:46:11586 days ago1677991571IN
0x327F25B0...B66c16158
0 ETH0.0009647818.1685976
Safe Transfer Fr...167599172023-03-05 4:45:47586 days ago1677991547IN
0x327F25B0...B66c16158
0 ETH0.0012508817.81831645
Safe Transfer Fr...167488792023-03-03 15:29:35588 days ago1677857375IN
0x327F25B0...B66c16158
0 ETH0.0019996430.57466489
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MyPunksFace

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : MyPunksFace.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./MyPunksItem.sol";
import "./ERC721A.sol";

/**
  __  ____   _____ _   _ _  _ _  _____ 
 |  \/  \ \ / / _ \ | | | \| | |/ / __|
 | |\/| |\ V /|  _/ |_| | .` | ' <\__ \
 |_|  |_| |_| |_|  \___/|_|\_|_|\_\___/
                                       
        Customize Your Own Punks                                        
 */

contract MyPunksFace is ERC721A, IERC721Receiver, AccessControl {
    using ECDSA for bytes32;
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    uint256 public immutable collectionSize;
    uint256 public immutable amountReserved;
    uint256 public reserveMinted;

    bool public stakingPaused;
    bool public mintingPaused;

    string private _currentBaseURI;

    address public itemContract;
    address public cSigner;
    address private owner;

    mapping(uint256 => uint256[]) private items;
    mapping(uint256 => string) public customNames;

    struct SaleConfig {
        uint32 saleStartTime;
        uint256 amountSale;
        uint256 amountMinted;
        uint256 maxClaim;
        bool isPublicSale;
    }

    SaleConfig public faceSale;

    constructor(
        uint256 maxBatchSize_,
        uint256 collectionSize_,
        uint256 amountReserved_,
        bool stakingPaused_,
        bool mintingPaused_,
        address cSigner_
    ) ERC721A("MyPunks Face", "MPFACE", maxBatchSize_) {
        collectionSize = collectionSize_;
        amountReserved = amountReserved_;
        stakingPaused = stakingPaused_;
        mintingPaused = mintingPaused_;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        cSigner = cSigner_;
        owner = msg.sender;
    }

    modifier mintable() {
        require(mintingPaused == false, "Mint is disabled");
        _;
    }

    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract");
        _;
    }

    /**
     * ======================================================================================
     *
     *  Token Minting
     *
     * ======================================================================================
     */

    function claimFace(bytes memory _signature) external mintable callerIsUser {
        uint256 saleStartTime = uint256(faceSale.saleStartTime);
        require(
            numberMinted(msg.sender) < faceSale.maxClaim,
            "You've already claimed, mate."
        );
        require(
            (faceSale.amountMinted < faceSale.amountSale) &&
                (totalSupply() < collectionSize),
            "Faces are all minted"
        );
        require(
            saleStartTime != 0 && saleStartTime <= block.timestamp,
            "Time Locked"
        );
        if (!faceSale.isPublicSale) {
            require(isMsgValid(_signature) == true, "Invalid Signature"); // Signed Whitelist Minting Only
        }
        _safeMint(msg.sender, 1);
        faceSale.amountMinted++;
    }

    /**
        @dev Reserved Token Minting
    */
    function mintReserved(address _to, uint256 _amount)
        external
        mintable
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(totalSupply() < collectionSize, "All Faces are minted");
        require(
            reserveMinted + _amount < amountReserved + 1,
            "Reserved are all minted"
        );
        _safeMint(_to, _amount);
        reserveMinted += _amount;
    }

    /**
        @dev This is used to plugin other contract to mint the item, eg. staking contract
    */
    function mintByMinter(address _to, uint256 _amount)
        external
        mintable
        onlyRole(MINTER_ROLE)
    {
        require(totalSupply() < collectionSize, "All Faces are minted");
        _safeMint(_to, _amount);
    }

    /**
     * ======================================================================================
     *
     *  Item Equipment and Staking
     *
     * ======================================================================================
     */

    function getOwnedTokens(address _address)
        external
        view
        returns (uint256[] memory)
    {
        uint256 balance = balanceOf(_address);
        uint256[] memory result = new uint256[](balance);
        for (uint256 i = 0; i < balance; i++) {
            result[i] = tokenOfOwnerByIndex(_address, i);
        }
        return result;
    }

    /**
     * @dev Receiver function to receive the NFT Tokens, and then added to item collection associated with Face Token Id
     * @param _from address of the stakeholder
     * @param _tokenId the token id
     * @return selector
     */
    function onERC721Received(
        address _from,
        address,
        uint256 _tokenId,
        bytes memory data
    ) public virtual override returns (bytes4) {
        // locate the face which the item should be put
        uint256 faceId = toUint256(data);
        require(msg.sender == itemContract, "Invalid ERC721 Transferred");
        require(
            ownerOf(faceId) == _from,
            "Invalid Staking. Face does not belongs to the staker."
        );
        items[faceId].push(_tokenId);
        return this.onERC721Received.selector;
    }

    /**
     * @dev Get staked items
     * @param _tokenId  The Face Token Id
     * @return array of staked token id
     */
    function stakedItems(uint256 _tokenId)
        public
        view
        returns (uint256[] memory)
    {
        return items[_tokenId];
    }

    /**
     * @dev Check if current user staked the item, and return the index of staked item
     * @notice if it returns an invalid index(eg. index > arr.length), then the item is absense in this array.
     * @notice we use this method because it can perform find and return the index within one operation.
     * @param _itemTokenId Mypunks Item Token Id
     * @param _faceTokenId Face Token Id
     * @return index of the token id, if no item present, return a invalid number
     */
    function isItemStaked(uint256 _itemTokenId, uint256 _faceTokenId)
        public
        view
        returns (uint256)
    {
        // Default value is invalid
        uint256 index = items[_faceTokenId].length + 1;

        for (uint256 i = 0; i < items[_faceTokenId].length; i++) {
            if (items[_faceTokenId][i] == _itemTokenId) {
                index = i;
            }
        }

        return index;
    }

    /**
     * @dev Remove an index from an array
     * @param _index item index
     * @param _faceTokenId the face token id
     */
    function remove(uint256 _index, uint256 _faceTokenId) private {
        // move array elements
        for (uint256 i = _index; i < items[_faceTokenId].length - 1; i++) {
            items[_faceTokenId][i] = items[_faceTokenId][i + 1];
        }
        // pop the last element
        items[_faceTokenId].pop();
    }

    /**
     * @dev Remove an index from an array
     * @param _itemTokenIds ids of item to withdraw
     * @param _faceTokenId id of face to withdraw from
     */
    function withdraw(uint256[] memory _itemTokenIds, uint256 _faceTokenId)
        public
    {
        require(stakingPaused == false, "Staking Paused");
        require(
            ownerOf(_faceTokenId) == msg.sender,
            "Unauthorized withdrawal. You must be the owner."
        );

        for (uint256 i = 0; i < _itemTokenIds.length; i++) {
            uint256 itemIndex = isItemStaked(_itemTokenIds[i], _faceTokenId);
            // Check if the item has staked by user
            require(
                itemIndex < items[_faceTokenId].length,
                "Invalid withdrawal. This face does not have the item."
            );
            // Remove the item from staking
            remove(itemIndex, _faceTokenId);
            MyPunksItem Item = MyPunksItem(itemContract);
            Item.unstakeItem(msg.sender, _itemTokenIds[i]);
        }
    }

    /**
     * ======================================================================================
     *
     *  Naming
     *
     * ======================================================================================
     */

    /**
        @dev Set a customized name of token. Caller must be the token owner.
    */
    function setName(uint256 _tokenId, string memory _customName) external {
        require(
            ownerOf(_tokenId) == msg.sender,
            "You're not authorized to set the name"
        );
        require(bytes(_customName).length <= 20, "Exceed Maximum Name Length");
        customNames[_tokenId] = _customName;
    }

    /**
     * ======================================================================================
     *
     *  Contract Configurations
     *
     * ======================================================================================
     */

    function setFaceSale(
        uint32 _saleStartTime,
        uint256 _amountSale,
        uint256 _amountMinted,
        uint256 _maxClaim,
        bool _isPublicSale
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(
            _amountSale <
                collectionSize - (faceSale.amountMinted + amountReserved) + 1,
            "Exceeding Sale Limit"
        );
        faceSale.amountSale = _amountSale;
        faceSale.amountMinted = _amountMinted;
        faceSale.saleStartTime = _saleStartTime;
        faceSale.maxClaim = _maxClaim;
        faceSale.isPublicSale = _isPublicSale;
    }

    function pauseMint(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        mintingPaused = _paused;
    }

    function pauseStaking(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        stakingPaused = _paused;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _currentBaseURI;
    }

    function setBaseURI(string memory _URI)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _currentBaseURI = _URI;
    }

    function setItemContract(address _address)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        itemContract = _address;
    }

    function setMinter(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) {
        grantRole(MINTER_ROLE, _address);
    }

    function numberMinted(address _owner) public view returns (uint256) {
        return _numberMinted(_owner);
    }

    function toUint256(bytes memory _bytes)
        internal
        pure
        returns (uint256 value)
    {
        assembly {
            value := mload(add(_bytes, 0x20))
        }
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721A, AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    function isMsgValid(bytes memory _signature) private view returns (bool) {
        bytes32 messageHash = keccak256(
            abi.encodePacked(address(this), msg.sender)
        );
        address signer = messageHash.toEthSignedMessageHash().recover(
            _signature
        );
        return cSigner == signer;
    }

    function setSigner(address _signer) external onlyRole(DEFAULT_ADMIN_ROLE) {
        cSigner = _signer;
    }
}

File 2 of 16 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 3 of 16 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 16 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 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 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));
    }
}

File 5 of 16 : MyPunksItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721A.sol";
import "./MyPunksFace.sol";

/**

  __  ____   _____ _   _ _  _ _  _____ 
 |  \/  \ \ / / _ \ | | | \| | |/ / __|
 | |\/| |\ V /|  _/ |_| | .` | ' <\__ \
 |_|  |_| |_| |_|  \___/|_|\_|_|\_\___/
                                       
        Customize Your Own Punks                                        

 */

contract MyPunksItem is ERC721A, AccessControl, ReentrancyGuard {
    // AccessControl
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    uint256 public immutable collectionSize;
    uint256 public immutable amountReserved;
    uint256 public reserveMinted;

    bool public stakingPaused;
    bool public mintingPaused;

    // Contract Configs
    string private _currentBaseURI;

    address public faceContract;
    address private owner;

    struct ItemSale {
        uint32 saleStartTime;
        uint64 price;
        uint256 amountSale;
        uint256 amountMinted;
        bool isPublicSale;
    }

    mapping(uint256 => ItemSale) public itemSales;
    uint256 public currentSaleRound;

    constructor(
        uint256 maxBatchSize_,
        uint256 collectionSize_,
        uint256 amountReserved_,
        bool stakingPaused_,
        bool mintingPaused_
    ) ERC721A("MyPunks Item", "MPITEM", maxBatchSize_) {
        collectionSize = collectionSize_;
        amountReserved = amountReserved_;
        stakingPaused = stakingPaused_;
        mintingPaused = mintingPaused_;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        owner = msg.sender;
    }

    modifier mintable() {
        require(mintingPaused == false, "Mint is disabled");
        _;
    }

    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract");
        _;
    }

    /**
     * ======================================================================================
     *
     *  Token Minting
     *
     * ======================================================================================
     */

    function mintItem(uint256 _amount) external payable mintable callerIsUser {
        ItemSale memory currentSale = itemSales[currentSaleRound];
        require(
            (currentSale.amountMinted < currentSale.amountSale) &&
                (totalSupply() < collectionSize),
            "Items are all minted"
        );
        require(
            currentSale.saleStartTime != 0 &&
                currentSale.saleStartTime <= block.timestamp,
            "Time Locked"
        );
        if (!currentSale.isPublicSale) {
            MyPunksFace Face = MyPunksFace(faceContract);
            require(
                Face.balanceOf(msg.sender) > 0,
                "You must own at least one face to mint"
            );
        }
        _safeMint(msg.sender, _amount);
        refundIfOver(currentSale.price * _amount);
        itemSales[currentSaleRound].amountMinted += _amount;
    }

    /**
        @dev Reserved Token Minting
    */
    function mintReserved(address _to, uint256 _amount)
        external
        mintable
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(totalSupply() < collectionSize, "All Items are minted");
        require(
            reserveMinted + _amount < amountReserved + 1,
            "Reserved are all minted"
        );
        _safeMint(_to, _amount);
        reserveMinted += _amount;
    }

    /**
        @dev This is used to plugin other contract to mint the item, eg. staking contract
    */
    function mintByMinter(address _to, uint256 _amount)
        external
        mintable
        onlyRole(MINTER_ROLE)
    {
        require(totalSupply() < collectionSize, "All Items are minted");
        _safeMint(_to, _amount);
    }

    function refundIfOver(uint256 _price) private {
        require(msg.value >= _price, "Need to send more ETH.");
        if (msg.value > _price) {
            payable(msg.sender).transfer(msg.value - _price);
        }
    }

    function getCurrentSale() external view returns (ItemSale memory) {
        return itemSales[currentSaleRound];
    }

    /**
     * ======================================================================================
     *
     *  Item Equippment (Staking)
     *
     * ======================================================================================
     */

    function getOwnedTokens(address _address)
        external
        view
        returns (uint256[] memory)
    {
        uint256 balance = balanceOf(_address);
        uint256[] memory result = new uint256[](balance);
        for (uint256 i = 0; i < balance; i++) {
            result[i] = tokenOfOwnerByIndex(_address, i);
        }
        return result;
    }

    function stakeItem(uint256[] memory _tokenIds, uint256 _faceId) external {
        require(stakingPaused == false, "Contract Paused");
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            bytes memory data = abi.encodePacked(_faceId);
            safeTransferFrom(msg.sender, faceContract, _tokenIds[i], data);
        }
    }

    function unstakeItem(address _to, uint256 _tokenId) external {
        require(stakingPaused == false, "Contract Paused");
        require(
            msg.sender == faceContract,
            "This method can only be called by Face Contract."
        );
        safeTransferFrom(msg.sender, _to, _tokenId);
    }

    /**
     * ======================================================================================
     *
     *  Contract Configurations & Overrides
     *
     * ======================================================================================
     */

    function setItemSale(
        uint256 _index,
        uint256 _amountSale,
        uint256 _amountMinted,
        uint64 _price,
        uint32 _saleStartTime,
        bool _isPublicSale
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        itemSales[_index].amountSale = _amountSale;
        itemSales[_index].amountMinted = _amountMinted;
        itemSales[_index].price = _price;
        itemSales[_index].saleStartTime = _saleStartTime;
        itemSales[_index].isPublicSale = _isPublicSale;
    }

    function pauseMint(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        mintingPaused = _paused;
    }

    function pauseStaking(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        stakingPaused = _paused;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _currentBaseURI;
    }

    function setBaseURI(string calldata _URI)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _currentBaseURI = _URI;
    }

    function setFaceContract(address _address)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        faceContract = _address;
    }

    function setMinter(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) {
        grantRole(MINTER_ROLE, _address);
    }

    function numberMinted(address _owner) external view returns (uint256) {
        return _numberMinted(_owner);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721A, AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    function withdrawMoney()
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
        nonReentrant
    {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        require(success, "Transfer failed.");
    }

}

File 6 of 16 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
 *
 * Does not support burning tokens to address(0).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    struct TokenOwnership {
        address addr;
        uint64 startTimestamp;
    }

    struct AddressData {
        uint128 balance;
        uint128 numberMinted;
    }

    uint256 private currentIndex = 0;

    uint256 internal immutable maxBatchSize;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) private _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;
    

    /**
     * @dev
     * `maxBatchSize` refers to how much a minter can mint at a time.
     */
    constructor(
        string memory name_,
        string memory symbol_,
        uint256 maxBatchSize_
    ) {
        require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
        _name = name_;
        _symbol = symbol_;
        maxBatchSize = maxBatchSize_;
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return currentIndex;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        require(index < totalSupply(), "ERC721A: global index out of bounds");
        return index;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
        uint256 numMintedSoFar = totalSupply();
        uint256 tokenIdsIdx = 0;
        address currOwnershipAddr = address(0);
        for (uint256 i = 0; i < numMintedSoFar; i++) {
            TokenOwnership memory ownership = _ownerships[i];
            if (ownership.addr != address(0)) {
                currOwnershipAddr = ownership.addr;
            }
            if (currOwnershipAddr == owner) {
                if (tokenIdsIdx == index) {
                    return i;
                }
                tokenIdsIdx++;
            }
        }
        revert("ERC721A: unable to get token of owner by index");
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), "ERC721A: balance query for the zero address");
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        require(owner != address(0), "ERC721A: number minted query for the zero address");
        return uint256(_addressData[owner].numberMinted);
    }

    function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        require(_exists(tokenId), "ERC721A: owner query for nonexistent token");

        uint256 lowestTokenToCheck;
        if (tokenId >= maxBatchSize) {
            lowestTokenToCheck = tokenId - maxBatchSize + 1;
        }

        for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
            TokenOwnership memory ownership = _ownerships[curr];
            if (ownership.addr != address(0)) {
                return ownership;
            }
        }

        revert("ERC721A: unable to determine the owner of token");
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        require(to != owner, "ERC721A: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721A: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), "ERC721A: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public override {
        require(operator != _msgSender(), "ERC721A: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public override {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, _data),
            "ERC721A: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return tokenId < currentIndex;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, "");
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` cannot be larger than the max batch size.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        uint256 startTokenId = currentIndex;
        require(to != address(0), "ERC721A: mint to the zero address");
        // We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
        require(!_exists(startTokenId), "ERC721A: token already minted");
        require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        AddressData memory addressData = _addressData[to];
        _addressData[to] = AddressData(
            addressData.balance + uint128(quantity),
            addressData.numberMinted + uint128(quantity)
        );
        _ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));

        uint256 updatedIndex = startTokenId;

        for (uint256 i = 0; i < quantity; i++) {
            emit Transfer(address(0), to, updatedIndex);
            require(
                _checkOnERC721Received(address(0), to, updatedIndex, _data),
                "ERC721A: transfer to non ERC721Receiver implementer"
            );
            updatedIndex++;
        }

        currentIndex = updatedIndex;
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            getApproved(tokenId) == _msgSender() ||
            isApprovedForAll(prevOwnership.addr, _msgSender()));

        require(isApprovedOrOwner, "ERC721A: transfer caller is not owner nor approved");

        require(prevOwnership.addr == from, "ERC721A: transfer from incorrect owner");
        require(to != address(0), "ERC721A: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, prevOwnership.addr);

        _addressData[from].balance -= 1;
        _addressData[to].balance += 1;
        _ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp));

        // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
        // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
        uint256 nextTokenId = tokenId + 1;
        if (_ownerships[nextTokenId].addr == address(0)) {
            if (_exists(nextTokenId)) {
                _ownerships[nextTokenId] = TokenOwnership(prevOwnership.addr, prevOwnership.startTimestamp);
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    uint256 public nextOwnerToExplicitlySet = 0;

    /**
     * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
     */
    function _setOwnersExplicit(uint256 quantity) internal {
        uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
        require(quantity > 0, "quantity must be nonzero");
        uint256 endIndex = oldNextOwnerToSet + quantity - 1;
        if (endIndex > currentIndex - 1) {
            endIndex = currentIndex - 1;
        }
        // We know if the last one in the group exists, all in the group exist, due to serial ordering.
        require(_exists(endIndex), "not enough minted yet for this cleanup");
        for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
            if (_ownerships[i].addr == address(0)) {
                TokenOwnership memory ownership = ownershipOf(i);
                _ownerships[i] = TokenOwnership(ownership.addr, ownership.startTimestamp);
            }
        }
        nextOwnerToExplicitlySet = endIndex + 1;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721A: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 7 of 16 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 8 of 16 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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 Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 9 of 16 : Strings.sol
// SPDX-License-Identifier: MIT

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

File 10 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT

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;
    }
}

File 11 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT

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

File 12 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 13 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT

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`, 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 14 of 16 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 15 of 16 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 16 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"maxBatchSize_","type":"uint256"},{"internalType":"uint256","name":"collectionSize_","type":"uint256"},{"internalType":"uint256","name":"amountReserved_","type":"uint256"},{"internalType":"bool","name":"stakingPaused_","type":"bool"},{"internalType":"bool","name":"mintingPaused_","type":"bool"},{"internalType":"address","name":"cSigner_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountReserved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"claimFace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collectionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"customNames","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"faceSale","outputs":[{"internalType":"uint32","name":"saleStartTime","type":"uint32"},{"internalType":"uint256","name":"amountSale","type":"uint256"},{"internalType":"uint256","name":"amountMinted","type":"uint256"},{"internalType":"uint256","name":"maxClaim","type":"uint256"},{"internalType":"bool","name":"isPublicSale","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getOwnedTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_itemTokenId","type":"uint256"},{"internalType":"uint256","name":"_faceTokenId","type":"uint256"}],"name":"isItemStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"itemContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintByMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintReserved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextOwnerToExplicitlySet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"pauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"pauseStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserveMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_URI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_saleStartTime","type":"uint32"},{"internalType":"uint256","name":"_amountSale","type":"uint256"},{"internalType":"uint256","name":"_amountMinted","type":"uint256"},{"internalType":"uint256","name":"_maxClaim","type":"uint256"},{"internalType":"bool","name":"_isPublicSale","type":"bool"}],"name":"setFaceSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setItemContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_customName","type":"string"}],"name":"setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"stakedItems","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_itemTokenIds","type":"uint256[]"},{"internalType":"uint256","name":"_faceTokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040526000805560006007553480156200001a57600080fd5b5060405162003ffe38038062003ffe8339810160408190526200003d91620002cd565b6040518060400160405280600c81526020016b4d7950756e6b73204661636560a01b815250604051806040016040528060068152602001654d504641434560d01b8152508760008111620000ae5760405162461bcd60e51b8152600401620000a59062000341565b60405180910390fd5b8251620000c390600190602086019062000211565b508151620000d990600290602085019062000211565b50608052505060a085905260c0849052600a805460ff19168415151761ff001916610100841515021790556200011160003362000146565b600d80546001600160a01b039092166001600160a01b0319928316179055600e80549091163317905550620003c59350505050565b62000152828262000156565b5050565b620001628282620001e2565b620001525760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200019e6200020d565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3390565b8280546200021f9062000388565b90600052602060002090601f0160209004810192826200024357600085556200028e565b82601f106200025e57805160ff19168380011785556200028e565b828001600101855582156200028e579182015b828111156200028e57825182559160200191906001019062000271565b506200029c929150620002a0565b5090565b5b808211156200029c5760008155600101620002a1565b80518015158114620002c857600080fd5b919050565b60008060008060008060c08789031215620002e6578182fd5b8651955060208701519450604087015193506200030660608801620002b7565b92506200031660808801620002b7565b60a08801519092506001600160a01b038116811462000333578182fd5b809150509295509295509295565b60208082526027908201527f455243373231413a206d61782062617463682073697a65206d757374206265206040820152666e6f6e7a65726f60c81b606082015260800190565b6002810460018216806200039d57607f821691505b60208210811415620003bf57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c051613bd16200042d60003960008181610d89015281816110e1015261143d015260008181610b2d01528181610bd801528181610d400152818161110c0152611337015260008181611c0401528181611c2e015261232f0152613bd16000f3fe608060405234801561001057600080fd5b50600436106102d65760003560e01c806385e5c0cb11610182578063d5391393116100e9578063e1a283d6116100a2578063f30e6e771161007c578063f30e6e7714610615578063fc89892814610628578063fca3b5aa1461063b578063fe55932a1461064e576102d6565b8063e1a283d6146105f2578063e985e9c5146105fa578063ea0d8da41461060d576102d6565b8063d539139314610596578063d547741f1461059e578063d7224ba0146105b1578063d9d61655146105b9578063dc33e681146105cc578063e0f4b193146105df576102d6565b8063a71204331161013b578063a71204331461052f578063b88d4fde14610542578063bbb781cc14610555578063c440e0111461055d578063c87b56dd14610570578063cef0e01f14610583576102d6565b806385e5c0cb146104d85780638d76f940146104f157806391d14854146104f957806395d89b411461050c578063a217fddf14610514578063a22cb4651461051c576102d6565b806336568abe1161024157806355f804b3116101fa5780636352211e116101d45780636352211e1461048c5780636c19e7831461049f57806370a08231146104b25780637de55fe1146104c5576102d6565b806355f804b31461045e5780635760cc5d146104715780635769848c14610479576102d6565b806336568abe1461040257806342842e0e1461041557806345c0f533146104285780634c81433f146104305780634f6ccce71461043857806352491d771461044b576102d6565b806318160ddd1161029357806318160ddd1461038e57806323b872dd1461039657806323de2a71146103a9578063248a9ca3146103c95780632f2ff15d146103dc5780632f745c59146103ef576102d6565b806301ffc9a7146102db57806306fdde0314610304578063081812fc14610319578063095ea7b3146103395780630b57df6f1461034e578063150b7a021461036e575b600080fd5b6102ee6102e9366004612be5565b610661565b6040516102fb9190612ee3565b60405180910390f35b61030c610674565b6040516102fb9190612f2a565b61032c610327366004612bab565b610706565b6040516102fb9190612e35565b61034c610347366004612abc565b610752565b005b61036161035c366004612c93565b6107eb565b6040516102fb9190612eee565b61038161037c366004612a2e565b610884565b6040516102fb9190612f15565b610361610929565b61034c6103a43660046129f3565b61092f565b6103bc6103b7366004612bab565b61093a565b6040516102fb9190612e9f565b6103616103d7366004612bab565b61099c565b61034c6103ea366004612bc3565b6109b1565b6103616103fd366004612abc565b6109d5565b61034c610410366004612bc3565b610aca565b61034c6104233660046129f3565b610b10565b610361610b2b565b610361610b4f565b610361610446366004612bab565b610b55565b61034c610459366004612abc565b610b81565b61034c61046c366004612c1d565b610c26565b61032c610c47565b61034c610487366004612b91565b610c56565b61032c61049a366004612bab565b610c78565b61034c6104ad3660046129a7565b610c8a565b6103616104c03660046129a7565b610cbb565b61034c6104d3366004612abc565b610d08565b6104e0610e00565b6040516102fb959493929190613994565b61032c610e1e565b6102ee610507366004612bc3565b610e2d565b61030c610e58565b610361610e67565b61034c61052a366004612a93565b610e6c565b61034c61053d3660046129a7565b610f3a565b61034c610550366004612a2e565b610f6b565b6102ee610fa4565b61030c61056b366004612bab565b610fad565b61030c61057e366004612bab565b611047565b61034c610591366004612cb4565b6110ca565b61036161119a565b61034c6105ac366004612bc3565b6111be565b6103616111dd565b6103bc6105c73660046129a7565b6111e3565b6103616105da3660046129a7565b6112a0565b61034c6105ed366004612c1d565b6112ab565b6102ee6113ff565b6102ee6106083660046129c1565b61140d565b61036161143b565b61034c610623366004612b91565b61145f565b61034c610636366004612ae5565b611488565b61034c6106493660046129a7565b6115fb565b61034c61065c366004612c4f565b611633565b600061066c826116a4565b90505b919050565b60606001805461068390613ad9565b80601f01602080910402602001604051908101604052809291908181526020018280546106af90613ad9565b80156106fc5780601f106106d1576101008083540402835291602001916106fc565b820191906000526020600020905b8154815290600101906020018083116106df57829003601f168201915b5050505050905090565b6000610711826116c9565b6107365760405162461bcd60e51b815260040161072d906138b6565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061075d82610c78565b9050806001600160a01b0316836001600160a01b031614156107915760405162461bcd60e51b815260040161072d906135d2565b806001600160a01b03166107a36116d0565b6001600160a01b031614806107bf57506107bf816106086116d0565b6107db5760405162461bcd60e51b815260040161072d906132af565b6107e68383836116d4565b505050565b6000818152600f60205260408120548190610807906001613a0c565b905060005b6000848152600f602052604090205481101561087a576000848152600f6020526040902080548691908390811061085357634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415610868578091505b8061087281613b14565b91505061080c565b5090505b92915050565b60008061089083611730565b600c549091506001600160a01b031633146108bd5760405162461bcd60e51b815260040161072d90613830565b856001600160a01b03166108d082610c78565b6001600160a01b0316146108f65760405162461bcd60e51b815260040161072d9061309a565b6000908152600f602090815260408220805460018101825590835291200183905550630a85bd0160e11b5b949350505050565b60005490565b6107e6838383611737565b6000818152600f602090815260409182902080548351818402810184019094528084526060939283018282801561099057602002820191906000526020600020905b81548152602001906001019080831161097c575b50505050509050919050565b60009081526008602052604090206001015490565b6109ba8261099c565b6109cb816109c66116d0565b611a49565b6107e68383611aad565b60006109e083610cbb565b82106109fe5760405162461bcd60e51b815260040161072d90612f74565b6000610a08610929565b905060008060005b83811015610ab1576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215610a6257805192505b876001600160a01b0316836001600160a01b03161415610a9e5786841415610a905750935061087e92505050565b83610a9a81613b14565b9450505b5080610aa981613b14565b915050610a10565b5060405162461bcd60e51b815260040161072d906137e2565b610ad26116d0565b6001600160a01b0316816001600160a01b031614610b025760405162461bcd60e51b815260040161072d90613945565b610b0c8282611b34565b5050565b6107e683838360405180602001604052806000815250610f6b565b7f000000000000000000000000000000000000000000000000000000000000000081565b60095481565b6000610b5f610929565b8210610b7d5760405162461bcd60e51b815260040161072d906130ef565b5090565b600a54610100900460ff1615610ba95760405162461bcd60e51b815260040161072d90613614565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610bd6816109c66116d0565b7f0000000000000000000000000000000000000000000000000000000000000000610bff610929565b10610c1c5760405162461bcd60e51b815260040161072d9061378f565b6107e68383611bb9565b6000610c34816109c66116d0565b81516107e690600b90602085019061286a565b600d546001600160a01b031681565b6000610c64816109c66116d0565b50600a805460ff1916911515919091179055565b6000610c8382611bd3565b5192915050565b6000610c98816109c66116d0565b50600d80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b038216610ce35760405162461bcd60e51b815260040161072d906133a7565b506001600160a01b03166000908152600460205260409020546001600160801b031690565b600a54610100900460ff1615610d305760405162461bcd60e51b815260040161072d90613614565b6000610d3e816109c66116d0565b7f0000000000000000000000000000000000000000000000000000000000000000610d67610929565b10610d845760405162461bcd60e51b815260040161072d9061378f565b610daf7f00000000000000000000000000000000000000000000000000000000000000006001613a0c565b82600954610dbd9190613a0c565b10610dda5760405162461bcd60e51b815260040161072d906136c8565b610de48383611bb9565b8160096000828254610df69190613a0c565b9091555050505050565b60115460125460135460145460155463ffffffff9094169360ff1685565b600c546001600160a01b031681565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461068390613ad9565b600081565b610e746116d0565b6001600160a01b0316826001600160a01b03161415610ea55760405162461bcd60e51b815260040161072d90613549565b8060066000610eb26116d0565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610ef66116d0565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610f2e9190612ee3565b60405180910390a35050565b6000610f48816109c66116d0565b50600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610f76848484611737565b610f8284848484611ce5565b610f9e5760405162461bcd60e51b815260040161072d9061363e565b50505050565b600a5460ff1681565b60106020526000908152604090208054610fc690613ad9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ff290613ad9565b801561103f5780601f106110145761010080835404028352916020019161103f565b820191906000526020600020905b81548152906001019060200180831161102257829003601f168201915b505050505081565b6060611052826116c9565b61106e5760405162461bcd60e51b815260040161072d906134fa565b6000611078611dfd565b9050600081511161109857604051806020016040528060008152506110c3565b806110a284611e0c565b6040516020016110b3929190612d60565b6040516020818303038152906040525b9392505050565b60006110d8816109c66116d0565b601354611106907f000000000000000000000000000000000000000000000000000000000000000090613a0c565b611130907f0000000000000000000000000000000000000000000000000000000000000000613a7f565b61113b906001613a0c565b85106111595760405162461bcd60e51b815260040161072d90613022565b506012939093556013919091556011805463ffffffff191663ffffffff94909416939093179092556014919091556015805460ff1916911515919091179055565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6111c78261099c565b6111d3816109c66116d0565b6107e68383611b34565b60075481565b606060006111f083610cbb565b90506000816001600160401b0381111561121a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611243578160200160208202803683370190505b50905060005b828110156112985761125b85826109d5565b82828151811061127b57634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061129081613b14565b915050611249565b509392505050565b600061066c82611f26565b600a54610100900460ff16156112d35760405162461bcd60e51b815260040161072d90613614565b3233146112f25760405162461bcd60e51b815260040161072d90613278565b60115460145463ffffffff9091169061130a336112a0565b106113275760405162461bcd60e51b815260040161072d9061320a565b60125460135410801561136057507f000000000000000000000000000000000000000000000000000000000000000061135e610929565b105b61137c5760405162461bcd60e51b815260040161072d90613379565b801580159061138b5750428111155b6113a75760405162461bcd60e51b815260040161072d906137bd565b60155460ff166113db576113ba82611f7a565b15156001146113db5760405162461bcd60e51b815260040161072d9061347a565b6113e6336001611bb9565b601380549060006113f683613b14565b91905055505050565b600a54610100900460ff1681565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000081565b600061146d816109c66116d0565b50600a80549115156101000261ff0019909216919091179055565b600a5460ff16156114ab5760405162461bcd60e51b815260040161072d9061330c565b336114b582610c78565b6001600160a01b0316146114db5760405162461bcd60e51b815260040161072d90613740565b60005b82518110156107e657600061151a84838151811061150c57634e487b7160e01b600052603260045260246000fd5b6020026020010151846107eb565b6000848152600f6020526040902054909150811061154a5760405162461bcd60e51b815260040161072d906134a5565b6115548184611fd6565b600c5484516001600160a01b03909116908190639744917190339088908790811061158f57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016115b4929190612e86565b600060405180830381600087803b1580156115ce57600080fd5b505af11580156115e2573d6000803e3d6000fd5b50505050505080806115f390613b14565b9150506114de565b6000611609816109c66116d0565b610b0c7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836109b1565b3361163d83610c78565b6001600160a01b0316146116635760405162461bcd60e51b815260040161072d90613334565b6014815111156116855760405162461bcd60e51b815260040161072d90613241565b600082815260106020908152604090912082516107e69284019061286a565b60006001600160e01b03198216637965db0b60e01b148061066c575061066c826120d2565b6000541190565b3390565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6020015190565b600061174282611bd3565b9050600081600001516001600160a01b031661175c6116d0565b6001600160a01b0316148061179157506117746116d0565b6001600160a01b031661178684610706565b6001600160a01b0316145b806117a5575081516117a5906106086116d0565b9050806117c45760405162461bcd60e51b815260040161072d90613580565b846001600160a01b031682600001516001600160a01b0316146117f95760405162461bcd60e51b815260040161072d90613434565b6001600160a01b03841661181f5760405162461bcd60e51b815260040161072d90613132565b61182c8585856001610f9e565b61183c60008484600001516116d4565b6001600160a01b038516600090815260046020526040812080546001929061186e9084906001600160801b0316613a57565b82546101009290920a6001600160801b038181021990931691831602179091556001600160a01b038616600090815260046020526040812080546001945090926118ba918591166139ea565b82546001600160801b039182166101009390930a9283029190920219909116179055506040805180820182526001600160a01b0380871682526001600160401b03428116602080850191825260008981526003909152948520935184549151909216600160a01b0267ffffffffffffffff60a01b19929093166001600160a01b0319909116171617905561194f846001613a0c565b6000818152600360205260409020549091506001600160a01b03166119f357611977816116c9565b156119f35760408051808201825284516001600160a01b0390811682526020808701516001600160401b0390811682850190815260008781526003909352949091209251835494516001600160a01b031990951692169190911767ffffffffffffffff60a01b1916600160a01b93909116929092029190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a418686866001610f9e565b505050505050565b611a538282610e2d565b610b0c57611a6b816001600160a01b0316601461212d565b611a7683602061212d565b604051602001611a87929190612dc0565b60408051601f198184030181529082905262461bcd60e51b825261072d91600401612f2a565b611ab78282610e2d565b610b0c5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611af06116d0565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611b3e8282610e2d565b15610b0c5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19169055611b756116d0565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b610b0c8282604051806020016040528060008152506122de565b611bdb6128ea565b611be4826116c9565b611c005760405162461bcd60e51b815260040161072d90613050565b60007f00000000000000000000000000000000000000000000000000000000000000008310611c6157611c537f000000000000000000000000000000000000000000000000000000000000000084613a7f565b611c5e906001613a0c565b90505b825b818110611ccc576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215611cb957925061066f915050565b5080611cc481613ac2565b915050611c63565b5060405162461bcd60e51b815260040161072d90613867565b6000611cf9846001600160a01b0316612550565b15611df557836001600160a01b031663150b7a02611d156116d0565b8786866040518563ffffffff1660e01b8152600401611d379493929190612e49565b602060405180830381600087803b158015611d5157600080fd5b505af1925050508015611d81575060408051601f3d908101601f19168201909252611d7e91810190612c01565b60015b611ddb573d808015611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b508051611dd35760405162461bcd60e51b815260040161072d9061363e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610921565b506001610921565b6060600b805461068390613ad9565b606081611e3157506040805180820190915260018152600360fc1b602082015261066f565b8160005b8115611e5b5780611e4581613b14565b9150611e549050600a83613a24565b9150611e35565b6000816001600160401b03811115611e8357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611ead576020820181803683370190505b5090505b841561092157611ec2600183613a7f565b9150611ecf600a86613b2f565b611eda906030613a0c565b60f81b818381518110611efd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611f1f600a86613a24565b9450611eb1565b60006001600160a01b038216611f4e5760405162461bcd60e51b815260040161072d90613177565b506001600160a01b0316600090815260046020526040902054600160801b90046001600160801b031690565b6000803033604051602001611f90929190612d39565b6040516020818303038152906040528051906020012090506000611fbd84611fb784612556565b90612586565b600d546001600160a01b03918216911614949350505050565b815b6000828152600f6020526040902054611ff390600190613a7f565b81101561208c576000828152600f60205260409020612013826001613a0c565b8154811061203157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154600f6000848152602001908152602001600020828154811061206e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001558061208481613b14565b915050611fd8565b506000818152600f602052604090208054806120b857634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590555050565b60006001600160e01b031982166380ac58cd60e01b148061210357506001600160e01b03198216635b5e139f60e01b145b8061211e57506001600160e01b0319821663780e9d6360e01b145b8061066c575061066c826125a2565b6060600061213c836002613a38565b612147906002613a0c565b6001600160401b0381111561216c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612196576020820181803683370190505b509050600360fc1b816000815181106121bf57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106121fc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612220846002613a38565b61222b906001613a0c565b90505b60018111156122bf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061226d57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061229157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936122b881613ac2565b905061222e565b5083156110c35760405162461bcd60e51b815260040161072d90612fb6565b6000546001600160a01b0384166123075760405162461bcd60e51b815260040161072d906136ff565b612310816116c9565b1561232d5760405162461bcd60e51b815260040161072d90613691565b7f000000000000000000000000000000000000000000000000000000000000000083111561236d5760405162461bcd60e51b815260040161072d90613903565b61237a6000858386610f9e565b6001600160a01b0384166000908152600460209081526040918290208251808401845290546001600160801b038082168352600160801b90910416918101919091528151808301909252805190919081906123d69087906139ea565b6001600160801b031681526020018583602001516123f491906139ea565b6001600160801b039081169091526001600160a01b03808816600081815260046020908152604080832087518154988401518816600160801b029088166fffffffffffffffffffffffffffffffff199099169890981790961696909617909455845180860186529182526001600160401b034281168386019081528883526003909552948120915182549451909516600160a01b0267ffffffffffffffff60a01b19959093166001600160a01b031990941693909317939093161790915582905b8581101561253e5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46125026000888488611ce5565b61251e5760405162461bcd60e51b815260040161072d9061363e565b8161252881613b14565b925050808061253690613b14565b9150506124b5565b506000818155611a4190878588610f9e565b3b151590565b6000816040516020016125699190612d8f565b604051602081830303815290604052805190602001209050919050565b600080600061259585856125bb565b9150915061087a8161262b565b6001600160e01b031981166301ffc9a760e01b14919050565b6000808251604114156125f25760208301516040840151606085015160001a6125e68782858561275b565b94509450505050612624565b82516040141561261c576020830151604084015161261186838361283b565b935093505050612624565b506000905060025b9250929050565b600081600481111561264d57634e487b7160e01b600052602160045260246000fd5b141561265857612758565b600181600481111561267a57634e487b7160e01b600052602160045260246000fd5b14156126985760405162461bcd60e51b815260040161072d90612f3d565b60028160048111156126ba57634e487b7160e01b600052602160045260246000fd5b14156126d85760405162461bcd60e51b815260040161072d90612feb565b60038160048111156126fa57634e487b7160e01b600052602160045260246000fd5b14156127185760405162461bcd60e51b815260040161072d906131c8565b600481600481111561273a57634e487b7160e01b600052602160045260246000fd5b14156127585760405162461bcd60e51b815260040161072d906133f2565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156127925750600090506003612832565b8460ff16601b141580156127aa57508460ff16601c14155b156127bb5750600090506004612832565b6000600187878787604051600081526020016040526040516127e09493929190612ef7565b6020604051602081039080840390855afa158015612802573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661282b57600060019250925050612832565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161285c8782888561275b565b935093505050935093915050565b82805461287690613ad9565b90600052602060002090601f01602090048101928261289857600085556128de565b82601f106128b157805160ff19168380011785556128de565b828001600101855582156128de579182015b828111156128de5782518255916020019190600101906128c3565b50610b7d929150612901565b604080518082019091526000808252602082015290565b5b80821115610b7d5760008155600101612902565b80356001600160a01b038116811461066f57600080fd5b8035801515811461066f57600080fd5b600082601f83011261294d578081fd5b81356001600160401b0381111561296657612966613b6f565b612979601f8201601f19166020016139c1565b81815284602083860101111561298d578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156129b8578081fd5b6110c382612916565b600080604083850312156129d3578081fd5b6129dc83612916565b91506129ea60208401612916565b90509250929050565b600080600060608486031215612a07578081fd5b612a1084612916565b9250612a1e60208501612916565b9150604084013590509250925092565b60008060008060808587031215612a43578081fd5b612a4c85612916565b9350612a5a60208601612916565b92506040850135915060608501356001600160401b03811115612a7b578182fd5b612a878782880161293d565b91505092959194509250565b60008060408385031215612aa5578182fd5b612aae83612916565b91506129ea6020840161292d565b60008060408385031215612ace578182fd5b612ad783612916565b946020939093013593505050565b60008060408385031215612af7578182fd5b82356001600160401b0380821115612b0d578384fd5b818501915085601f830112612b20578384fd5b8135602082821115612b3457612b34613b6f565b8082029250612b448184016139c1565b8281528181019085830185870184018b1015612b5e578889fd5b8896505b84871015612b80578035835260019690960195918301918301612b62565b509997909101359750505050505050565b600060208284031215612ba2578081fd5b6110c38261292d565b600060208284031215612bbc578081fd5b5035919050565b60008060408385031215612bd5578182fd5b823591506129ea60208401612916565b600060208284031215612bf6578081fd5b81356110c381613b85565b600060208284031215612c12578081fd5b81516110c381613b85565b600060208284031215612c2e578081fd5b81356001600160401b03811115612c43578182fd5b6109218482850161293d565b60008060408385031215612c61578182fd5b8235915060208301356001600160401b03811115612c7d578182fd5b612c898582860161293d565b9150509250929050565b60008060408385031215612ca5578182fd5b50508035926020909101359150565b600080600080600060a08688031215612ccb578283fd5b853563ffffffff81168114612cde578384fd5b9450602086013593506040860135925060608601359150612d016080870161292d565b90509295509295909350565b60008151808452612d25816020860160208601613a96565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff19606093841b811682529190921b16601482015260280190565b60008351612d72818460208801613a96565b835190830190612d86818360208801613a96565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612df8816017850160208801613a96565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612e29816028840160208801613a96565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e7c90830184612d0d565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015612ed757835183529284019291840191600101612ebb565b50909695505050505050565b901515815260200190565b90815260200190565b93845260ff9290921660208401526040830152606082015260800190565b6001600160e01b031991909116815260200190565b6000602082526110c36020830184612d0d565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b60208082526022908201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252601f908201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604082015260600190565b602080825260149082015273115e18d959591a5b99c814d85b1948131a5b5a5d60621b604082015260600190565b6020808252602a908201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736040820152693a32b73a103a37b5b2b760b11b606082015260800190565b60208082526035908201527f496e76616c6964205374616b696e672e204661636520646f6573206e6f74206260408201527432b637b733b9903a37903a34329039ba30b5b2b91760591b606082015260800190565b60208082526023908201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756040820152626e647360e81b606082015260800190565b60208082526025908201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526031908201527f455243373231413a206e756d626572206d696e74656420717565727920666f7260408201527020746865207a65726f206164647265737360781b606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604082015261756560f01b606082015260800190565b6020808252601d908201527f596f7527766520616c726561647920636c61696d65642c206d6174652e000000604082015260600190565b6020808252601a908201527f457863656564204d6178696d756d204e616d65204c656e677468000000000000604082015260600190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b60208082526039908201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000606082015260800190565b6020808252600e908201526d14dd185ada5b99c814185d5cd95960921b604082015260600190565b60208082526025908201527f596f75277265206e6f7420617574686f72697a656420746f2073657420746865604082015264206e616d6560d81b606082015260800190565b602080825260149082015273119858d95cc8185c9948185b1b081b5a5b9d195960621b604082015260600190565b6020808252602b908201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60408201526a65726f206164647265737360a81b606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604082015261756560f01b606082015260800190565b60208082526026908201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746040820152651037bbb732b960d11b606082015260800190565b602080825260119082015270496e76616c6964205369676e617475726560781b604082015260600190565b60208082526035908201527f496e76616c6964207769746864726177616c2e2054686973206661636520646f60408201527432b9903737ba103430bb32903a34329034ba32b69760591b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b6020808252601a908201527f455243373231413a20617070726f766520746f2063616c6c6572000000000000604082015260600190565b60208082526032908201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b60208082526022908201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b60208082526010908201526f135a5b9d081a5cc8191a5cd8589b195960821b604082015260600190565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b6020808252601d908201527f455243373231413a20746f6b656e20616c7265616479206d696e746564000000604082015260600190565b60208082526017908201527f52657365727665642061726520616c6c206d696e746564000000000000000000604082015260600190565b60208082526021908201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252602f908201527f556e617574686f72697a6564207769746864726177616c2e20596f75206d757360408201526e3a103132903a34329037bbb732b91760891b606082015260800190565b602080825260149082015273105b1b08119858d95cc8185c99481b5a5b9d195960621b604082015260600190565b6020808252600b908201526a151a5b5948131bd8dad95960aa1b604082015260600190565b6020808252602e908201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060408201526d0deeedccae440c4f240d2dcc8caf60931b606082015260800190565b6020808252601a908201527f496e76616c696420455243373231205472616e73666572726564000000000000604082015260600190565b6020808252602f908201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560408201526e1037bbb732b91037b3103a37b5b2b760891b606082015260800190565b6020808252602d908201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560408201526c3c34b9ba32b73a103a37b5b2b760991b606082015260800190565b60208082526022908201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696040820152610ced60f31b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b63ffffffff9590951685526020850193909352604084019190915260608301521515608082015260a00190565b6040518181016001600160401b03811182821017156139e2576139e2613b6f565b604052919050565b60006001600160801b03808316818516808303821115612d8657612d86613b43565b60008219821115613a1f57613a1f613b43565b500190565b600082613a3357613a33613b59565b500490565b6000816000190483118215151615613a5257613a52613b43565b500290565b60006001600160801b0383811690831681811015613a7757613a77613b43565b039392505050565b600082821015613a9157613a91613b43565b500390565b60005b83811015613ab1578181015183820152602001613a99565b83811115610f9e5750506000910152565b600081613ad157613ad1613b43565b506000190190565b600281046001821680613aed57607f821691505b60208210811415613b0e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613b2857613b28613b43565b5060010190565b600082613b3e57613b3e613b59565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461275857600080fdfea264697066735822122095d1d46b6d778d495af8c66a6799e95d140ba26cfc094f79b652a769333e291f64736f6c634300080000330000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000270f00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab0fa36e0c5d9a386cbe369ffa123c731194b2de

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102d65760003560e01c806385e5c0cb11610182578063d5391393116100e9578063e1a283d6116100a2578063f30e6e771161007c578063f30e6e7714610615578063fc89892814610628578063fca3b5aa1461063b578063fe55932a1461064e576102d6565b8063e1a283d6146105f2578063e985e9c5146105fa578063ea0d8da41461060d576102d6565b8063d539139314610596578063d547741f1461059e578063d7224ba0146105b1578063d9d61655146105b9578063dc33e681146105cc578063e0f4b193146105df576102d6565b8063a71204331161013b578063a71204331461052f578063b88d4fde14610542578063bbb781cc14610555578063c440e0111461055d578063c87b56dd14610570578063cef0e01f14610583576102d6565b806385e5c0cb146104d85780638d76f940146104f157806391d14854146104f957806395d89b411461050c578063a217fddf14610514578063a22cb4651461051c576102d6565b806336568abe1161024157806355f804b3116101fa5780636352211e116101d45780636352211e1461048c5780636c19e7831461049f57806370a08231146104b25780637de55fe1146104c5576102d6565b806355f804b31461045e5780635760cc5d146104715780635769848c14610479576102d6565b806336568abe1461040257806342842e0e1461041557806345c0f533146104285780634c81433f146104305780634f6ccce71461043857806352491d771461044b576102d6565b806318160ddd1161029357806318160ddd1461038e57806323b872dd1461039657806323de2a71146103a9578063248a9ca3146103c95780632f2ff15d146103dc5780632f745c59146103ef576102d6565b806301ffc9a7146102db57806306fdde0314610304578063081812fc14610319578063095ea7b3146103395780630b57df6f1461034e578063150b7a021461036e575b600080fd5b6102ee6102e9366004612be5565b610661565b6040516102fb9190612ee3565b60405180910390f35b61030c610674565b6040516102fb9190612f2a565b61032c610327366004612bab565b610706565b6040516102fb9190612e35565b61034c610347366004612abc565b610752565b005b61036161035c366004612c93565b6107eb565b6040516102fb9190612eee565b61038161037c366004612a2e565b610884565b6040516102fb9190612f15565b610361610929565b61034c6103a43660046129f3565b61092f565b6103bc6103b7366004612bab565b61093a565b6040516102fb9190612e9f565b6103616103d7366004612bab565b61099c565b61034c6103ea366004612bc3565b6109b1565b6103616103fd366004612abc565b6109d5565b61034c610410366004612bc3565b610aca565b61034c6104233660046129f3565b610b10565b610361610b2b565b610361610b4f565b610361610446366004612bab565b610b55565b61034c610459366004612abc565b610b81565b61034c61046c366004612c1d565b610c26565b61032c610c47565b61034c610487366004612b91565b610c56565b61032c61049a366004612bab565b610c78565b61034c6104ad3660046129a7565b610c8a565b6103616104c03660046129a7565b610cbb565b61034c6104d3366004612abc565b610d08565b6104e0610e00565b6040516102fb959493929190613994565b61032c610e1e565b6102ee610507366004612bc3565b610e2d565b61030c610e58565b610361610e67565b61034c61052a366004612a93565b610e6c565b61034c61053d3660046129a7565b610f3a565b61034c610550366004612a2e565b610f6b565b6102ee610fa4565b61030c61056b366004612bab565b610fad565b61030c61057e366004612bab565b611047565b61034c610591366004612cb4565b6110ca565b61036161119a565b61034c6105ac366004612bc3565b6111be565b6103616111dd565b6103bc6105c73660046129a7565b6111e3565b6103616105da3660046129a7565b6112a0565b61034c6105ed366004612c1d565b6112ab565b6102ee6113ff565b6102ee6106083660046129c1565b61140d565b61036161143b565b61034c610623366004612b91565b61145f565b61034c610636366004612ae5565b611488565b61034c6106493660046129a7565b6115fb565b61034c61065c366004612c4f565b611633565b600061066c826116a4565b90505b919050565b60606001805461068390613ad9565b80601f01602080910402602001604051908101604052809291908181526020018280546106af90613ad9565b80156106fc5780601f106106d1576101008083540402835291602001916106fc565b820191906000526020600020905b8154815290600101906020018083116106df57829003601f168201915b5050505050905090565b6000610711826116c9565b6107365760405162461bcd60e51b815260040161072d906138b6565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061075d82610c78565b9050806001600160a01b0316836001600160a01b031614156107915760405162461bcd60e51b815260040161072d906135d2565b806001600160a01b03166107a36116d0565b6001600160a01b031614806107bf57506107bf816106086116d0565b6107db5760405162461bcd60e51b815260040161072d906132af565b6107e68383836116d4565b505050565b6000818152600f60205260408120548190610807906001613a0c565b905060005b6000848152600f602052604090205481101561087a576000848152600f6020526040902080548691908390811061085357634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415610868578091505b8061087281613b14565b91505061080c565b5090505b92915050565b60008061089083611730565b600c549091506001600160a01b031633146108bd5760405162461bcd60e51b815260040161072d90613830565b856001600160a01b03166108d082610c78565b6001600160a01b0316146108f65760405162461bcd60e51b815260040161072d9061309a565b6000908152600f602090815260408220805460018101825590835291200183905550630a85bd0160e11b5b949350505050565b60005490565b6107e6838383611737565b6000818152600f602090815260409182902080548351818402810184019094528084526060939283018282801561099057602002820191906000526020600020905b81548152602001906001019080831161097c575b50505050509050919050565b60009081526008602052604090206001015490565b6109ba8261099c565b6109cb816109c66116d0565b611a49565b6107e68383611aad565b60006109e083610cbb565b82106109fe5760405162461bcd60e51b815260040161072d90612f74565b6000610a08610929565b905060008060005b83811015610ab1576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215610a6257805192505b876001600160a01b0316836001600160a01b03161415610a9e5786841415610a905750935061087e92505050565b83610a9a81613b14565b9450505b5080610aa981613b14565b915050610a10565b5060405162461bcd60e51b815260040161072d906137e2565b610ad26116d0565b6001600160a01b0316816001600160a01b031614610b025760405162461bcd60e51b815260040161072d90613945565b610b0c8282611b34565b5050565b6107e683838360405180602001604052806000815250610f6b565b7f000000000000000000000000000000000000000000000000000000000000270f81565b60095481565b6000610b5f610929565b8210610b7d5760405162461bcd60e51b815260040161072d906130ef565b5090565b600a54610100900460ff1615610ba95760405162461bcd60e51b815260040161072d90613614565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610bd6816109c66116d0565b7f000000000000000000000000000000000000000000000000000000000000270f610bff610929565b10610c1c5760405162461bcd60e51b815260040161072d9061378f565b6107e68383611bb9565b6000610c34816109c66116d0565b81516107e690600b90602085019061286a565b600d546001600160a01b031681565b6000610c64816109c66116d0565b50600a805460ff1916911515919091179055565b6000610c8382611bd3565b5192915050565b6000610c98816109c66116d0565b50600d80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b038216610ce35760405162461bcd60e51b815260040161072d906133a7565b506001600160a01b03166000908152600460205260409020546001600160801b031690565b600a54610100900460ff1615610d305760405162461bcd60e51b815260040161072d90613614565b6000610d3e816109c66116d0565b7f000000000000000000000000000000000000000000000000000000000000270f610d67610929565b10610d845760405162461bcd60e51b815260040161072d9061378f565b610daf7f00000000000000000000000000000000000000000000000000000000000000c86001613a0c565b82600954610dbd9190613a0c565b10610dda5760405162461bcd60e51b815260040161072d906136c8565b610de48383611bb9565b8160096000828254610df69190613a0c565b9091555050505050565b60115460125460135460145460155463ffffffff9094169360ff1685565b600c546001600160a01b031681565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461068390613ad9565b600081565b610e746116d0565b6001600160a01b0316826001600160a01b03161415610ea55760405162461bcd60e51b815260040161072d90613549565b8060066000610eb26116d0565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610ef66116d0565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610f2e9190612ee3565b60405180910390a35050565b6000610f48816109c66116d0565b50600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610f76848484611737565b610f8284848484611ce5565b610f9e5760405162461bcd60e51b815260040161072d9061363e565b50505050565b600a5460ff1681565b60106020526000908152604090208054610fc690613ad9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ff290613ad9565b801561103f5780601f106110145761010080835404028352916020019161103f565b820191906000526020600020905b81548152906001019060200180831161102257829003601f168201915b505050505081565b6060611052826116c9565b61106e5760405162461bcd60e51b815260040161072d906134fa565b6000611078611dfd565b9050600081511161109857604051806020016040528060008152506110c3565b806110a284611e0c565b6040516020016110b3929190612d60565b6040516020818303038152906040525b9392505050565b60006110d8816109c66116d0565b601354611106907f00000000000000000000000000000000000000000000000000000000000000c890613a0c565b611130907f000000000000000000000000000000000000000000000000000000000000270f613a7f565b61113b906001613a0c565b85106111595760405162461bcd60e51b815260040161072d90613022565b506012939093556013919091556011805463ffffffff191663ffffffff94909416939093179092556014919091556015805460ff1916911515919091179055565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6111c78261099c565b6111d3816109c66116d0565b6107e68383611b34565b60075481565b606060006111f083610cbb565b90506000816001600160401b0381111561121a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611243578160200160208202803683370190505b50905060005b828110156112985761125b85826109d5565b82828151811061127b57634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061129081613b14565b915050611249565b509392505050565b600061066c82611f26565b600a54610100900460ff16156112d35760405162461bcd60e51b815260040161072d90613614565b3233146112f25760405162461bcd60e51b815260040161072d90613278565b60115460145463ffffffff9091169061130a336112a0565b106113275760405162461bcd60e51b815260040161072d9061320a565b60125460135410801561136057507f000000000000000000000000000000000000000000000000000000000000270f61135e610929565b105b61137c5760405162461bcd60e51b815260040161072d90613379565b801580159061138b5750428111155b6113a75760405162461bcd60e51b815260040161072d906137bd565b60155460ff166113db576113ba82611f7a565b15156001146113db5760405162461bcd60e51b815260040161072d9061347a565b6113e6336001611bb9565b601380549060006113f683613b14565b91905055505050565b600a54610100900460ff1681565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b7f00000000000000000000000000000000000000000000000000000000000000c881565b600061146d816109c66116d0565b50600a80549115156101000261ff0019909216919091179055565b600a5460ff16156114ab5760405162461bcd60e51b815260040161072d9061330c565b336114b582610c78565b6001600160a01b0316146114db5760405162461bcd60e51b815260040161072d90613740565b60005b82518110156107e657600061151a84838151811061150c57634e487b7160e01b600052603260045260246000fd5b6020026020010151846107eb565b6000848152600f6020526040902054909150811061154a5760405162461bcd60e51b815260040161072d906134a5565b6115548184611fd6565b600c5484516001600160a01b03909116908190639744917190339088908790811061158f57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016115b4929190612e86565b600060405180830381600087803b1580156115ce57600080fd5b505af11580156115e2573d6000803e3d6000fd5b50505050505080806115f390613b14565b9150506114de565b6000611609816109c66116d0565b610b0c7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836109b1565b3361163d83610c78565b6001600160a01b0316146116635760405162461bcd60e51b815260040161072d90613334565b6014815111156116855760405162461bcd60e51b815260040161072d90613241565b600082815260106020908152604090912082516107e69284019061286a565b60006001600160e01b03198216637965db0b60e01b148061066c575061066c826120d2565b6000541190565b3390565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6020015190565b600061174282611bd3565b9050600081600001516001600160a01b031661175c6116d0565b6001600160a01b0316148061179157506117746116d0565b6001600160a01b031661178684610706565b6001600160a01b0316145b806117a5575081516117a5906106086116d0565b9050806117c45760405162461bcd60e51b815260040161072d90613580565b846001600160a01b031682600001516001600160a01b0316146117f95760405162461bcd60e51b815260040161072d90613434565b6001600160a01b03841661181f5760405162461bcd60e51b815260040161072d90613132565b61182c8585856001610f9e565b61183c60008484600001516116d4565b6001600160a01b038516600090815260046020526040812080546001929061186e9084906001600160801b0316613a57565b82546101009290920a6001600160801b038181021990931691831602179091556001600160a01b038616600090815260046020526040812080546001945090926118ba918591166139ea565b82546001600160801b039182166101009390930a9283029190920219909116179055506040805180820182526001600160a01b0380871682526001600160401b03428116602080850191825260008981526003909152948520935184549151909216600160a01b0267ffffffffffffffff60a01b19929093166001600160a01b0319909116171617905561194f846001613a0c565b6000818152600360205260409020549091506001600160a01b03166119f357611977816116c9565b156119f35760408051808201825284516001600160a01b0390811682526020808701516001600160401b0390811682850190815260008781526003909352949091209251835494516001600160a01b031990951692169190911767ffffffffffffffff60a01b1916600160a01b93909116929092029190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a418686866001610f9e565b505050505050565b611a538282610e2d565b610b0c57611a6b816001600160a01b0316601461212d565b611a7683602061212d565b604051602001611a87929190612dc0565b60408051601f198184030181529082905262461bcd60e51b825261072d91600401612f2a565b611ab78282610e2d565b610b0c5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611af06116d0565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611b3e8282610e2d565b15610b0c5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19169055611b756116d0565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b610b0c8282604051806020016040528060008152506122de565b611bdb6128ea565b611be4826116c9565b611c005760405162461bcd60e51b815260040161072d90613050565b60007f00000000000000000000000000000000000000000000000000000000000000028310611c6157611c537f000000000000000000000000000000000000000000000000000000000000000284613a7f565b611c5e906001613a0c565b90505b825b818110611ccc576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215611cb957925061066f915050565b5080611cc481613ac2565b915050611c63565b5060405162461bcd60e51b815260040161072d90613867565b6000611cf9846001600160a01b0316612550565b15611df557836001600160a01b031663150b7a02611d156116d0565b8786866040518563ffffffff1660e01b8152600401611d379493929190612e49565b602060405180830381600087803b158015611d5157600080fd5b505af1925050508015611d81575060408051601f3d908101601f19168201909252611d7e91810190612c01565b60015b611ddb573d808015611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b508051611dd35760405162461bcd60e51b815260040161072d9061363e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610921565b506001610921565b6060600b805461068390613ad9565b606081611e3157506040805180820190915260018152600360fc1b602082015261066f565b8160005b8115611e5b5780611e4581613b14565b9150611e549050600a83613a24565b9150611e35565b6000816001600160401b03811115611e8357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611ead576020820181803683370190505b5090505b841561092157611ec2600183613a7f565b9150611ecf600a86613b2f565b611eda906030613a0c565b60f81b818381518110611efd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611f1f600a86613a24565b9450611eb1565b60006001600160a01b038216611f4e5760405162461bcd60e51b815260040161072d90613177565b506001600160a01b0316600090815260046020526040902054600160801b90046001600160801b031690565b6000803033604051602001611f90929190612d39565b6040516020818303038152906040528051906020012090506000611fbd84611fb784612556565b90612586565b600d546001600160a01b03918216911614949350505050565b815b6000828152600f6020526040902054611ff390600190613a7f565b81101561208c576000828152600f60205260409020612013826001613a0c565b8154811061203157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154600f6000848152602001908152602001600020828154811061206e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001558061208481613b14565b915050611fd8565b506000818152600f602052604090208054806120b857634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590555050565b60006001600160e01b031982166380ac58cd60e01b148061210357506001600160e01b03198216635b5e139f60e01b145b8061211e57506001600160e01b0319821663780e9d6360e01b145b8061066c575061066c826125a2565b6060600061213c836002613a38565b612147906002613a0c565b6001600160401b0381111561216c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612196576020820181803683370190505b509050600360fc1b816000815181106121bf57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106121fc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612220846002613a38565b61222b906001613a0c565b90505b60018111156122bf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061226d57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061229157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936122b881613ac2565b905061222e565b5083156110c35760405162461bcd60e51b815260040161072d90612fb6565b6000546001600160a01b0384166123075760405162461bcd60e51b815260040161072d906136ff565b612310816116c9565b1561232d5760405162461bcd60e51b815260040161072d90613691565b7f000000000000000000000000000000000000000000000000000000000000000283111561236d5760405162461bcd60e51b815260040161072d90613903565b61237a6000858386610f9e565b6001600160a01b0384166000908152600460209081526040918290208251808401845290546001600160801b038082168352600160801b90910416918101919091528151808301909252805190919081906123d69087906139ea565b6001600160801b031681526020018583602001516123f491906139ea565b6001600160801b039081169091526001600160a01b03808816600081815260046020908152604080832087518154988401518816600160801b029088166fffffffffffffffffffffffffffffffff199099169890981790961696909617909455845180860186529182526001600160401b034281168386019081528883526003909552948120915182549451909516600160a01b0267ffffffffffffffff60a01b19959093166001600160a01b031990941693909317939093161790915582905b8581101561253e5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46125026000888488611ce5565b61251e5760405162461bcd60e51b815260040161072d9061363e565b8161252881613b14565b925050808061253690613b14565b9150506124b5565b506000818155611a4190878588610f9e565b3b151590565b6000816040516020016125699190612d8f565b604051602081830303815290604052805190602001209050919050565b600080600061259585856125bb565b9150915061087a8161262b565b6001600160e01b031981166301ffc9a760e01b14919050565b6000808251604114156125f25760208301516040840151606085015160001a6125e68782858561275b565b94509450505050612624565b82516040141561261c576020830151604084015161261186838361283b565b935093505050612624565b506000905060025b9250929050565b600081600481111561264d57634e487b7160e01b600052602160045260246000fd5b141561265857612758565b600181600481111561267a57634e487b7160e01b600052602160045260246000fd5b14156126985760405162461bcd60e51b815260040161072d90612f3d565b60028160048111156126ba57634e487b7160e01b600052602160045260246000fd5b14156126d85760405162461bcd60e51b815260040161072d90612feb565b60038160048111156126fa57634e487b7160e01b600052602160045260246000fd5b14156127185760405162461bcd60e51b815260040161072d906131c8565b600481600481111561273a57634e487b7160e01b600052602160045260246000fd5b14156127585760405162461bcd60e51b815260040161072d906133f2565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156127925750600090506003612832565b8460ff16601b141580156127aa57508460ff16601c14155b156127bb5750600090506004612832565b6000600187878787604051600081526020016040526040516127e09493929190612ef7565b6020604051602081039080840390855afa158015612802573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661282b57600060019250925050612832565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161285c8782888561275b565b935093505050935093915050565b82805461287690613ad9565b90600052602060002090601f01602090048101928261289857600085556128de565b82601f106128b157805160ff19168380011785556128de565b828001600101855582156128de579182015b828111156128de5782518255916020019190600101906128c3565b50610b7d929150612901565b604080518082019091526000808252602082015290565b5b80821115610b7d5760008155600101612902565b80356001600160a01b038116811461066f57600080fd5b8035801515811461066f57600080fd5b600082601f83011261294d578081fd5b81356001600160401b0381111561296657612966613b6f565b612979601f8201601f19166020016139c1565b81815284602083860101111561298d578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156129b8578081fd5b6110c382612916565b600080604083850312156129d3578081fd5b6129dc83612916565b91506129ea60208401612916565b90509250929050565b600080600060608486031215612a07578081fd5b612a1084612916565b9250612a1e60208501612916565b9150604084013590509250925092565b60008060008060808587031215612a43578081fd5b612a4c85612916565b9350612a5a60208601612916565b92506040850135915060608501356001600160401b03811115612a7b578182fd5b612a878782880161293d565b91505092959194509250565b60008060408385031215612aa5578182fd5b612aae83612916565b91506129ea6020840161292d565b60008060408385031215612ace578182fd5b612ad783612916565b946020939093013593505050565b60008060408385031215612af7578182fd5b82356001600160401b0380821115612b0d578384fd5b818501915085601f830112612b20578384fd5b8135602082821115612b3457612b34613b6f565b8082029250612b448184016139c1565b8281528181019085830185870184018b1015612b5e578889fd5b8896505b84871015612b80578035835260019690960195918301918301612b62565b509997909101359750505050505050565b600060208284031215612ba2578081fd5b6110c38261292d565b600060208284031215612bbc578081fd5b5035919050565b60008060408385031215612bd5578182fd5b823591506129ea60208401612916565b600060208284031215612bf6578081fd5b81356110c381613b85565b600060208284031215612c12578081fd5b81516110c381613b85565b600060208284031215612c2e578081fd5b81356001600160401b03811115612c43578182fd5b6109218482850161293d565b60008060408385031215612c61578182fd5b8235915060208301356001600160401b03811115612c7d578182fd5b612c898582860161293d565b9150509250929050565b60008060408385031215612ca5578182fd5b50508035926020909101359150565b600080600080600060a08688031215612ccb578283fd5b853563ffffffff81168114612cde578384fd5b9450602086013593506040860135925060608601359150612d016080870161292d565b90509295509295909350565b60008151808452612d25816020860160208601613a96565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff19606093841b811682529190921b16601482015260280190565b60008351612d72818460208801613a96565b835190830190612d86818360208801613a96565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612df8816017850160208801613a96565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612e29816028840160208801613a96565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e7c90830184612d0d565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015612ed757835183529284019291840191600101612ebb565b50909695505050505050565b901515815260200190565b90815260200190565b93845260ff9290921660208401526040830152606082015260800190565b6001600160e01b031991909116815260200190565b6000602082526110c36020830184612d0d565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b60208082526022908201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252601f908201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604082015260600190565b602080825260149082015273115e18d959591a5b99c814d85b1948131a5b5a5d60621b604082015260600190565b6020808252602a908201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736040820152693a32b73a103a37b5b2b760b11b606082015260800190565b60208082526035908201527f496e76616c6964205374616b696e672e204661636520646f6573206e6f74206260408201527432b637b733b9903a37903a34329039ba30b5b2b91760591b606082015260800190565b60208082526023908201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756040820152626e647360e81b606082015260800190565b60208082526025908201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526031908201527f455243373231413a206e756d626572206d696e74656420717565727920666f7260408201527020746865207a65726f206164647265737360781b606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604082015261756560f01b606082015260800190565b6020808252601d908201527f596f7527766520616c726561647920636c61696d65642c206d6174652e000000604082015260600190565b6020808252601a908201527f457863656564204d6178696d756d204e616d65204c656e677468000000000000604082015260600190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b60208082526039908201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000606082015260800190565b6020808252600e908201526d14dd185ada5b99c814185d5cd95960921b604082015260600190565b60208082526025908201527f596f75277265206e6f7420617574686f72697a656420746f2073657420746865604082015264206e616d6560d81b606082015260800190565b602080825260149082015273119858d95cc8185c9948185b1b081b5a5b9d195960621b604082015260600190565b6020808252602b908201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60408201526a65726f206164647265737360a81b606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604082015261756560f01b606082015260800190565b60208082526026908201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746040820152651037bbb732b960d11b606082015260800190565b602080825260119082015270496e76616c6964205369676e617475726560781b604082015260600190565b60208082526035908201527f496e76616c6964207769746864726177616c2e2054686973206661636520646f60408201527432b9903737ba103430bb32903a34329034ba32b69760591b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b6020808252601a908201527f455243373231413a20617070726f766520746f2063616c6c6572000000000000604082015260600190565b60208082526032908201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b60208082526022908201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b60208082526010908201526f135a5b9d081a5cc8191a5cd8589b195960821b604082015260600190565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b6020808252601d908201527f455243373231413a20746f6b656e20616c7265616479206d696e746564000000604082015260600190565b60208082526017908201527f52657365727665642061726520616c6c206d696e746564000000000000000000604082015260600190565b60208082526021908201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252602f908201527f556e617574686f72697a6564207769746864726177616c2e20596f75206d757360408201526e3a103132903a34329037bbb732b91760891b606082015260800190565b602080825260149082015273105b1b08119858d95cc8185c99481b5a5b9d195960621b604082015260600190565b6020808252600b908201526a151a5b5948131bd8dad95960aa1b604082015260600190565b6020808252602e908201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060408201526d0deeedccae440c4f240d2dcc8caf60931b606082015260800190565b6020808252601a908201527f496e76616c696420455243373231205472616e73666572726564000000000000604082015260600190565b6020808252602f908201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560408201526e1037bbb732b91037b3103a37b5b2b760891b606082015260800190565b6020808252602d908201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560408201526c3c34b9ba32b73a103a37b5b2b760991b606082015260800190565b60208082526022908201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696040820152610ced60f31b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b63ffffffff9590951685526020850193909352604084019190915260608301521515608082015260a00190565b6040518181016001600160401b03811182821017156139e2576139e2613b6f565b604052919050565b60006001600160801b03808316818516808303821115612d8657612d86613b43565b60008219821115613a1f57613a1f613b43565b500190565b600082613a3357613a33613b59565b500490565b6000816000190483118215151615613a5257613a52613b43565b500290565b60006001600160801b0383811690831681811015613a7757613a77613b43565b039392505050565b600082821015613a9157613a91613b43565b500390565b60005b83811015613ab1578181015183820152602001613a99565b83811115610f9e5750506000910152565b600081613ad157613ad1613b43565b506000190190565b600281046001821680613aed57607f821691505b60208210811415613b0e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613b2857613b28613b43565b5060010190565b600082613b3e57613b3e613b59565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461275857600080fdfea264697066735822122095d1d46b6d778d495af8c66a6799e95d140ba26cfc094f79b652a769333e291f64736f6c63430008000033

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

0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000270f00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab0fa36e0c5d9a386cbe369ffa123c731194b2de

-----Decoded View---------------
Arg [0] : maxBatchSize_ (uint256): 2
Arg [1] : collectionSize_ (uint256): 9999
Arg [2] : amountReserved_ (uint256): 200
Arg [3] : stakingPaused_ (bool): True
Arg [4] : mintingPaused_ (bool): False
Arg [5] : cSigner_ (address): 0xAB0FA36E0c5D9a386cBE369ffa123c731194b2DE

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [1] : 000000000000000000000000000000000000000000000000000000000000270f
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000ab0fa36e0c5d9a386cbe369ffa123c731194b2de


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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