ETH Price: $2,909.28 (-3.99%)
Gas: 2 Gwei

CNP Reborn (CNPReborn)
 

Overview

TokenID

2050

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
CNPReborn

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 43 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

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

    /**
     * @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 virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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 virtual {
        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 virtual 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 2 of 43 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

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 3 of 43 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

File 4 of 43 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 5 of 43 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 6 of 43 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

File 7 of 43 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

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 8 of 43 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 10 of 43 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 12 of 43 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 15 of 43 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

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

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

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

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

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

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

File 16 of 43 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 17 of 43 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 18 of 43 : ERC721AntiScam.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import "./IERC721AntiScam.sol";
import "./lockable/ERC721Lockable.sol";
import "./restrictApprove/ERC721RestrictApprove.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/// @title AntiScam機能付きERC721A
/// @dev Readmeを見てください。

abstract contract ERC721AntiScam is
    IERC721AntiScam,
    ERC721Lockable,
    ERC721RestrictApprove,
    Ownable
{

    /*///////////////////////////////////////////////////////////////
                              OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override(ERC721Lockable, ERC721RestrictApprove)
        returns (bool)
    {
        if (isLocked(owner) || !_isAllowed(owner, operator)) {
            return false;
        }
        return super.isApprovedForAll(owner, operator);
    }

    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override(ERC721Lockable, ERC721RestrictApprove)
    {
        require(
            isLocked(msg.sender) == false || approved == false,
            "Can not approve locked token"
        );
        require(
            _isAllowed(operator) || approved == false,
            "RestrictApprove: Can not approve locked token"
        );
        super.setApprovalForAll(operator, approved);
    }

    function _beforeApprove(address to, uint256 tokenId)
        internal
        virtual
        override(ERC721Lockable, ERC721RestrictApprove)
    {
        ERC721Lockable._beforeApprove(to, tokenId);
        ERC721RestrictApprove._beforeApprove(to, tokenId);
    }

    function approve(address to, uint256 tokenId)
        public
        virtual
        override(ERC721Lockable, ERC721RestrictApprove)
    {
        _beforeApprove(to, tokenId);
        ERC721Psi.approve(to, tokenId);
    }

    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override(ERC721Psi, ERC721Lockable) {
        ERC721Lockable._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override(ERC721Lockable, ERC721RestrictApprove) {
        ERC721Lockable._afterTokenTransfers(from, to, startTokenId, quantity);
        ERC721RestrictApprove._afterTokenTransfers(from, to, startTokenId, quantity);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721Lockable, ERC721RestrictApprove)
        returns (bool)
    {
        return
            ERC721Psi.supportsInterface(interfaceId) ||
            ERC721Lockable.supportsInterface(interfaceId) ||
            ERC721RestrictApprove.supportsInterface(interfaceId) ||
            interfaceId == type(IERC721AntiScam).interfaceId;
    }
}

File 19 of 43 : IERC721AntiScam.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import "./lockable/IERC721Lockable.sol";
import "./restrictApprove/IERC721RestrictApprove.sol";

/// @title IERC721AntiScam
/// @dev 詐欺防止機能付きコントラクトのインターフェース
/// @author hayatti.eth

interface IERC721AntiScam is IERC721Lockable, IERC721RestrictApprove {
}

File 20 of 43 : ERC721Lockable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import "./IERC721Lockable.sol";
import "erc721psi/contracts/extension/ERC721PsiBurnable.sol";

/// @title トークンのtransfer抑止機能付きコントラクト
/// @dev Readmeを見てください。

abstract contract ERC721Lockable is ERC721PsiBurnable, IERC721Lockable {
    /*//////////////////////////////////////////////////////////////
    ロック変数。トークンごとに個別ロック設定を行う
    //////////////////////////////////////////////////////////////*/
    bool public enableLock = true;
    LockStatus public contractLockStatus = LockStatus.UnLock;

    // token lock
    mapping(uint256 => LockStatus) public tokenLock;

    // wallet lock
    mapping(address => LockStatus) public walletLock;

    /*//////////////////////////////////////////////////////////////
    modifier
    //////////////////////////////////////////////////////////////*/
    modifier existToken(uint256 tokenId) {
        require(
            _exists(tokenId),
            "Lockable: locking query for nonexistent token"
        );
        _;
    }

    /*///////////////////////////////////////////////////////////////
    ロック機能ロジック
    //////////////////////////////////////////////////////////////*/

    // function getLockStatus(uint256 tokenId) external view returns (LockStatus) existToken(tokenId) {
    //     return _getLockStatus(ownerOf(tokenId), tokenId);
    // }

    function isLocked(uint256 tokenId)
        public
        view
        virtual
        existToken(tokenId)
        returns (bool)
    {
        if (!enableLock) {
            return false;
        }

        if (
            tokenLock[tokenId] == LockStatus.Lock ||
            (tokenLock[tokenId] == LockStatus.UnSet &&
                isLocked(ownerOf(tokenId)))
        ) {
            return true;
        }

        return false;
    }

    function isLocked(address holder) public view virtual returns (bool) {
        if (!enableLock) {
            return false;
        }

        if (
            walletLock[holder] == LockStatus.Lock ||
            (walletLock[holder] == LockStatus.UnSet &&
                contractLockStatus == LockStatus.Lock)
        ) {
            return true;
        }

        return false;
    }

    function getTokensUnderLock()
        public
        view
        virtual
        returns (uint256[] memory)
    {
        uint256 start = _startTokenId();
        uint256 end = _nextTokenId();

        return getTokensUnderLock(start, end);
    }

    function getTokensUnderLock(uint256 start, uint256 end)
        public
        view
        virtual
        returns (uint256[] memory)
    {
        bool[] memory lockList = new bool[](end - start + 1);
        uint256 i = 0;
        uint256 lockCount = 0;
        for (uint256 tokenId = start; tokenId <= end; tokenId++) {
            if (_exists(tokenId) && isLocked(tokenId)) {
                lockList[i] = true;
                lockCount++;
            } else {
                lockList[i] = false;
            }

            i++;
        }

        uint256[] memory tokensUnderLock = new uint256[](lockCount);

        i = 0;
        uint256 j = 0;
        for (uint256 tokenId = start; tokenId <= end; tokenId++) {
            if (lockList[i]) {
                tokensUnderLock[j] = tokenId;
                j++;
            }

            i++;
        }

        return tokensUnderLock;
    }

    function _deleteTokenLock(uint256 tokenId) internal virtual {
        delete tokenLock[tokenId];
    }

    function _setTokenLock(uint256[] calldata tokenIds, LockStatus lockStatus)
        internal
        virtual
    {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            tokenLock[tokenIds[i]] = lockStatus;
            emit TokenLock(
                ownerOf(tokenIds[i]),
                msg.sender,
                lockStatus,
                tokenIds[i]
            );
        }
    }

    function _setWalletLock(address to, LockStatus lockStatus)
        internal
        virtual
    {
        walletLock[to] = lockStatus;
        emit WalletLock(to, msg.sender, lockStatus);
    }

    function _setContractLock(LockStatus lockStatus) internal virtual {
        contractLockStatus = lockStatus;
    }

    /*///////////////////////////////////////////////////////////////
                              OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        if (isLocked(owner)) {
            return false;
        }
        return super.isApprovedForAll(owner, operator);
    }

    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(
            isLocked(msg.sender) == false || approved == false,
            "Can not approve locked token"
        );
        super.setApprovalForAll(operator, approved);
    }

    function _beforeApprove(
        address, /**to**/
        uint256 tokenId
    ) internal virtual {
        require(
            isLocked(tokenId) == false,
            "Lockable: Can not approve locked token"
        );
    }

    function approve(address to, uint256 tokenId) public virtual override {
        _beforeApprove(to, tokenId);
        super.approve(to, tokenId);
    }

    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 /*quantity*/
    ) internal virtual override {
        // 転送やバーンにおいては、常にstartTokenIdは TokenIDそのものとなります。
        if (from != address(0) && to != address(0)) {
            // トークンがロックされている場合、転送を許可しない
            require(
                isLocked(startTokenId) == false,
                "Lockable: Can not transfer locked token"
            );
        }
    }

    function _afterTokenTransfers(
        address from,
        address, /*to*/
        uint256 startTokenId,
        uint256 /*quantity*/
    ) internal virtual override {
        // 転送やバーンにおいては、常にstartTokenIdは TokenIDそのものとなります。
        if (from != address(0)) {
            // ロックをデフォルトに戻す。
            _deleteTokenLock(startTokenId);
        }
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IERC721Lockable).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

File 21 of 43 : IERC721Lockable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/**
 * @title IERC721Lockable
 * @dev トークンのtransfer抑止機能付きコントラクトのインターフェース
 * @author Lavulite
 */
interface IERC721Lockable {

   enum LockStatus {
      UnSet,
      UnLock,
      Lock
   }

    /**
     * @dev 個別ロックが指定された場合のイベント
     */
    event TokenLock(address indexed holder, address indexed operator, LockStatus lockStatus, uint256 indexed tokenId);
    
    /**
     * @dev ウォレットロックが指定された場合のイベント
     */
    event WalletLock(address indexed holder, address indexed operator, LockStatus lockStatus);

    /**
     * @dev 該当トークンIDのロックステータスを変更する。
     */
    function setTokenLock(uint256[] calldata tokenIds, LockStatus lockStatus) external;

    /**
     * @dev 該当ウォレットのロックステータスを変更する。
     */
    function setWalletLock(address to, LockStatus lockStatus) external;

    /**
     * @dev コントラクトのロックステータスを変更する。
     */
    function setContractLock(LockStatus lockStatus) external;

    /**
     * @dev 該当トークンIDがロックされているかを返す
     */
    function isLocked(uint256 tokenId) external view returns (bool);
    
    /**
     * @dev ウォレットロックを行っているかを返す
     */
    function isLocked(address holder) external view returns (bool);

    /**
     * @dev 転送が拒否されているトークンを全て返す
     */
    function getTokensUnderLock() external view returns (uint256[] memory);

    /**
     * @dev 転送が拒否されているstartからstopまでのトークンIDを返す
     */
    function getTokensUnderLock(uint256 start, uint256 end) external view returns (uint256[] memory);

}

File 22 of 43 : ERC721RestrictApprove.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import "erc721psi/contracts/extension/ERC721PsiBurnable.sol";
import "./IERC721RestrictApprove.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "../../proxy/interface/IContractAllowListProxy.sol";

/// @title AntiScam機能付きERC721A
/// @dev Readmeを見てください。

abstract contract ERC721RestrictApprove is ERC721PsiBurnable, IERC721RestrictApprove {
    using EnumerableSet for EnumerableSet.AddressSet;

    IContractAllowListProxy public CAL;
    EnumerableSet.AddressSet localAllowedAddresses;

    modifier onlyHolder(uint256 tokenId) {
        require(
            msg.sender == ownerOf(tokenId),
            "RestrictApprove: operation is only holder."
        );
        _;
    }

    /*//////////////////////////////////////////////////////////////
    変数
    //////////////////////////////////////////////////////////////*/
    bool public enableRestrict = true;

    // token lock
    mapping(uint256 => uint256) public tokenCALLevel;

    // wallet lock
    mapping(address => uint256) public walletCALLevel;

    // contract lock
    uint256 public CALLevel = 1;

    /*///////////////////////////////////////////////////////////////
    Approve抑制機能ロジック
    //////////////////////////////////////////////////////////////*/
    function _addLocalContractAllowList(address transferer)
        internal
        virtual
    {
        localAllowedAddresses.add(transferer);
        emit LocalCalAdded(msg.sender, transferer);
    }

    function _removeLocalContractAllowList(address transferer)
        internal
        virtual
    {
        localAllowedAddresses.remove(transferer);
        emit LocalCalRemoved(msg.sender, transferer);
    }

    function _getLocalContractAllowList()
        internal
        virtual
        view
        returns(address[] memory)
    {
        return localAllowedAddresses.values();
    }

    function _isLocalAllowed(address transferer)
        internal
        view
        virtual
        returns (bool)
    {
        return localAllowedAddresses.contains(transferer);
    }

    function _isAllowed(address transferer)
        internal
        view
        virtual
        returns (bool)
    {
        return _isAllowed(msg.sender, transferer);
    }

    function _isAllowed(uint256 tokenId, address transferer)
        internal
        view
        virtual
        returns (bool)
    {
        uint256 level = _getCALLevel(msg.sender, tokenId);
        return _isAllowed(transferer, level);
    }

    function _isAllowed(address holder, address transferer)
        internal
        view
        virtual
        returns (bool)
    {
        uint256 level = _getCALLevel(holder);
        return _isAllowed(transferer, level);
    }

    function _isAllowed(address transferer, uint256 level)
        internal
        view
        virtual
        returns (bool)
    {
        if (!enableRestrict) {
            return true;
        }

        return _isLocalAllowed(transferer) || CAL.isAllowed(transferer, level);
    }

    function _getCALLevel(address holder, uint256 tokenId)
        internal
        view
        virtual
        returns (uint256)
    {
        if (tokenCALLevel[tokenId] > 0) {
            return tokenCALLevel[tokenId];
        }

        return _getCALLevel(holder);
    }

    function _getCALLevel(address holder)
        internal
        view
        virtual
        returns (uint256)
    {
        if (walletCALLevel[holder] > 0) {
            return walletCALLevel[holder];
        }

        return CALLevel;
    }

    function _setCAL(address _cal) internal virtual {
        CAL = IContractAllowListProxy(_cal);
    }

    function _deleteTokenCALLevel(uint256 tokenId) internal virtual {
        delete tokenCALLevel[tokenId];
    }

    function setTokenCALLevel(uint256 tokenId, uint256 level)
        external
        virtual
        onlyHolder(tokenId)
    {
        tokenCALLevel[tokenId] = level;
    }

    function setWalletCALLevel(uint256 level)
        external
        virtual
    {
        walletCALLevel[msg.sender] = level;
    }

    /*///////////////////////////////////////////////////////////////
                              OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        if (_isAllowed(owner, operator) == false) {
            return false;
        }
        return super.isApprovedForAll(owner, operator);
    }

    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(
            _isAllowed(operator) || approved == false,
            "RestrictApprove: Can not approve locked token"
        );
        super.setApprovalForAll(operator, approved);
    }

    function _beforeApprove(address to, uint256 tokenId)
        internal
        virtual
    {
        if (to != address(0)) {
            require(_isAllowed(tokenId, to), "RestrictApprove: The contract is not allowed.");
        }
    }

    function approve(address to, uint256 tokenId)
        public
        virtual
        override
    {
        _beforeApprove(to, tokenId);
        super.approve(to, tokenId);
    }

    function _afterTokenTransfers(
        address from,
        address, /*to*/
        uint256 startTokenId,
        uint256 /*quantity*/
    ) internal virtual override {
        // 転送やバーンにおいては、常にstartTokenIdは TokenIDそのものとなります。
        if (from != address(0)) {
            // CALレベルをデフォルトに戻す。
            _deleteTokenCALLevel(startTokenId);
        }
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IERC721RestrictApprove).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

File 23 of 43 : IERC721RestrictApprove.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @title IERC721RestrictApprove
/// @dev Approve抑制機能付きコントラクトのインターフェース
/// @author Lavulite

interface IERC721RestrictApprove {
    /**
     * @dev CALレベルが変更された場合のイベント
     */
    event CalLevelChanged(address indexed operator, uint256 indexed level);
    
    /**
     * @dev LocalContractAllowListnに追加された場合のイベント
     */
    event LocalCalAdded(address indexed operator, address indexed transferer);

    /**
     * @dev LocalContractAllowListnに削除された場合のイベント
     */
    event LocalCalRemoved(address indexed operator, address indexed transferer);

    /**
     * @dev CALを利用する場合のCALのレベルを設定する。レベルが高いほど、許可されるコントラクトの範囲が狭い。
     */
    function setCALLevel(uint256 level) external;

    /**
     * @dev CALのアドレスをセットする。
     */
    function setCAL(address calAddress) external;

    /**
     * @dev CALのリストに無い独自の許可アドレスを追加する場合、こちらにアドレスを記載する。
     */
    function addLocalContractAllowList(address transferer) external;

    /**
     * @dev CALのリストにある独自の許可アドレスを削除する場合、こちらにアドレスを記載する。
     */
    function removeLocalContractAllowList(address transferer) external;

    /**
     * @dev CALのリストにある独自の許可アドレスの一覧を取得する。
     */
    function getLocalContractAllowList() external view returns(address[] memory);

}

File 24 of 43 : IContractAllowListProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

interface IContractAllowListProxy {
    function isAllowed(address _transferer, uint256 _level)
        external
        view
        returns (bool);
}

File 25 of 43 : CNPReborn.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;

import "./gimmick/ICNPRebornGimmick.sol";
import "./tokenUri/ITokenUriSupplier.sol";
import "./ICNPReborn.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "contract-allow-list/contracts/ERC721AntiScam/ERC721AntiScam.sol";
import "erc721-multi-sales/contracts/multi-wallet/merkletree/ERC721MultiSaleByMerkleMultiWallet.sol";
import "./libs/DefaultOperatorFilterer.sol";

contract CNPReborn is
    ICNPReborn,
    DefaultOperatorFilterer,
    ERC721AntiScam,
    ERC2981,
    AccessControl,
    ERC721MultiSaleByMerkleMultiWallet
{
    // ==================================================================
    // Constants
    // ==================================================================
    bytes32 public constant ADMIN = "ADMIN";

    // ==================================================================
    // Variables
    // ==================================================================
    // == For Creator fee ==
    uint96 public royaltyFee = 1000;

    // == For time lock ==
    // tokenId -> unlock time
    mapping(uint256 => uint256) unlockTokenTimestamp;
    // wallet -> unlock time
    mapping(address => uint256) unlockWalletTimestamp;
    uint256 public unlockLeadTime = 3 hours;

    // == For Grow ==
    // tokenId -> period
    mapping(uint256 => uint256) private _growthPeriodToChild;
    mapping(uint256 => uint256) private _growthPeriodToAdult;

    // tokenId -> date
    mapping(uint256 => uint256) public birthDay;

    uint256 public standardPeriodToChild = 42 days;
    uint256 public standardPeriodToAdult = 76 days;
    // 100% => 1000
    uint256 public maxVariation = 50;

    // == For cooldown time
    // tokenId -> day
    mapping(uint256 => uint256) private lastTransferOrGimmickDay;
    uint256 public cooldownTime = 14 days;

    ICNPRebornGimmick private _gimmick;
    ITokenUriSupplier private _tokenUriSupplier;

    constructor(address ownerAddress, uint256 ownerMintAmount)
        ERC721Psi("CNP Reborn", "CNPReborn")
    {
        grantRole(ADMIN, msg.sender);

        withdrawAddress = payable(ownerAddress);
        _setDefaultRoyalty(withdrawAddress, royaltyFee);

        // bacause of Psi start with 0
        _safeMint(msg.sender, 1);
        _burn(0);

        _birthWithSleeping(ownerAddress, ownerMintAmount);
    }

    // ==================================================================
    // original
    // ==================================================================
    function _setBirthDay(uint256 tokenId) private {
        birthDay[tokenId] = block.timestamp;
    }

    function _getVariation(uint256 tokenId) private view returns (uint256) {
        return
            uint256(
                keccak256(
                    abi.encodePacked(blockhash(block.number - 1), tokenId)
                )
            ) % maxVariation;
    }

    function _decideGrowthPeriod(uint256 tokenId) private {
        _growthPeriodToChild[tokenId] =
            standardPeriodToChild +
            ((standardPeriodToChild * _getVariation(tokenId)) / 1000);
        _growthPeriodToAdult[tokenId] =
            standardPeriodToAdult +
            ((standardPeriodToAdult * _getVariation(tokenId)) / 1000);
    }

    function _birthWithSleeping(address to, uint256 amount) private {
        uint256 startTokenId = _nextTokenId();

        _safeMint(to, amount);

        for (uint256 i = 0; i < amount; i++) {
            uint256 tokenId = startTokenId + i;
            birthDay[tokenId] = 0;
            _decideGrowthPeriod(tokenId);
        }
    }

    function _birth(address to, uint256 amount) private {
        for (uint256 i = 0; i < amount; i++) {
            uint256 tokenId = _nextTokenId() + i;
            _setBirthDay(tokenId);
            _decideGrowthPeriod(tokenId);
        }
        _safeMint(to, amount);
    }

    function adminMint(
        address[] calldata to,
        uint256[] calldata amount,
        bool withSleep
    ) external onlyRole(ADMIN) {
        require(to.length == amount.length);
        for (uint256 i = 0; i < to.length; i++) {
            if (withSleep) {
                _birthWithSleeping(to[i], amount[i]);
            } else {
                _birth(to[i], amount[i]);
            }
        }
    }

    function _burn(address from, uint256[] memory burnTokenIds) internal {
        for (uint256 i = 0; i < burnTokenIds.length; i++) {
            uint256 tokenId = burnTokenIds[i];
            require(from == ownerOf(tokenId), "only holder.");
            _burn(tokenId);
        }
    }

    function isAdult(uint256 tokenId) public view returns (bool) {
        if (birthDay[tokenId] == 0) {
            return false;
        }

        return
            birthDay[tokenId] + _growthPeriodToAdult[tokenId] <=
            block.timestamp;
    }

    function isChild(uint256 tokenId) public view returns (bool) {
        if (birthDay[tokenId] == 0) {
            return false;
        }

        return
            birthDay[tokenId] + _growthPeriodToChild[tokenId] <=
            block.timestamp;
    }

    function inCoolDownTime(uint256 tokenId) public view returns (bool) {
        return
            isAdult(tokenId) &&
            (lastTransferOrGimmickDay[tokenId] + cooldownTime >
                block.timestamp);
    }

    function totalBurned() external view returns (uint256) {
        return _burned();
    }

    function nextTokenId() external view returns (uint256) {
        return _nextTokenId();
    }

    function setStandardPeriodToChild(uint256 period) external onlyRole(ADMIN) {
        standardPeriodToChild = period;
    }

    function setStandardPeriodToAdult(uint256 period) external onlyRole(ADMIN) {
        standardPeriodToAdult = period;
    }

    function setCoolDownTime(uint256 period) external onlyRole(ADMIN) {
        cooldownTime = period;
    }

    function setMaxVariation(uint256 value) external onlyRole(ADMIN) {
        maxVariation = value;
    }

    function playGimmick(uint256 tokenId) external {
        require(msg.sender == address(_gimmick), "only call from gimmick.");
        lastTransferOrGimmickDay[tokenId] = block.timestamp;
    }

    // == For gimmick of Reborn
    function reborn(
        ICNPRebornGimmick.Parents[] calldata parents,
        uint256[] calldata couponIds
    ) external payable {
        _gimmick.reborn{value: msg.value}(msg.sender, parents, couponIds);

        for (uint256 i = 0; i < parents.length; i++) {
            _burn(parents[i].parent1);
            _burn(parents[i].parent2);
            _birth(msg.sender, 2);
        }
    }

    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal override {
        lastTransferOrGimmickDay[startTokenId] = block.timestamp;

        if (birthDay[startTokenId] == 0) {
            birthDay[startTokenId] = block.timestamp;
        }
        _afterTokenTransfersForAddressData(from, to, startTokenId, quantity);
        super._afterTokenTransfers(from, to, startTokenId, quantity);
    }

    // ==================================================================
    // Queriable
    // ==================================================================
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual returns (uint256[] memory) {
        unchecked {
            require(start < stop, "start must be greater than stop.");
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }

            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }

            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }

            for (
                uint256 i = start;
                i != stop && tokenIdsIdx != tokenIdsMaxLength;
                ++i
            ) {
                if (_exists(i)) {
                    if (ownerOf(i) == owner) {
                        tokenIds[tokenIdsIdx++] = i;
                    }
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    // ==================================================================
    // overrive ERC721Psi for operator-filter-registry
    // ==================================================================
    function setApprovalForAll(address operator, bool approved)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.setApprovalForAll(operator, approved);
    }

    function approve(address operator, uint256 tokenId)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.approve(operator, tokenId);
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }

    // ==================================================================
    // override ERC721
    // ==================================================================
    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(_exists(tokenId), "not exists.");
        return _tokenUriSupplier.tokenURI(tokenId);
    }

    // ==================================================================
    // override ERC721RestrictApprove
    // ==================================================================
    function addLocalContractAllowList(address transferer)
        external
        onlyRole(ADMIN)
    {
        _addLocalContractAllowList(transferer);
    }

    function removeLocalContractAllowList(address transferer)
        external
        onlyRole(ADMIN)
    {
        _removeLocalContractAllowList(transferer);
    }

    function getLocalContractAllowList()
        external
        view
        returns (address[] memory)
    {
        return _getLocalContractAllowList();
    }

    function setCAL(address calAddress) external onlyRole(ADMIN) {
        _setCAL(calAddress);
    }

    function setCALLevel(uint256 level) external onlyRole(ADMIN) {
        CALLevel = level;
    }

    function setEnableRestrict(bool value) external onlyRole(ADMIN) {
        enableRestrict = value;
    }

    // ==================================================================
    // override ERC721Loclable
    // ==================================================================
    function setContractLock(LockStatus lockStatus) external onlyRole(ADMIN) {
        _setContractLock(lockStatus);
    }

    function setWalletLock(address to, LockStatus lockStatus) external {
        require(msg.sender == to, "only yourself.");

        if (
            walletLock[to] == LockStatus.Lock && lockStatus != LockStatus.Lock
        ) {
            unlockWalletTimestamp[to] = block.timestamp;
        }

        _setWalletLock(to, lockStatus);
    }

    function setTokenLock(uint256[] calldata tokenIds, LockStatus lockStatus)
        external
    {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            require(msg.sender == ownerOf(tokenIds[i]), "not owner.");
        }

        LockStatus currentWalletLock = walletLock[msg.sender];

        for (uint256 i = 0; i < tokenIds.length; i++) {
            if (
                (currentWalletLock == LockStatus.Lock &&
                    tokenLock[tokenIds[i]] != LockStatus.UnLock &&
                    lockStatus == LockStatus.UnLock) ||
                (currentWalletLock != LockStatus.Lock &&
                    tokenLock[tokenIds[i]] == LockStatus.Lock &&
                    lockStatus == LockStatus.UnLock)
            ) {
                unlockTokenTimestamp[tokenIds[i]] = block.timestamp;
            }
        }
        _setTokenLock(tokenIds, lockStatus);
    }

    function setEnableLock(bool value) external onlyRole(ADMIN) {
        enableLock = value;
    }

    function isLocked(uint256 tokenId)
        public
        view
        override(IERC721Lockable, ERC721Lockable)
        returns (bool)
    {
        return
            ERC721Lockable.isLocked(tokenId) ||
            (unlockTokenTimestamp[tokenId] + unlockLeadTime >
                block.timestamp) ||
            (unlockWalletTimestamp[ownerOf(tokenId)] + unlockLeadTime >
                block.timestamp);
    }

    function setUnlockLeadTime(uint256 value) external onlyRole(ADMIN) {
        unlockLeadTime = value;
    }

    // ==================================================================
    // operations
    // ==================================================================
    function grantRole(bytes32 role, address account)
        public
        override
        onlyOwner
    {
        _grantRole(role, account);
    }

    function revokeRole(bytes32 role, address account)
        public
        override
        onlyOwner
    {
        _revokeRole(role, account);
    }

    // ==================================================================
    // interface
    // ==================================================================
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(AccessControl, ERC721AntiScam, ERC2981)
        returns (bool)
    {
        return
            ERC721Psi.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId) ||
            ERC721AntiScam.supportsInterface(interfaceId) ||
            AccessControl.supportsInterface(interfaceId);
    }

    // ==================================================================
    // override ERC721MultiSaleByMerkleMultWallet For gimmick
    // ==================================================================
    // == For sale ==
    function claim(
        uint256 userId,
        uint256 amount,
        uint256 allowedAmount,
        bytes32[] calldata merkleProof
    ) external payable enoughEth(amount) {
        _claim(userId, amount, allowedAmount, merkleProof);
        _birth(msg.sender, amount);
    }

    function exchange(
        uint256, /*userId*/
        uint256[] calldata, /*burnTokenIds*/
        uint256, /*allowedAmount*/
        bytes32[] calldata /*merkleProof*/
    ) external payable override {
        revert();
    }

    function setCurrentSale(Sale calldata sale, bytes32 merkleRoot)
        external
        onlyRole(ADMIN)
    {
        _setCurrentSale(sale);
        _merkleRoot = merkleRoot;
    }

    // ==================================================================
    // override BasicSale
    // ==================================================================
    function pause() external onlyRole(ADMIN) {
        _pause();
    }

    function unpause() external onlyRole(ADMIN) {
        _unpause();
    }

    function withdraw() external onlyRole(ADMIN) {
        _withdraw();
    }

    function setWithdrawAddress(address payable value)
        external
        onlyRole(ADMIN)
    {
        withdrawAddress = value;
        _setDefaultRoyalty(withdrawAddress, royaltyFee);
    }

    function setMaxSupply(uint256 value) external onlyRole(ADMIN) {
        maxSupply = value;
    }

    function _totalSupply() internal view override returns (uint256) {
        return totalSupply();
    }

    // ==================================================================
    // For IERC2981 NFT Royalty Standard
    // ==================================================================
    function setRoyaltyFee(uint96 value) external onlyRole(ADMIN) {
        royaltyFee = value;
        _setDefaultRoyalty(withdrawAddress, royaltyFee);
    }

    // ==================================================================
    // Operation outer contract
    // ==================================================================
    function setGimmick(address value) external onlyRole(ADMIN) {
        _gimmick = ICNPRebornGimmick(value);
    }

    function setTokenUriSupplier(address value) external onlyRole(ADMIN) {
        _tokenUriSupplier = ITokenUriSupplier(value);
    }

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

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

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

    /**
     * @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 _afterTokenTransfersForAddressData(
        address from,
        address to,
        uint256, /*startTokenId*/
        uint256 quantity
    ) internal virtual {
        require(quantity < 2**64);
        uint64 _quantity = uint64(quantity);

        if (from != address(0)) {
            _addressData[from].balance -= _quantity;
        } else {
            // Mint
            _addressData[to].numberMinted += _quantity;
        }

        if (to != address(0)) {
            _addressData[to].balance += _quantity;
        } else {
            // Burn
            _addressData[from].numberBurned += _quantity;
        }
    }
}

File 26 of 43 : ICNPRebornGimmick.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;

interface ICNPRebornGimmick {
    event Change(address indexed user, uint256 indexed tokenId);

    event Born(
        address indexed user,
        uint256 indexed parent1,
        uint256 indexed parent2
    );

    event Reborn(
        address indexed user,
        uint256 parent1,
        uint256 parent2,
        uint256 indexed minted1,
        uint256 indexed minted2
    );

    struct Parents {
        uint256 parent1;
        uint256 parent2;
    }

    function change(uint256[] calldata tokenIds, uint256[] calldata couponIds)
        external
        payable;

    // == For gimmick of Born
    function born(Parents[] calldata parents, uint256[] calldata couponIds)
        external
        payable;

    // == For gimmick of Reborn
    function reborn(
        address user,
        Parents[] calldata parents,
        uint256[] calldata couponIds
    ) external payable;
}

File 27 of 43 : ICNPReborn.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;

import "contract-allow-list/contracts/ERC721AntiScam/lockable/IERC721Lockable.sol";

interface ICNPReborn is IERC721Lockable {

    function isAdult(uint256 tokenId) external view returns (bool);

    function isChild(uint256 tokenId) external view returns (bool);

    function playGimmick(uint256 tokenId) external;

    function inCoolDownTime(uint256 tokenId) external view returns (bool);

    function nextTokenId() external view returns (uint256);
}

File 28 of 43 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

File 29 of 43 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

File 30 of 43 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // Allow spending tokens from addresses with balance
            // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
            // from an EOA.
            if (from == msg.sender) {
                _;
                return;
            }
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), msg.sender)) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
        _;
    }
}

File 31 of 43 : ITokenUriSupplier.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;

interface ITokenUriSupplier {
    function tokenURI(uint256 tokenId)
        external
        view
        returns (string memory);
}

File 32 of 43 : BasicSale.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

import "./Sale.sol";
import "./IBasicSale.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

abstract contract BasicSale is IBasicSale, Pausable {
    using Address for address payable;
    // ==================================================================
    // Event
    // ==================================================================
    event ChangeSale(uint8 oldId, uint8 newId);

    // ==================================================================
    // Variables
    // ==================================================================
    address payable public withdrawAddress;
    uint256 public maxSupply;
    Sale internal _currentSale;
    uint256 internal _soldCount = 0;

    // ==================================================================
    // Modifier
    // ==================================================================
    modifier isNotOverMaxSaleSupply(uint256 amount) {
        require(
            amount + _soldCount <= _currentSale.maxSupply,
            "claim is over the max sale supply."
        );
        _;
    }
    
    modifier isNotOverMaxSupply(uint256 amount) {
        require(
            amount + _totalSupply() <= maxSupply,
            "claim is over the max supply."
        );
        _;
    }

    modifier enoughEth(uint256 amount) {
        require(msg.value >= _currentSale.mintCost * amount, "not enough eth.");
        _;
    }

    modifier whenClaimSale() {
        require(_currentSale.saleType == SaleType.CLAIM, "not claim sale now.");
        _;
    }

    modifier whenExcahngeSale() {
        require(
            _currentSale.saleType == SaleType.EXCHANGE,
            "not exchange sale now."
        );
        _;
    }

    // ==================================================================
    // Functions
    // ==================================================================
    function getCurrentSale()
        external
        view
        virtual
        returns (
            uint8,
            SaleType,
            uint256,
            uint256
        )
    {
        return (
            _currentSale.id,
            _currentSale.saleType,
            _currentSale.mintCost,
            _currentSale.maxSupply
        );
    }

    function _withdraw() internal virtual {
        require(
            withdrawAddress != address(0),
            "withdraw address is 0 address."
        );
        withdrawAddress.sendValue(address(this).balance);
    }

    function _setCurrentSale(Sale calldata sale) internal virtual {
        uint8 oldId = _currentSale.id;
        _currentSale = sale;
        _soldCount = 0;

        emit ChangeSale(oldId, sale.id);
    }

    function _totalSupply() internal view virtual returns (uint256);
}

File 33 of 43 : IBasicSale.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

import "./Sale.sol";

interface IBasicSale {
    function getCurrentSale()
        external
        view
        returns (
            uint8,
            SaleType,
            uint256,
            uint256
        );

    function setCurrentSale(Sale calldata sale) external;

    function withdraw() external;

    function setWithdrawAddress(address payable value) external;

    function setMaxSupply(uint256 value) external;

    function pause() external;

    function unpause() external;
}

File 34 of 43 : ERC721MultiSaleMultiWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

import "./IERC721MultiSaleMultiWallet.sol";
import "../BasicSale.sol";
import "../Sale.sol";
import "../SalesRecord.sol";

abstract contract ERC721MultiSaleMultiWallet is IERC721MultiSaleMultiWallet, BasicSale {
    // ==================================================================
    // Variables
    // ==================================================================
    mapping(uint256 => SalesRecord) internal _salesRecordByBuyer;

    // ==================================================================
    // Modifier
    // ==================================================================
    modifier isNotOverAllowedAmount(uint256 userId, uint256 amount, uint256 allowedAmount) {
        require(
            getBuyCount(userId) + amount <= allowedAmount,
            "claim is over allowed amount."
        );
        _;
    }

    // ==================================================================
    // Function
    // ==================================================================
    // ------------------------------------------------------------------
    // external & public
    // ------------------------------------------------------------------
    function getBuyCount(uint256 userId) public view returns(uint256){
        SalesRecord storage record = _salesRecordByBuyer[userId];

        if (record.id == _currentSale.id) {
            return record.amount;
        } else {
            return 0;
        }
    }

    // ------------------------------------------------------------------
    // internal & private
    // ------------------------------------------------------------------
    function _claim(uint256 userId, uint256 amount, uint256 allowedAmount)
        internal
        virtual
        whenNotPaused
        isNotOverMaxSupply(amount)
        isNotOverMaxSaleSupply(amount)
        isNotOverAllowedAmount(userId, amount, allowedAmount)
        whenClaimSale
    {
        _record(userId, amount);
    }

    function _exchange(uint256 userId, uint256[] calldata burnTokenIds, uint256 allowedAmount)
        internal
        virtual
        whenNotPaused
        isNotOverMaxSaleSupply(burnTokenIds.length)
        isNotOverAllowedAmount(userId, burnTokenIds.length, allowedAmount)
        whenExcahngeSale
    {
        _record(userId, burnTokenIds.length);
    }

    function _record(uint256 userId, uint256 amount) private {
        SalesRecord storage record = _salesRecordByBuyer[userId];

        if (record.id == _currentSale.id) {
            record.amount += amount;
        } else {
            record.id = _currentSale.id;
            record.amount = amount;
        }

        _soldCount += amount;
    }
}

File 35 of 43 : IERC721MultiSaleMultiWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

interface IERC721MultiSaleMultiWallet {
    function getBuyCount(uint256 userId) external view returns(uint256);
}

File 36 of 43 : ERC721MultiSaleByMerkleMultiWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./IERC721MultiSaleByMerkleMultiWallet.sol";
import "../ERC721MultiSaleMultiWallet.sol";

abstract contract ERC721MultiSaleByMerkleMultiWallet is
    IERC721MultiSaleByMerkleMultiWallet,
    ERC721MultiSaleMultiWallet
{
    bytes32 internal _merkleRoot;

    // ==================================================================
    // Modifier
    // ==================================================================
    modifier hasRight(
        uint256 userId,
        uint256 amount,
        uint256 allowedAmount,
        bytes32[] calldata merkleProof
    ) {
        bytes32 node = keccak256(
            abi.encodePacked(userId, msg.sender, allowedAmount)
        );
        require(
            MerkleProof.verifyCalldata(merkleProof, _merkleRoot, node),
            "invalid proof."
        );
        _;
    }

    // ==================================================================
    // Function
    // ==================================================================
    function _claim(
        uint256 userId,
        uint256 amount,
        uint256 allowedAmount,
        bytes32[] calldata merkleProof
    ) internal virtual hasRight(userId, amount, allowedAmount, merkleProof) {
        _claim(userId, amount, allowedAmount);
    }

    function _exchange(
        uint256 userId,
        uint256[] calldata burnTokenIds,
        uint256 allowedAmount,
        bytes32[] calldata merkleProof
    )
        internal
        virtual
        hasRight(userId, burnTokenIds.length, allowedAmount, merkleProof)
    {
        _exchange(userId, burnTokenIds, allowedAmount);
    }

    function _setCurrentSale(Sale calldata sale, bytes32 merkleRoot) internal {
        _merkleRoot = merkleRoot;
        _setCurrentSale(sale);
    }

    // ------------------------------------------------------------------
    // unused super function
    // ------------------------------------------------------------------
    function setCurrentSale(
        Sale calldata /** sale */
    ) external pure virtual {
        revert("no use.");
    }
}

File 37 of 43 : IERC721MultiSaleByMerkleMultiWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

import "../../Sale.sol";

interface IERC721MultiSaleByMerkleMultiWallet {

  function claim(uint256 userId, uint256 amount, uint256 allowedAmount, bytes32[] calldata merkleProof) external payable;
  
  function exchange(uint256 userId, uint256[] calldata burnTokenIds, uint256 allowedAmount, bytes32[] calldata merkleProof) external payable;

  function setCurrentSale(Sale calldata sale, bytes32 merkleRoot) external;
}

File 38 of 43 : Sale.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

enum SaleType {
  CLAIM,
  EXCHANGE
}

struct Sale {
    uint8 id;
    SaleType saleType;
    uint256 mintCost;
    uint256 maxSupply;
}

File 39 of 43 : SalesRecord.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;

struct SalesRecord {
    uint8 id;
    uint256 amount;
}

File 40 of 43 : ERC721Psi.sol
// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   

 - github: https://github.com/estarriolvetch/ERC721Psi
 - npm: https://www.npmjs.com/package/erc721psi
                                          
 */

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/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
import "solidity-bits/contracts/BitMaps.sol";


contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;

    string private _name;
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) internal _owners;
    uint256 private _currentIndex;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal pure returns (uint256) {
        // It will become modifiable in the future versions
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        return _currentIndex - _startTokenId();
    }


    /**
     * @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 ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        require(owner != address(0), "ERC721Psi: balance query for the zero address");

        uint count;
        for( uint i = _startTokenId(); i < _nextTokenId(); ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

    /**
     * @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), "ERC721Psi: 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 virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721Psi: approval to current owner");

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721Psi: 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 virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, 1,_data),
            "ERC721Psi: 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 virtual returns (bool) {
        return tokenId < _nextTokenId() && _startTokenId() <= tokenId;
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        virtual
        returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 nextTokenId = _nextTokenId();
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, nextTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 nextTokenId = _nextTokenId();
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, nextTokenId, quantity);
        _currentIndex += quantity;
        _owners[nextTokenId] = to;
        _batchHead.set(nextTokenId);
        _afterTokenTransfers(address(0), to, nextTokenId, quantity);
        
        // Emit events
        for(uint256 tokenId=nextTokenId; tokenId < nextTokenId + quantity; tokenId++){
            emit Transfer(address(0), to, tokenId);
        } 
    }


    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * 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
    ) internal virtual {
        (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);

        require(
            owner == from,
            "ERC721Psi: transfer of token that is not own"
        );
        require(to != address(0), "ERC721Psi: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        uint256 subsequentTokenId = tokenId + 1;

        if(!_batchHead.get(subsequentTokenId) &&  
            subsequentTokenId < _nextTokenId()
        ) {
            _owners[subsequentTokenId] = from;
            _batchHead.set(subsequentTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        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) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @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 startTokenId uint256 the first ID of the tokens to be transferred
     * @param quantity uint256 amount of the tokens to be transfered.
     * @param _data bytes optional data to send along with the call
     * @return r bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity,
        bytes memory _data
    ) private returns (bool r) {
        if (to.isContract()) {
            r = true;
            for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){
                try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                    r = r && retval == IERC721Receiver.onERC721Received.selector;
                } catch (bytes memory reason) {
                    if (reason.length == 0) {
                        revert("ERC721Psi: transfer to non ERC721Receiver implementer");
                    } else {
                        assembly {
                            revert(add(32, reason), mload(reason))
                        }
                    }
                }
            }
            return r;
        } else {
            return true;
        }
    }

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }


    function totalSupply() public virtual view returns (uint256) {
        return _totalMinted();
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * This function is compatiable with ERC721AQueryable.
     */
    function tokensOfOwner(address owner) external view virtual returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                if (_exists(i)) {
                    if (ownerOf(i) == owner) {
                        tokenIds[tokenIdsIdx++] = i;
                    }
                }
            }
            return tokenIds;   
        }
    }

    /**
     * @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 41 of 43 : ERC721PsiBurnable.sol
// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   
                                              
                                            
 */
pragma solidity ^0.8.0;

import "solidity-bits/contracts/BitMaps.sol";
import "../ERC721Psi.sol";


abstract contract ERC721PsiBurnable is ERC721Psi {
    using BitMaps for BitMaps.BitMap;
    BitMaps.BitMap private _burnedToken;

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address from = ownerOf(tokenId);
        _beforeTokenTransfers(from, address(0), tokenId, 1);
        _burnedToken.set(tokenId);
        
        emit Transfer(from, address(0), tokenId);

        _afterTokenTransfers(from, address(0), tokenId, 1);
    }

    /**
     * @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`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view override virtual returns (bool){
        if(_burnedToken.get(tokenId)) {
            return false;
        } 
        return super._exists(tokenId);
    }

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

    /**
     * @dev Returns number of token burned.
     */
    function _burned() internal view returns (uint256 burned){
        uint256 startBucket = _startTokenId() >> 8;
        uint256 lastBucket = (_nextTokenId() >> 8) + 1;

        for(uint256 i=startBucket; i < lastBucket; i++) {
            uint256 bucket = _burnedToken.getBucket(i);
            burned += _popcount(bucket);
        }
    }

    /**
     * @dev Returns number of set bits.
     */
    function _popcount(uint256 x) private pure returns (uint256 count) {
        unchecked{
            for (count=0; x!=0; count++)
                x &= x - 1;
        }
    }
}

File 42 of 43 : BitMaps.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
pragma solidity ^0.8.0;

import "./BitScan.sol";

/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library.
 * Functions of finding the index of the closest set bit from a given index are added.
 * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 * The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(
        BitMap storage bitmap,
        uint256 index,
        bool value
    ) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

File 43 of 43 : BitScan.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"},{"internalType":"uint256","name":"ownerMintAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"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":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"CalLevelChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"oldId","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"newId","type":"uint8"}],"name":"ChangeSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":"holder","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenLock","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"holder","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"}],"name":"WalletLock","type":"event"},{"inputs":[],"name":"ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CAL","outputs":[{"internalType":"contract IContractAllowListProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transferer","type":"address"}],"name":"addLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"},{"internalType":"bool","name":"withSleep","type":"bool"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"birthDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"allowedAmount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"contractLockStatus","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldownTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableRestrict","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"name":"exchange","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"}],"name":"getBuyCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentSale","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"enum SaleType","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLocalContractAllowList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"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":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getTokensUnderLock","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensUnderLock","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":"uint256","name":"tokenId","type":"uint256"}],"name":"inCoolDownTime","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isAdult","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":"tokenId","type":"uint256"}],"name":"isChild","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVariation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"playGimmick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"parent1","type":"uint256"},{"internalType":"uint256","name":"parent2","type":"uint256"}],"internalType":"struct ICNPRebornGimmick.Parents[]","name":"parents","type":"tuple[]"},{"internalType":"uint256[]","name":"couponIds","type":"uint256[]"}],"name":"reborn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferer","type":"address"}],"name":"removeLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"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":"address","name":"calAddress","type":"address"}],"name":"setCAL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"}],"name":"setContractLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setCoolDownTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"enum SaleType","name":"saleType","type":"uint8"},{"internalType":"uint256","name":"mintCost","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"internalType":"struct Sale","name":"sale","type":"tuple"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setCurrentSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"enum SaleType","name":"saleType","type":"uint8"},{"internalType":"uint256","name":"mintCost","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"internalType":"struct Sale","name":"","type":"tuple"}],"name":"setCurrentSale","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setEnableLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setEnableRestrict","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value","type":"address"}],"name":"setGimmick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMaxVariation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"value","type":"uint96"}],"name":"setRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setStandardPeriodToAdult","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setStandardPeriodToChild","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setTokenCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"}],"name":"setTokenLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value","type":"address"}],"name":"setTokenUriSupplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setUnlockLeadTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setWalletCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"}],"name":"setWalletLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"value","type":"address"}],"name":"setWithdrawAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"standardPeriodToAdult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"standardPeriodToChild","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenCALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenLock","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockLeadTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletCALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletLock","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040526008805461ffff1916610101179055600e805460ff191660019081179091556011556000601b55601e80546001600160601b0319166103e8179055612a3060215562375f00602555626432006026556032602755621275006029553480156200006c57600080fd5b5060405162007586380380620075868339810160408190526200008f9162001426565b733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060400160405280600a81526020016921a728102932b137b93760b11b8152506040518060400160405280600981526020016821a7282932b137b93760b91b8152508160019081620000fc919062001501565b5060026200010b828262001501565b50600060045550506daaeb6d7670e522a718067333cd4e3b1562000258578015620001a657604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200018757600080fd5b505af11580156200019c573d6000803e3d6000fd5b5050505062000258565b6001600160a01b03821615620001f75760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016200016c565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200023e57600080fd5b505af115801562000253573d6000803e3d6000fd5b505050505b5062000266905033620002f7565b6016805460ff19169055620002846420a226a4a760d91b3362000349565b60168054610100600160a81b0319166101006001600160a01b0385811682029290921792839055601e54620002ca9391909104909116906001600160601b031662000363565b620002d733600162000468565b620002e360006200048a565b620002ef8282620004fb565b505062001792565b601280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200035362000567565b6200035f8282620005c5565b5050565b6127106001600160601b0382161115620003d75760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b0382166200042f5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620003ce565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b6200035f8282604051806020016040528060008152506200064f60201b60201c565b60006200049782620006dc565b9050620004a9816000846001620006f2565b620004c48260076200070b60201b620028c51790919060201c565b60405182906000906001600160a01b0384169060008051602062007466833981519152908390a46200035f81600084600162000737565b60006200050760045490565b905062000515838362000468565b60005b82811015620005615760006200052f8284620015e3565b60008181526024602052604081205590506200054b8162000793565b50806200055881620015f9565b91505062000518565b50505050565b6012546001600160a01b03163314620005c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620003ce565b565b620005d1828262000824565b6200035f5760008281526015602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200060b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006200065b60045490565b905062000669848462000851565b62000679600085838686620009ec565b620005615760405162461bcd60e51b815260206004820152603560248201526000805160206200744683398151915260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401620003ce565b600080620006ea8362000b8f565b509392505050565b620005618484848462000c2c60201b620028f11760201c565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6000828152602860209081526040808320429055602490915281205490036200076c5760008281526024602052604090204290555b6200077a8484848462000cbd565b620005618484848462000e7e60201b6200297c1760201c565b6103e8620007a18262000eb0565b602554620007b0919062001615565b620007bc919062001645565b602554620007cb9190620015e3565b6000828152602260205260409020556103e8620007e88262000eb0565b602654620007f7919062001615565b62000803919062001645565b602654620008129190620015e3565b60009182526023602052604090912055565b60008281526015602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b60006200085d60045490565b905060008211620008bf5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401620003ce565b6001600160a01b038316620009235760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401620003ce565b620009326000848385620006f2565b8160046000828254620009469190620015e3565b90915550506000818152600360209081526040822080546001600160a01b0319166001600160a01b0387161790556200098b919083906200070b811b620028c517901c565b6200099a600084838562000737565b805b620009a88383620015e3565b811015620005615760405181906001600160a01b0386169060009060008051602062007466833981519152908290a480620009e381620015f9565b9150506200099c565b600062000a0d856001600160a01b031662000efb60201b620029941760201c565b1562000b8257506001835b62000a248486620015e3565b81101562000b7b57604051630a85bd0160e11b81526001600160a01b0387169063150b7a029062000a609033908b90869089906004016200165c565b6020604051808303816000875af192505050801562000a9e575060408051601f3d908101601f1916820190925262000a9b91810190620016cf565b60015b62000b45573d80801562000acf576040519150601f19603f3d011682016040523d82523d6000602084013e62000ad4565b606091505b50805160000362000b3d5760405162461bcd60e51b815260206004820152603560248201526000805160206200744683398151915260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401620003ce565b805181602001fd5b82801562000b6357506001600160e01b03198116630a85bd0160e11b145b9250508062000b7281620015f9565b91505062000a18565b5062000b86565b5060015b95945050505050565b60008062000b9d8362000f0a565b62000c005760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401620003ce565b62000c0b8362000f4b565b6000818152600360205260409020546001600160a01b031694909350915050565b6001600160a01b0384161580159062000c4d57506001600160a01b03831615155b15620005615762000c5e8262000f68565b15620005615760405162461bcd60e51b815260206004820152602760248201527f4c6f636b61626c653a2043616e206e6f74207472616e73666572206c6f636b6560448201526632103a37b5b2b760c91b6064820152608401620003ce565b68010000000000000000811062000cd357600080fd5b806001600160a01b0385161562000d41576001600160a01b0385166000908152602c60205260408120805483929062000d179084906001600160401b031662001702565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555062000da8565b6001600160a01b0384166000908152602c60205260409020805482919060089062000d839084906801000000000000000090046001600160401b03166200172c565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b0384161562000e15576001600160a01b0384166000908152602c60205260408120805483929062000deb9084906001600160401b03166200172c565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555062000e77565b6001600160a01b0385166000908152602c60205260409020805482919060109062000e52908490600160801b90046001600160401b03166200172c565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b5050505050565b62000e978484848462000ff760201b620029a31760201c565b62000561848484846200102360201b620029cd1760201c565b60275460009062000ec36001436200174f565b604080519140602083015281018490526060016040516020818303038152906040528051906020012060001c6200084b919062001765565b6001600160a01b03163b151590565b600062000f278260076200104860201b620029f01790919060201c565b1562000f3557506000919050565b6200084b826200106f60201b62002a171760201c565b60006200084b8260006200108d60201b62002a331790919060201c565b600062000f8082620011af60201b62002b2b1760201c565b8062000fa857506021546000838152601f6020526040902054429162000fa691620015e3565b115b806200084b575060215442906020600062000fc386620006dc565b6001600160a01b03166001600160a01b031681526020019081526020016000205462000ff09190620015e3565b1192915050565b6001600160a01b0384161562000561576000828152600960205260409020805460ff1916905562000561565b6001600160a01b0384161562000561576000828152600f602052604081205562000561565b600881901c600090815260208390526040902054600160ff1b60ff83161c16151592915050565b60006200107b60045490565b821080156200084b5750600192915050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015620010de57620010cb81620012c560201b62002c1d1760201c565b60ff168203600884901b179350620011a6565b60008311620011565760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527f696e64657820646f65736e27742065786973742e0000000000000000000000006064820152608401620003ce565b506000199091016000818152602086905260409020549091908015620011a0576200118c81620012c560201b62002c1d1760201c565b60ff0360ff16600884901b179350620011a6565b620010de565b50505092915050565b600081620011bd8162000f0a565b620012215760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b61626c653a206c6f636b696e6720717565727920666f72206e6f6e6560448201526c3c34b9ba32b73a103a37b5b2b760991b6064820152608401620003ce565b60085460ff16620012365760009150620012bf565b600260008481526009602052604090205460ff1660028111156200125e576200125e62001410565b1480620012aa575060008381526009602052604081205460ff1660028111156200128c576200128c62001410565b148015620012aa5750620012aa620012a484620006dc565b62001335565b15620012ba5760019150620012bf565b600091505b50919050565b6000604051806101200160405280610100815260200162007486610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6200131185620013f7565b02901c815181106200132757620013276200177c565b016020015160f81c92915050565b60085460009060ff166200134b57506000919050565b60026001600160a01b0383166000908152600a602052604090205460ff1660028111156200137d576200137d62001410565b1480620013e157506001600160a01b0382166000908152600a602052604081205460ff166002811115620013b557620013b562001410565b148015620013e157506002600854610100900460ff166002811115620013df57620013df62001410565b145b15620013ef57506001919050565b506000919050565b60008082116200140657600080fd5b5060008190031690565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156200143a57600080fd5b82516001600160a01b03811681146200145257600080fd5b6020939093015192949293505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200148d57607f821691505b602082108103620012bf57634e487b7160e01b600052602260045260246000fd5b601f821115620014fc57600081815260208120601f850160051c81016020861015620014d75750805b601f850160051c820191505b81811015620014f857828155600101620014e3565b5050505b505050565b81516001600160401b038111156200151d576200151d62001462565b62001535816200152e845462001478565b84620014ae565b602080601f8311600181146200156d5760008415620015545750858301515b600019600386901b1c1916600185901b178555620014f8565b600085815260208120601f198616915b828110156200159e578886015182559484019460019091019084016200157d565b5085821015620015bd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b808201808211156200084b576200084b620015cd565b6000600182016200160e576200160e620015cd565b5060010190565b80820281158282048414176200084b576200084b620015cd565b634e487b7160e01b600052601260045260246000fd5b6000826200165757620016576200162f565b500490565b600060018060a01b038087168352602081871681850152856040850152608060608501528451915081608085015260005b82811015620016ab5785810182015185820160a0015281016200168d565b5050600060a0828501015260a0601f19601f83011684010191505095945050505050565b600060208284031215620016e257600080fd5b81516001600160e01b031981168114620016fb57600080fd5b9392505050565b6001600160401b03828116828216039080821115620017255762001725620015cd565b5092915050565b6001600160401b03818116838216019080821115620017255762001725620015cd565b818103818111156200084b576200084b620015cd565b6000826200177757620017776200162f565b500690565b634e487b7160e01b600052603260045260246000fd5b615ca480620017a26000396000f3fe6080604052600436106104e05760003560e01c806370a0823111610281578063b319c6b71161015a578063d997a360116100cc578063f2fde38b11610085578063f2fde38b14610f83578063f3b3059e14610fa3578063f461c5aa14610fc3578063f6aacfb114610fe3578063f961195314611003578063ff7682121461101957600080fd5b8063d997a36014610ef2578063e3a0d95e14610f05578063e985e9c514610f1b578063ea25e17614610f3b578063eb05629714610f4e578063ebf1e67514610f6357600080fd5b8063c87b56dd1161011e578063c87b56dd14610e51578063ca6932d514610e71578063cb87b75314610e87578063d547741f14610ea7578063d5abeb0114610ec7578063d89135cd14610edd57600080fd5b8063b319c6b714610da3578063b87877e914610db9578063b88d4fde14610dd9578063b8997a9714610df9578063c029df5014610e3157600080fd5b80638ee2e28c116101f3578063a217fddf116101b7578063a217fddf14610cde578063a22cb46514610cf3578063a35c23ad14610d13578063a41216ac14610d40578063af5ed60514610d60578063b31391cb14610d7657600080fd5b80638ee2e28c14610c4957806391d1485414610c6957806395d89b4114610c8957806399a2557a14610c9e578063a059b16414610cbe57600080fd5b80637c3dc173116102455780637c3dc17314610b965780638456cb5914610bb65780638462151c14610bcb578063874a8b0214610beb5780638a3c0fad14610c0b5780638da5cb5b14610c2b57600080fd5b806370a0823114610afc578063715018a614610b1c57806372b44d7114610b3157806375794a3c14610b515780637988426914610b6657600080fd5b806336568abe116103be5780634f3db346116103305780635d9d28e5116102e95780635d9d28e514610a3c57806360cf2bbf14610a5c5780636352211e14610a7c5780636ae4452314610a9c5780636e16de1114610abc5780636f8b44b014610adc57600080fd5b80634f3db346146109685780634fdaf0521461097e57806351b578711461099e5780635756bae0146109cb5780635c64bb72146109eb5780635c975abb14610a2457600080fd5b80633f4ba83a116103825780633f4ba83a146108b657806341f43434146108cb57806342842e0e146108ed57806347cf4e1b1461090d5780634a4fbeec1461091b5780634b81d8bd1461093b57600080fd5b806336568abe14610827578063374032a114610847578063396e8f53146108615780633ab1a494146108815780633ccfd60b146108a157600080fd5b80631581b60011610457578063248a9ca31161041b578063248a9ca31461073c5780632a0acc6a1461076c5780632a55205a146107885780632eb88cee146107c75780632f2ff15d146107e757806331faafb41461080757600080fd5b80631581b6001461069557806315ba0352146106ba57806318160ddd146106da5780632398f843146106ef57806323b872dd1461071c57600080fd5b806307265389116104a957806307265389146105b2578063081812fc146105cc578063095ea7b3146105f95780630f4345e21461061957806310c395bf1461063957806313c528261461066557600080fd5b80623f332f146104e5578063019a7ab11461051057806301ffc9a71461053e578063025e332e1461056e57806306fdde0314610590575b600080fd5b3480156104f157600080fd5b506104fa611039565b6040516105079190614e58565b60405180910390f35b34801561051c57600080fd5b5061053061052b366004614ea5565b611048565b604051908152602001610507565b34801561054a57600080fd5b5061055e610559366004614ed4565b611080565b6040519015158152602001610507565b34801561057a57600080fd5b5061058e610589366004614f06565b6110be565b005b34801561059c57600080fd5b506105a56110f3565b6040516105079190614f73565b3480156105be57600080fd5b50600e5461055e9060ff1681565b3480156105d857600080fd5b506105ec6105e7366004614ea5565b611185565b6040516105079190614f86565b34801561060557600080fd5b5061058e610614366004614f9a565b611215565b34801561062557600080fd5b5061058e610634366004614ea5565b6112cd565b34801561064557600080fd5b5060085461065890610100900460ff1681565b6040516105079190614fdc565b34801561067157600080fd5b50610658610680366004614f06565b600a6020526000908152604090205460ff1681565b3480156106a157600080fd5b506016546105ec9061010090046001600160a01b031681565b3480156106c657600080fd5b5061058e6106d5366004614ea5565b6112e5565b3480156106e657600080fd5b506105306112fd565b3480156106fb57600080fd5b5061053061070a366004614f06565b60106020526000908152604090205481565b34801561072857600080fd5b5061058e610737366004614ff6565b611319565b34801561074857600080fd5b50610530610757366004614ea5565b60009081526015602052604090206001015490565b34801561077857600080fd5b506105306420a226a4a760d91b81565b34801561079457600080fd5b506107a86107a3366004615037565b6113f3565b604080516001600160a01b039093168352602083019190915201610507565b3480156107d357600080fd5b5061055e6107e2366004614ea5565b6114a1565b3480156107f357600080fd5b5061058e610802366004615059565b6114ec565b34801561081357600080fd5b5061058e610822366004615089565b6114fe565b34801561083357600080fd5b5061058e610842366004615059565b61154a565b34801561085357600080fd5b5060085461055e9060ff1681565b34801561086d57600080fd5b50600b546105ec906001600160a01b031681565b34801561088d57600080fd5b5061058e61089c366004614f06565b6115c4565b3480156108ad57600080fd5b5061058e61161a565b3480156108c257600080fd5b5061058e611637565b3480156108d757600080fd5b506105ec6daaeb6d7670e522a718067333cd4e81565b3480156108f957600080fd5b5061058e610908366004614ff6565b611651565b61058e6104e03660046150f6565b34801561092757600080fd5b5061055e610936366004614f06565b611720565b34801561094757600080fd5b5061095b610956366004615037565b6117d5565b6040516105079190615178565b34801561097457600080fd5b5061053060115481565b34801561098a57600080fd5b5061058e6109993660046151bf565b6119a3565b3480156109aa57600080fd5b506105306109b9366004614ea5565b60246020526000908152604090205481565b3480156109d757600080fd5b5061058e6109e6366004614ea5565b6119be565b3480156109f757600080fd5b50610a14601854601954601a5460ff808416936101009004169293565b60405161050794939291906151da565b348015610a3057600080fd5b5060165460ff1661055e565b348015610a4857600080fd5b5061055e610a57366004614ea5565b6119d6565b348015610a6857600080fd5b5061058e610a7736600461521d565b611a19565b348015610a8857600080fd5b506105ec610a97366004614ea5565b611af8565b348015610aa857600080fd5b5061058e610ab7366004614ea5565b611b0c565b348015610ac857600080fd5b5061058e610ad7366004614ea5565b611b73565b348015610ae857600080fd5b5061058e610af7366004614ea5565b611b8b565b348015610b0857600080fd5b50610530610b17366004614f06565b611ba3565b348015610b2857600080fd5b5061058e611c36565b348015610b3d57600080fd5b5061058e610b4c366004614f06565b611c4a565b348015610b5d57600080fd5b50610530611c65565b348015610b7257600080fd5b50610658610b81366004614ea5565b60096020526000908152604090205460ff1681565b348015610ba257600080fd5b5061058e610bb1366004615037565b611c70565b348015610bc257600080fd5b5061058e611d00565b348015610bd757600080fd5b5061095b610be6366004614f06565b611d1a565b348015610bf757600080fd5b5061058e610c063660046152a0565b611de0565b348015610c1757600080fd5b5061058e610c263660046152e7565b611ea1565b348015610c3757600080fd5b506012546001600160a01b03166105ec565b348015610c5557600080fd5b5061058e610c64366004615312565b611ec3565b348015610c7557600080fd5b5061055e610c84366004615059565b611ef5565b348015610c9557600080fd5b506105a5611f20565b348015610caa57600080fd5b5061095b610cb936600461532e565b611f2f565b348015610cca57600080fd5b5061058e610cd9366004615363565b6120a6565b348015610cea57600080fd5b50610530600081565b348015610cff57600080fd5b5061058e610d0e366004615380565b6120cc565b348015610d1f57600080fd5b5061058e610d2e366004614ea5565b33600090815260106020526040902055565b348015610d4c57600080fd5b5061058e610d5b366004615363565b61217f565b348015610d6c57600080fd5b5061053060255481565b348015610d8257600080fd5b50610530610d91366004614ea5565b600f6020526000908152604090205481565b348015610daf57600080fd5b5061053060295481565b348015610dc557600080fd5b5061055e610dd4366004614ea5565b6121a5565b348015610de557600080fd5b5061058e610df436600461541b565b6121db565b348015610e0557600080fd5b50601e54610e19906001600160601b031681565b6040516001600160601b039091168152602001610507565b348015610e3d57600080fd5b5061058e610e4c366004614ea5565b6122b8565b348015610e5d57600080fd5b506105a5610e6c366004614ea5565b6122d0565b348015610e7d57600080fd5b5061053060215481565b348015610e9357600080fd5b5061058e610ea2366004614f06565b612386565b348015610eb357600080fd5b5061058e610ec2366004615059565b6123bb565b348015610ed357600080fd5b5061053060175481565b348015610ee957600080fd5b506105306123c3565b61058e610f003660046154c9565b6123cd565b348015610f1157600080fd5b5061053060265481565b348015610f2757600080fd5b5061055e610f36366004615562565b6124a9565b61058e610f49366004615590565b6124dd565b348015610f5a57600080fd5b5061095b61254d565b348015610f6f57600080fd5b5061058e610f7e366004614ea5565b61256e565b348015610f8f57600080fd5b5061058e610f9e366004614f06565b612586565b348015610faf57600080fd5b5061058e610fbe3660046155f0565b6125fc565b348015610fcf57600080fd5b5061058e610fde366004614f06565b612803565b348015610fef57600080fd5b5061055e610ffe366004614ea5565b612838565b34801561100f57600080fd5b5061053060275481565b34801561102557600080fd5b5061058e611034366004614f06565b6128aa565b6060611043612c87565b905090565b6000818152601c60205260408120601854815460ff918216911603611071576001015492915050565b50600092915050565b50919050565b600061108b82612c93565b8061109a575061109a82612ce3565b806110a957506110a982612d04565b806110b857506110b882612d42565b92915050565b6420a226a4a760d91b6110d081612d67565b600b80546001600160a01b0319166001600160a01b0384161790555050565b5050565b60606001805461110290615643565b80601f016020809104026020016040519081016040528092919081815260200182805461112e90615643565b801561117b5780601f106111505761010080835404028352916020019161117b565b820191906000526020600020905b81548152906001019060200180831161115e57829003601f168201915b5050505050905090565b600061119082612d71565b6111f95760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b816daaeb6d7670e522a718067333cd4e3b156112be57604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c61711349061125e9030908590600401615677565b602060405180830381865afa15801561127b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129f9190615691565b6112be5780604051633b79c77360e21b81526004016111f09190614f86565b6112c88383612d94565b505050565b6420a226a4a760d91b6112df81612d67565b50601155565b6420a226a4a760d91b6112f781612d67565b50602155565b6000611307612da8565b61130f612e0a565b61104391906156c4565b826daaeb6d7670e522a718067333cd4e3b156113e257336001600160a01b0382160361134f5761134a848484612e1a565b6113ed565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906113829030903390600401615677565b602060405180830381865afa15801561139f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c39190615691565b6113e25733604051633b79c77360e21b81526004016111f09190614f86565b6113ed848484612e1a565b50505050565b60008281526014602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916114685750604080518082019091526013546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611487906001600160601b0316876156d7565b6114919190615704565b91519350909150505b9250929050565b60008181526024602052604081205481036114be57506000919050565b60008281526022602090815260408083205460249092529091205442916114e491615718565b111592915050565b6114f4612e4b565b6110ef8282612ea5565b6420a226a4a760d91b61151081612d67565b601e80546001600160601b0319166001600160601b0384169081179091556016546110ef916101009091046001600160a01b031690612f2b565b6001600160a01b03811633146115ba5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016111f0565b6110ef8282613024565b6420a226a4a760d91b6115d681612d67565b60168054610100600160a81b0319166101006001600160a01b0385811682029290921792839055601e546110ef9391909104909116906001600160601b0316612f2b565b6420a226a4a760d91b61162c81612d67565b61163461308b565b50565b6420a226a4a760d91b61164981612d67565b611634613103565b826daaeb6d7670e522a718067333cd4e3b1561171557336001600160a01b038216036116825761134a84848461314f565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906116b59030903390600401615677565b602060405180830381865afa1580156116d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f69190615691565b6117155733604051633b79c77360e21b81526004016111f09190614f86565b6113ed84848461314f565b60085460009060ff1661173557506000919050565b60026001600160a01b0383166000908152600a602052604090205460ff16600281111561176457611764614fc6565b14806117c057506001600160a01b0382166000908152600a602052604081205460ff16600281111561179857611798614fc6565b1480156117c057506002600854610100900460ff1660028111156117be576117be614fc6565b145b156117cd57506001919050565b506000919050565b606060006117e384846156c4565b6117ee906001615718565b6001600160401b03811115611805576118056153ae565b60405190808252806020026020018201604052801561182e578160200160208202803683370190505b509050600080855b8581116118d65761184681612d71565b8015611856575061185681612838565b1561189157600184848151811061186f5761186f61572b565b911515602092830291909101909101528161188981615741565b9250506118b6565b60008484815181106118a5576118a561572b565b911515602092830291909101909101525b826118c081615741565b93505080806118ce90615741565b915050611836565b506000816001600160401b038111156118f1576118f16153ae565b60405190808252806020026020018201604052801561191a578160200160208202803683370190505b5060009350905082875b8781116119965785858151811061193d5761193d61572b565b602002602001015115611976578083838151811061195d5761195d61572b565b60209081029190910101528161197281615741565b9250505b8461198081615741565b955050808061198e90615741565b915050611924565b5090979650505050505050565b6420a226a4a760d91b6119b581612d67565b6110ef8261316a565b6420a226a4a760d91b6119d081612d67565b50602555565b60008181526024602052604081205481036119f357506000919050565b60008281526023602090815260408083205460249092529091205442916114e491615718565b6420a226a4a760d91b611a2b81612d67565b848314611a3757600080fd5b60005b85811015611aef578215611a9557611a90878783818110611a5d57611a5d61572b565b9050602002016020810190611a729190614f06565b868684818110611a8457611a8461572b565b90506020020135613193565b611add565b611add878783818110611aaa57611aaa61572b565b9050602002016020810190611abf9190614f06565b868684818110611ad157611ad161572b565b905060200201356131ee565b80611ae781615741565b915050611a3a565b50505050505050565b600080611b0483613249565b509392505050565b602a546001600160a01b03163314611b605760405162461bcd60e51b815260206004820152601760248201527637b7363c9031b0b63610333937b69033b4b6b6b4b1b59760491b60448201526064016111f0565b6000908152602860205260409020429055565b6420a226a4a760d91b611b8581612d67565b50602955565b6420a226a4a760d91b611b9d81612d67565b50601755565b60006001600160a01b038216611c115760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b60648201526084016111f0565b506001600160a01b03166000908152602c60205260409020546001600160401b031690565b611c3e612e4b565b611c4860006132e0565b565b6420a226a4a760d91b611c5c81612d67565b6110ef82613332565b600061104360045490565b81611c7a81611af8565b6001600160a01b0316336001600160a01b031614611ced5760405162461bcd60e51b815260206004820152602a60248201527f5265737472696374417070726f76653a206f7065726174696f6e206973206f6e604482015269363c903437b63232b91760b11b60648201526084016111f0565b506000918252600f602052604090912055565b6420a226a4a760d91b611d1281612d67565b611634613377565b6060600080611d2884611ba3565b90506000816001600160401b03811115611d4457611d446153ae565b604051908082528060200260200182016040528015611d6d578160200160208202803683370190505b50905060005b828414611dd757611d8381612d71565b15611dcf57856001600160a01b0316611d9b82611af8565b6001600160a01b031603611dcf5780828580600101965081518110611dc257611dc261572b565b6020026020010181815250505b600101611d73565b50949350505050565b336001600160a01b03831614611e295760405162461bcd60e51b815260206004820152600e60248201526d37b7363c903cb7bab939b2b6331760911b60448201526064016111f0565b60026001600160a01b0383166000908152600a602052604090205460ff166002811115611e5857611e58614fc6565b148015611e7757506002816002811115611e7457611e74614fc6565b14155b15611e97576001600160a01b038216600090815260208052604090204290555b6110ef82826133b4565b6420a226a4a760d91b611eb381612d67565b611ebc8361343d565b50601d5550565b60405162461bcd60e51b81526020600482015260076024820152663737903ab9b29760c91b60448201526064016111f0565b60009182526015602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461110290615643565b6060818310611f805760405162461bcd60e51b815260206004820181905260248201527f7374617274206d7573742062652067726561746572207468616e2073746f702e60448201526064016111f0565b600080611f8c60045490565b905080841115611f9a578093505b6000611fa587611ba3565b905084861015611fc45785850381811015611fbe578091505b50611fc8565b5060005b6000816001600160401b03811115611fe257611fe26153ae565b60405190808252806020026020018201604052801561200b578160200160208202803683370190505b5090508160000361202157935061209f92505050565b865b8681141580156120335750828514155b156120955761204181612d71565b1561208d57886001600160a01b031661205982611af8565b6001600160a01b03160361208d57808286806001019750815181106120805761208061572b565b6020026020010181815250505b600101612023565b5092835250909150505b9392505050565b6420a226a4a760d91b6120b881612d67565b50600e805460ff1916911515919091179055565b816daaeb6d7670e522a718067333cd4e3b1561217557604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906121159030908590600401615677565b602060405180830381865afa158015612132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121569190615691565b6121755780604051633b79c77360e21b81526004016111f09190614f86565b6112c883836134a8565b6420a226a4a760d91b61219181612d67565b506008805460ff1916911515919091179055565b60006121b0826119d6565b80156110b8575060295460008381526028602052604090205442916121d491615718565b1192915050565b836daaeb6d7670e522a718067333cd4e3b156122a557336001600160a01b038216036122125761220d8585858561350f565b6122b1565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906122459030903390600401615677565b602060405180830381865afa158015612262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122869190615691565b6122a55733604051633b79c77360e21b81526004016111f09190614f86565b6122b18585858561350f565b5050505050565b6420a226a4a760d91b6122ca81612d67565b50602655565b60606122db82612d71565b6123155760405162461bcd60e51b815260206004820152600b60248201526a3737ba1032bc34b9ba399760a91b60448201526064016111f0565b602b5460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa15801561235e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110b8919081019061575a565b6420a226a4a760d91b61239881612d67565b50602a80546001600160a01b0319166001600160a01b0392909216919091179055565b6115ba612e4b565b6000611043612da8565b602a54604051632d14c2f960e21b81526001600160a01b039091169063b4530be490349061240790339089908990899089906004016157c7565b6000604051808303818588803b15801561242057600080fd5b505af1158015612434573d6000803e3d6000fd5b505050505060005b838110156122b1576124688585838181106124595761245961572b565b90506040020160000135613541565b61248c85858381811061247d5761247d61572b565b90506040020160200135613541565b6124973360026131ee565b806124a181615741565b91505061243c565b60006124b483611720565b806124c657506124c4838361359b565b155b156124d3575060006110b8565b61209f83836135bb565b60195484906124ed9082906156d7565b34101561252e5760405162461bcd60e51b815260206004820152600f60248201526e3737ba1032b737bab3b41032ba341760891b60448201526064016111f0565b61253b86868686866135e2565b61254533866131ee565b505050505050565b606060008061255b60045490565b905061256782826117d5565b9250505090565b6420a226a4a760d91b61258081612d67565b50602755565b61258e612e4b565b6001600160a01b0381166125f35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016111f0565b611634816132e0565b60005b828110156126875761262884848381811061261c5761261c61572b565b90506020020135611af8565b6001600160a01b0316336001600160a01b0316146126755760405162461bcd60e51b815260206004820152600a6024820152693737ba1037bbb732b91760b11b60448201526064016111f0565b8061267f81615741565b9150506125ff565b50336000908152600a602052604081205460ff16905b838110156127f75760028260028111156126b9576126b9614fc6565b14801561270a57506001600960008787858181106126d9576126d961572b565b602090810292909201358352508101919091526040016000205460ff16600281111561270757612707614fc6565b14155b80156127275750600183600281111561272557612725614fc6565b145b806127af5750600282600281111561274157612741614fc6565b1415801561279257506002600960008787858181106127625761276261572b565b602090810292909201358352508101919091526040016000205460ff16600281111561279057612790614fc6565b145b80156127af575060018360028111156127ad576127ad614fc6565b145b156127e55742601f60008787858181106127cb576127cb61572b565b905060200201358152602001908152602001600020819055505b806127ef81615741565b91505061269d565b506113ed848484613697565b6420a226a4a760d91b61281581612d67565b50602b80546001600160a01b0319166001600160a01b0392909216919091179055565b600061284382612b2b565b8061286857506021546000838152601f6020526040902054429161286691615718565b115b806110b85750426021546020600061287f86611af8565b6001600160a01b03166001600160a01b03168152602001908152602001600020546121d49190615718565b6420a226a4a760d91b6128bc81612d67565b6110ef8261377b565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6001600160a01b0384161580159061291157506001600160a01b03831615155b156113ed5761291f82612838565b156113ed5760405162461bcd60e51b815260206004820152602760248201527f4c6f636b61626c653a2043616e206e6f74207472616e73666572206c6f636b6560448201526632103a37b5b2b760c91b60648201526084016111f0565b612988848484846129a3565b6113ed848484846129cd565b6001600160a01b03163b151590565b6001600160a01b038416156113ed576000828152600960205260409020805460ff191690556113ed565b6001600160a01b038416156113ed576000828152600f60205260408120556113ed565b600881901c600090815260208390526040902054600160ff1b60ff83161c16151592915050565b6000612a2260045490565b821080156110b857508160006114e4565b600881901c60008181526020849052604081205490919060ff808516919082181c8015612a7557612a6381612c1d565b60ff168203600884901b179350612b22565b60008311612ae25760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b60648201526084016111f0565b506000199091016000818152602086905260409020549091908015612b1d57612b0a81612c1d565b60ff0360ff16600884901b179350612b22565b612a75565b50505092915050565b600081612b3781612d71565b612b995760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b61626c653a206c6f636b696e6720717565727920666f72206e6f6e6560448201526c3c34b9ba32b73a103a37b5b2b760991b60648201526084016111f0565b60085460ff16612bac576000915061107a565b600260008481526009602052604090205460ff166002811115612bd157612bd1614fc6565b1480612c0f575060008381526009602052604081205460ff166002811115612bfb57612bfb614fc6565b148015612c0f5750612c0f61093684611af8565b15611071576001915061107a565b60006040518061012001604052806101008152602001615b6f610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff612c66856137c0565b02901c81518110612c7957612c7961572b565b016020015160f81c92915050565b6060611043600c6137d8565b60006001600160e01b031982166380ac58cd60e01b1480612cc457506001600160e01b03198216635b5e139f60e01b145b806110b857506301ffc9a760e01b6001600160e01b03198316146110b8565b60006001600160e01b0319821663152a902d60e11b14806110b857506110b8825b6000612d0f82612c93565b80612d1e5750612d1e826137e5565b80612d2d5750612d2d8261380a565b806110b85750506001600160e01b0319161590565b60006001600160e01b03198216637965db0b60e01b14806110b857506110b882612ce3565b611634813361382f565b6000612d7e6007836129f0565b15612d8b57506000919050565b6110b882612a17565b612d9e8282613893565b6110ef82826138a7565b60045460009081908190612dc09060081c6001615718565b9050815b81811015612e0457600081815260076020526040902054612de4816139b9565b612dee9086615718565b9450508080612dfc90615741565b915050612dc4565b50505090565b60008060045461104391906156c4565b612e2433826139d8565b612e405760405162461bcd60e51b81526004016111f09061584f565b6112c8838383613a9d565b6012546001600160a01b03163314611c485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111f0565b612eaf8282611ef5565b6110ef5760008281526015602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612ee73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6127106001600160601b0382161115612f995760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016111f0565b6001600160a01b038216612feb5760405162461bcd60e51b815260206004820152601960248201527822a921991c9c189d1034b73b30b634b2103932b1b2b4bb32b960391b60448201526064016111f0565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b61302e8282611ef5565b156110ef5760008281526015602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60165461010090046001600160a01b03166130e85760405162461bcd60e51b815260206004820152601e60248201527f77697468647261772061646472657373206973203020616464726573732e000060448201526064016111f0565b601654611c489061010090046001600160a01b031647613c74565b61310b613d8d565b6016805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516131459190614f86565b60405180910390a1565b6112c8838383604051806020016040528060008152506121db565b6008805482919061ff00191661010083600281111561318b5761318b614fc6565b021790555050565b600061319e60045490565b90506131aa8383613dd6565b60005b828110156113ed5760006131c18284615718565b60008181526024602052604081205590506131db81613df0565b50806131e681615741565b9150506131ad565b60005b8181101561323e5760008161320560045490565b61320f9190615718565b6000818152602460205260409020429055905061322b81613df0565b508061323681615741565b9150506131f1565b506110ef8282613dd6565b60008061325583612d71565b6132b65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016111f0565b6132bf83613e71565b6000818152600360205260409020546001600160a01b031694909350915050565b601280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61333d600c82613e7d565b506040516001600160a01b0382169033907f3b01c97343869ca2757fcc37cdb8f71683b0a7aed858e3755f4529a1db85729290600090a350565b61337f613e92565b6016805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586131383390565b6001600160a01b0382166000908152600a60205260409020805482919060ff191660018360028111156133e9576133e9614fc6565b0217905550336001600160a01b0316826001600160a01b03167f9fdb14457e6a7bd3753c649831b026de987c06e52d16459a928540738c2ea34b836040516134319190614fdc565b60405180910390a35050565b6018805460ff1690829061345182826158b2565b50506000601b557f75e3689da7799229d232f2c15fc530f1a386e47a961aea8ccc86ed74cfb4bd4f81613487602085018561590e565b6040805160ff93841681529290911660208301520160405180910390a15050565b6134b133611720565b15806134bb575080155b6134d75760405162461bcd60e51b81526004016111f09061592b565b6134e082613ed8565b806134e9575080155b6135055760405162461bcd60e51b81526004016111f090615962565b6110ef8282613ee4565b61351933836139d8565b6135355760405162461bcd60e51b81526004016111f09061584f565b6113ed84848484613f1c565b600061354c82611af8565b905061355c816000846001613f51565b6135676007836128c5565b60405182906000906001600160a01b03841690600080516020615b4f833981519152908390a46110ef816000846001613f5d565b6000806135a784613fa9565b90506135b38382613feb565b949350505050565b60006135c7838361359b565b15156000036135d8575060006110b8565b61209f8383614084565b8484848484600085338560405160200161361c9392919092835260609190911b6001600160601b0319166020830152603482015260540190565b6040516020818303038152906040528051906020012090506136428383601d54846140ca565b61367f5760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b210383937b7b31760911b60448201526064016111f0565b61368a8b8b8b6140e2565b5050505050505050505050565b60005b828110156113ed5781600960008686858181106136b9576136b961572b565b60209081029290920135835250810191909152604001600020805460ff191660018360028111156136ec576136ec614fc6565b02179055508383828181106137035761370361572b565b90506020020135336001600160a01b031661372986868581811061261c5761261c61572b565b6001600160a01b03167f80a668baf7ac68b329075f26c37b4428d4aa272c3bd4c9611b25f5fb1c473f7c856040516137619190614fdc565b60405180910390a48061377381615741565b91505061369a565b613786600c82614295565b506040516001600160a01b0382169033907fbd0af1fe0a2c1c7bb340c17a284a291138979c8eeb797e176dbd1c415199af3c90600090a350565b60008082116137ce57600080fd5b5060008190031690565b6060600061209f836142aa565b60006001600160e01b03198216632742b5b960e01b14806110b857506110b882612c93565b60006001600160e01b03198216630101c11560e71b14806110b857506110b8826137e5565b6138398282611ef5565b6110ef57613851816001600160a01b03166014614306565b61385c836020614306565b60405160200161386d9291906159af565b60408051601f198184030181529082905262461bcd60e51b82526111f091600401614f73565b61389d82826144a1565b6110ef8282614506565b60006138b282611af8565b9050806001600160a01b0316836001600160a01b0316036139215760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b60648201526084016111f0565b336001600160a01b038216148061393d575061393d81336124a9565b6139af5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c000000000060648201526084016111f0565b6112c88383614581565b60005b81156139d3576000198201909116906001016139bc565b919050565b60006139e382612d71565b613a475760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016111f0565b6000613a5283611af8565b9050806001600160a01b0316846001600160a01b03161480613a8d5750836001600160a01b0316613a8284611185565b6001600160a01b0316145b806135b357506135b381856124a9565b600080613aa983613249565b91509150846001600160a01b0316826001600160a01b031614613b235760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b60648201526084016111f0565b6001600160a01b038416613b895760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b60648201526084016111f0565b613b968585856001613f51565b613ba1600084614581565b6000613bae846001615718565b9050613bbb6000826129f0565b158015613bc9575060045481105b15613bff57600081815260036020526040812080546001600160a01b0319166001600160a01b038916179055613bff90826128c5565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414613c3857613c386000856128c5565b83856001600160a01b0316876001600160a01b0316600080516020615b4f83398151915260405160405180910390a46125458686866001613f5d565b80471015613cc45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016111f0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613d11576040519150601f19603f3d011682016040523d82523d6000602084013e613d16565b606091505b50509050806112c85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016111f0565b60165460ff16611c485760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016111f0565b6110ef8282604051806020016040528060008152506145ef565b6103e8613dfc82614614565b602554613e0991906156d7565b613e139190615704565b602554613e209190615718565b6000828152602260205260409020556103e8613e3b82614614565b602654613e4891906156d7565b613e529190615704565b602654613e5f9190615718565b60009182526023602052604090912055565b60006110b88183612a33565b600061209f836001600160a01b03841661465b565b60165460ff1615611c485760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016111f0565b60006110b8338361359b565b613eed82613ed8565b80613ef6575080155b613f125760405162461bcd60e51b81526004016111f090615962565b6110ef8282614755565b613f27848484613a9d565b613f3584848460018561478e565b6113ed5760405162461bcd60e51b81526004016111f090615a1e565b6113ed848484846128f1565b600082815260286020908152604080832042905560249091528120549003613f915760008281526024602052604090204290555b613f9d848484846148cc565b6113ed8484848461297c565b6001600160a01b03811660009081526010602052604081205415613fe357506001600160a01b031660009081526010602052604090205490565b505060115490565b600e5460009060ff16614000575060016110b8565b61400983614a75565b8061209f5750600b54604051630f8350ed60e41b81526001600160a01b038581166004830152602482018590529091169063f8350ed090604401602060405180830381865afa158015614060573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209f9190615691565b600061408f83611720565b1561409c575060006110b8565b6001600160a01b0380841660009081526006602090815260408083209386168352929052205460ff1661209f565b6000826140d8868685614a82565b1495945050505050565b6140ea613e92565b816017546140f6614ac5565b6141009083615718565b111561414e5760405162461bcd60e51b815260206004820152601d60248201527f636c61696d206973206f76657220746865206d617820737570706c792e00000060448201526064016111f0565b601a54601b548491906141619083615718565b11156141ba5760405162461bcd60e51b815260206004820152602260248201527f636c61696d206973206f76657220746865206d61782073616c6520737570706c6044820152613c9760f11b60648201526084016111f0565b84848480826141c885611048565b6141d29190615718565b11156142205760405162461bcd60e51b815260206004820152601d60248201527f636c61696d206973206f76657220616c6c6f77656420616d6f756e742e00000060448201526064016111f0565b6000601854610100900460ff16600181111561423e5761423e614fc6565b146142815760405162461bcd60e51b81526020600482015260136024820152723737ba1031b630b4b69039b0b632903737bb9760691b60448201526064016111f0565b61428b8888614acf565b5050505050505050565b600061209f836001600160a01b038416614b42565b6060816000018054806020026020016040519081016040528092919081815260200182805480156142fa57602002820191906000526020600020905b8154815260200190600101908083116142e6575b50505050509050919050565b606060006143158360026156d7565b614320906002615718565b6001600160401b03811115614337576143376153ae565b6040519080825280601f01601f191660200182016040528015614361576020820181803683370190505b509050600360fc1b8160008151811061437c5761437c61572b565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106143ab576143ab61572b565b60200101906001600160f81b031916908160001a90535060006143cf8460026156d7565b6143da906001615718565b90505b6001811115614452576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061440e5761440e61572b565b1a60f81b8282815181106144245761442461572b565b60200101906001600160f81b031916908160001a90535060049490941c9361444b81615a73565b90506143dd565b50831561209f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016111f0565b6144aa81612838565b156110ef5760405162461bcd60e51b815260206004820152602660248201527f4c6f636b61626c653a2043616e206e6f7420617070726f7665206c6f636b6564604482015265103a37b5b2b760d11b60648201526084016111f0565b6001600160a01b038216156110ef5761451f8183614b91565b6110ef5760405162461bcd60e51b815260206004820152602d60248201527f5265737472696374417070726f76653a2054686520636f6e747261637420697360448201526c103737ba1030b63637bbb2b21760991b60648201526084016111f0565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906145b682611af8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006145fa60045490565b90506146068484614b9e565b613f3560008583868661478e565b6027546000906146256001436156c4565b604080519140602083015281018490526060016040516020818303038152906040528051906020012060001c6110b89190615a8a565b6000818152600183016020526040812054801561474457600061467f6001836156c4565b8554909150600090614693906001906156c4565b90508181146146f85760008660000182815481106146b3576146b361572b565b90600052602060002001549050808760000184815481106146d6576146d661572b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061470957614709615a9e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110b8565b60009150506110b8565b5092915050565b61475e33611720565b1580614768575080155b6147845760405162461bcd60e51b81526004016111f09061592b565b6110ef8282614d18565b60006147a2856001600160a01b0316612994565b156148bf57506001835b6147b68486615718565b8110156148b957604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906147ef9033908b9086908990600401615ab4565b6020604051808303816000875af192505050801561482a575060408051601f3d908101601f1916820190925261482791810190615af1565b60015b614887573d808015614858576040519150601f19603f3d011682016040523d82523d6000602084013e61485d565b606091505b50805160000361487f5760405162461bcd60e51b81526004016111f090615a1e565b805181602001fd5b8280156148a457506001600160e01b03198116630a85bd0160e11b145b925050806148b181615741565b9150506147ac565b506148c3565b5060015b95945050505050565b600160401b81106148dc57600080fd5b806001600160a01b03851615614946576001600160a01b0385166000908152602c60205260408120805483929061491d9084906001600160401b0316615b0e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506149a6565b6001600160a01b0384166000908152602c602052604090208054829190600890614981908490600160401b90046001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b03841615614a0f576001600160a01b0384166000908152602c6020526040812080548392906149e69084906001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506122b1565b6001600160a01b0385166000908152602c602052604090208054829190601090614a4a908490600160801b90046001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050505050565b60006110b8600c83614dd5565b600081815b84811015611dd757614ab182878784818110614aa557614aa561572b565b90506020020135614df7565b915080614abd81615741565b915050614a87565b60006110436112fd565b6000828152601c60205260409020601854815460ff918216911603614b0d5781816001016000828254614b029190615718565b90915550614b269050565b601854815460ff191660ff909116178155600181018290555b81601b6000828254614b389190615718565b9091555050505050565b6000818152600183016020526040812054614b89575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110b8565b5060006110b8565b6000806135a73385614e26565b6000614ba960045490565b905060008211614c095760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b60648201526084016111f0565b6001600160a01b038316614c6b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b60648201526084016111f0565b614c786000848385613f51565b8160046000828254614c8a9190615718565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b038616179055614cc090826128c5565b614ccd6000848385613f5d565b805b614cd98383615718565b8110156113ed5760405181906001600160a01b03861690600090600080516020615b4f833981519152908290a480614d1081615741565b915050614ccf565b336001600160a01b03831603614d705760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c65720000000060448201526064016111f0565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101613431565b6001600160a01b0381166000908152600183016020526040812054151561209f565b6000818310614e1357600082815260208490526040902061209f565b600083815260208390526040902061209f565b6000818152600f602052604081205415614e4f57506000818152600f60205260409020546110b8565b61209f83613fa9565b6020808252825182820181905260009190848201906040850190845b81811015614e995783516001600160a01b031683529284019291840191600101614e74565b50909695505050505050565b600060208284031215614eb757600080fd5b5035919050565b6001600160e01b03198116811461163457600080fd5b600060208284031215614ee657600080fd5b813561209f81614ebe565b6001600160a01b038116811461163457600080fd5b600060208284031215614f1857600080fd5b813561209f81614ef1565b60005b83811015614f3e578181015183820152602001614f26565b50506000910152565b60008151808452614f5f816020860160208601614f23565b601f01601f19169290920160200192915050565b60208152600061209f6020830184614f47565b6001600160a01b0391909116815260200190565b60008060408385031215614fad57600080fd5b8235614fb881614ef1565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310614ff057614ff0614fc6565b91905290565b60008060006060848603121561500b57600080fd5b833561501681614ef1565b9250602084013561502681614ef1565b929592945050506040919091013590565b6000806040838503121561504a57600080fd5b50508035926020909101359150565b6000806040838503121561506c57600080fd5b82359150602083013561507e81614ef1565b809150509250929050565b60006020828403121561509b57600080fd5b81356001600160601b038116811461209f57600080fd5b60008083601f8401126150c457600080fd5b5081356001600160401b038111156150db57600080fd5b6020830191508360208260051b850101111561149a57600080fd5b6000806000806000806080878903121561510f57600080fd5b8635955060208701356001600160401b038082111561512d57600080fd5b6151398a838b016150b2565b909750955060408901359450606089013591508082111561515957600080fd5b5061516689828a016150b2565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b81811015614e9957835183529284019291840191600101615194565b8035600381106139d357600080fd5b6000602082840312156151d157600080fd5b61209f826151b0565b60ff8516815260808101600285106151f4576151f4614fc6565b84602083015283604083015282606083015295945050505050565b801515811461163457600080fd5b60008060008060006060868803121561523557600080fd5b85356001600160401b038082111561524c57600080fd5b61525889838a016150b2565b9097509550602088013591508082111561527157600080fd5b5061527e888289016150b2565b90945092505060408601356152928161520f565b809150509295509295909350565b600080604083850312156152b357600080fd5b82356152be81614ef1565b91506152cc602084016151b0565b90509250929050565b60006080828403121561107a57600080fd5b60008060a083850312156152fa57600080fd5b61530484846152d5565b946080939093013593505050565b60006080828403121561532457600080fd5b61209f83836152d5565b60008060006060848603121561534357600080fd5b833561534e81614ef1565b95602085013595506040909401359392505050565b60006020828403121561537557600080fd5b813561209f8161520f565b6000806040838503121561539357600080fd5b823561539e81614ef1565b9150602083013561507e8161520f565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156153ec576153ec6153ae565b604052919050565b60006001600160401b0382111561540d5761540d6153ae565b50601f01601f191660200190565b6000806000806080858703121561543157600080fd5b843561543c81614ef1565b9350602085013561544c81614ef1565b92506040850135915060608501356001600160401b0381111561546e57600080fd5b8501601f8101871361547f57600080fd5b803561549261548d826153f4565b6153c4565b8181528860208385010111156154a757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600080604085870312156154df57600080fd5b84356001600160401b03808211156154f657600080fd5b818701915087601f83011261550a57600080fd5b81358181111561551957600080fd5b8860208260061b850101111561552e57600080fd5b60209283019650945090860135908082111561554957600080fd5b50615556878288016150b2565b95989497509550505050565b6000806040838503121561557557600080fd5b823561558081614ef1565b9150602083013561507e81614ef1565b6000806000806000608086880312156155a857600080fd5b85359450602086013593506040860135925060608601356001600160401b038111156155d357600080fd5b6155df888289016150b2565b969995985093965092949392505050565b60008060006040848603121561560557600080fd5b83356001600160401b0381111561561b57600080fd5b615627868287016150b2565b909450925061563a9050602085016151b0565b90509250925092565b600181811c9082168061565757607f821691505b60208210810361107a57634e487b7160e01b600052602260045260246000fd5b6001600160a01b0392831681529116602082015260400190565b6000602082840312156156a357600080fd5b815161209f8161520f565b634e487b7160e01b600052601160045260246000fd5b818103818111156110b8576110b86156ae565b80820281158282048414176110b8576110b86156ae565b634e487b7160e01b600052601260045260246000fd5b600082615713576157136156ee565b500490565b808201808211156110b8576110b86156ae565b634e487b7160e01b600052603260045260246000fd5b600060018201615753576157536156ae565b5060010190565b60006020828403121561576c57600080fd5b81516001600160401b0381111561578257600080fd5b8201601f8101841361579357600080fd5b80516157a161548d826153f4565b8181528560208385010111156157b657600080fd5b6148c3826020830160208601614f23565b6001600160a01b038616815260606020808301829052908201859052600090869060808401835b8881101561581457833582528284013583830152604093840193909101906001016157ee565b5084810360408601528581526001600160fb1b0386111561583457600080fd5b8560051b925082878383013790910101979650505050505050565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b60ff8116811461163457600080fd5b81356158bd816158a3565b60ff8116905081548160ff1982161783556020840135600281106158e057600080fd5b61ff008160081b168361ffff1984161717845550505060408201356001820155606082013560028201555050565b60006020828403121561592057600080fd5b813561209f816158a3565b6020808252601c908201527f43616e206e6f7420617070726f7665206c6f636b656420746f6b656e00000000604082015260600190565b6020808252602d908201527f5265737472696374417070726f76653a2043616e206e6f7420617070726f766560408201526c103637b1b5b2b2103a37b5b2b760991b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516159e1816017850160208801614f23565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615a12816028840160208801614f23565b01602801949350505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b600081615a8257615a826156ae565b506000190190565b600082615a9957615a996156ee565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615ae790830184614f47565b9695505050505050565b600060208284031215615b0357600080fd5b815161209f81614ebe565b6001600160401b0382811682821603908082111561474e5761474e6156ae565b6001600160401b0381811683821601908082111561474e5761474e6156ae56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a264697066735822122085a655f44993efbdf29e985818b76679c867d908f2e19560f21c67de991ba69d64736f6c634300081100334552433732315073693a207472616e7366657220746f206e6f6e204552433732ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8000000000000000000000000c57e443a24892ac9f721d66ac4b31eda426bff69000000000000000000000000000000000000000000000000000000000000000a

Deployed Bytecode

0x6080604052600436106104e05760003560e01c806370a0823111610281578063b319c6b71161015a578063d997a360116100cc578063f2fde38b11610085578063f2fde38b14610f83578063f3b3059e14610fa3578063f461c5aa14610fc3578063f6aacfb114610fe3578063f961195314611003578063ff7682121461101957600080fd5b8063d997a36014610ef2578063e3a0d95e14610f05578063e985e9c514610f1b578063ea25e17614610f3b578063eb05629714610f4e578063ebf1e67514610f6357600080fd5b8063c87b56dd1161011e578063c87b56dd14610e51578063ca6932d514610e71578063cb87b75314610e87578063d547741f14610ea7578063d5abeb0114610ec7578063d89135cd14610edd57600080fd5b8063b319c6b714610da3578063b87877e914610db9578063b88d4fde14610dd9578063b8997a9714610df9578063c029df5014610e3157600080fd5b80638ee2e28c116101f3578063a217fddf116101b7578063a217fddf14610cde578063a22cb46514610cf3578063a35c23ad14610d13578063a41216ac14610d40578063af5ed60514610d60578063b31391cb14610d7657600080fd5b80638ee2e28c14610c4957806391d1485414610c6957806395d89b4114610c8957806399a2557a14610c9e578063a059b16414610cbe57600080fd5b80637c3dc173116102455780637c3dc17314610b965780638456cb5914610bb65780638462151c14610bcb578063874a8b0214610beb5780638a3c0fad14610c0b5780638da5cb5b14610c2b57600080fd5b806370a0823114610afc578063715018a614610b1c57806372b44d7114610b3157806375794a3c14610b515780637988426914610b6657600080fd5b806336568abe116103be5780634f3db346116103305780635d9d28e5116102e95780635d9d28e514610a3c57806360cf2bbf14610a5c5780636352211e14610a7c5780636ae4452314610a9c5780636e16de1114610abc5780636f8b44b014610adc57600080fd5b80634f3db346146109685780634fdaf0521461097e57806351b578711461099e5780635756bae0146109cb5780635c64bb72146109eb5780635c975abb14610a2457600080fd5b80633f4ba83a116103825780633f4ba83a146108b657806341f43434146108cb57806342842e0e146108ed57806347cf4e1b1461090d5780634a4fbeec1461091b5780634b81d8bd1461093b57600080fd5b806336568abe14610827578063374032a114610847578063396e8f53146108615780633ab1a494146108815780633ccfd60b146108a157600080fd5b80631581b60011610457578063248a9ca31161041b578063248a9ca31461073c5780632a0acc6a1461076c5780632a55205a146107885780632eb88cee146107c75780632f2ff15d146107e757806331faafb41461080757600080fd5b80631581b6001461069557806315ba0352146106ba57806318160ddd146106da5780632398f843146106ef57806323b872dd1461071c57600080fd5b806307265389116104a957806307265389146105b2578063081812fc146105cc578063095ea7b3146105f95780630f4345e21461061957806310c395bf1461063957806313c528261461066557600080fd5b80623f332f146104e5578063019a7ab11461051057806301ffc9a71461053e578063025e332e1461056e57806306fdde0314610590575b600080fd5b3480156104f157600080fd5b506104fa611039565b6040516105079190614e58565b60405180910390f35b34801561051c57600080fd5b5061053061052b366004614ea5565b611048565b604051908152602001610507565b34801561054a57600080fd5b5061055e610559366004614ed4565b611080565b6040519015158152602001610507565b34801561057a57600080fd5b5061058e610589366004614f06565b6110be565b005b34801561059c57600080fd5b506105a56110f3565b6040516105079190614f73565b3480156105be57600080fd5b50600e5461055e9060ff1681565b3480156105d857600080fd5b506105ec6105e7366004614ea5565b611185565b6040516105079190614f86565b34801561060557600080fd5b5061058e610614366004614f9a565b611215565b34801561062557600080fd5b5061058e610634366004614ea5565b6112cd565b34801561064557600080fd5b5060085461065890610100900460ff1681565b6040516105079190614fdc565b34801561067157600080fd5b50610658610680366004614f06565b600a6020526000908152604090205460ff1681565b3480156106a157600080fd5b506016546105ec9061010090046001600160a01b031681565b3480156106c657600080fd5b5061058e6106d5366004614ea5565b6112e5565b3480156106e657600080fd5b506105306112fd565b3480156106fb57600080fd5b5061053061070a366004614f06565b60106020526000908152604090205481565b34801561072857600080fd5b5061058e610737366004614ff6565b611319565b34801561074857600080fd5b50610530610757366004614ea5565b60009081526015602052604090206001015490565b34801561077857600080fd5b506105306420a226a4a760d91b81565b34801561079457600080fd5b506107a86107a3366004615037565b6113f3565b604080516001600160a01b039093168352602083019190915201610507565b3480156107d357600080fd5b5061055e6107e2366004614ea5565b6114a1565b3480156107f357600080fd5b5061058e610802366004615059565b6114ec565b34801561081357600080fd5b5061058e610822366004615089565b6114fe565b34801561083357600080fd5b5061058e610842366004615059565b61154a565b34801561085357600080fd5b5060085461055e9060ff1681565b34801561086d57600080fd5b50600b546105ec906001600160a01b031681565b34801561088d57600080fd5b5061058e61089c366004614f06565b6115c4565b3480156108ad57600080fd5b5061058e61161a565b3480156108c257600080fd5b5061058e611637565b3480156108d757600080fd5b506105ec6daaeb6d7670e522a718067333cd4e81565b3480156108f957600080fd5b5061058e610908366004614ff6565b611651565b61058e6104e03660046150f6565b34801561092757600080fd5b5061055e610936366004614f06565b611720565b34801561094757600080fd5b5061095b610956366004615037565b6117d5565b6040516105079190615178565b34801561097457600080fd5b5061053060115481565b34801561098a57600080fd5b5061058e6109993660046151bf565b6119a3565b3480156109aa57600080fd5b506105306109b9366004614ea5565b60246020526000908152604090205481565b3480156109d757600080fd5b5061058e6109e6366004614ea5565b6119be565b3480156109f757600080fd5b50610a14601854601954601a5460ff808416936101009004169293565b60405161050794939291906151da565b348015610a3057600080fd5b5060165460ff1661055e565b348015610a4857600080fd5b5061055e610a57366004614ea5565b6119d6565b348015610a6857600080fd5b5061058e610a7736600461521d565b611a19565b348015610a8857600080fd5b506105ec610a97366004614ea5565b611af8565b348015610aa857600080fd5b5061058e610ab7366004614ea5565b611b0c565b348015610ac857600080fd5b5061058e610ad7366004614ea5565b611b73565b348015610ae857600080fd5b5061058e610af7366004614ea5565b611b8b565b348015610b0857600080fd5b50610530610b17366004614f06565b611ba3565b348015610b2857600080fd5b5061058e611c36565b348015610b3d57600080fd5b5061058e610b4c366004614f06565b611c4a565b348015610b5d57600080fd5b50610530611c65565b348015610b7257600080fd5b50610658610b81366004614ea5565b60096020526000908152604090205460ff1681565b348015610ba257600080fd5b5061058e610bb1366004615037565b611c70565b348015610bc257600080fd5b5061058e611d00565b348015610bd757600080fd5b5061095b610be6366004614f06565b611d1a565b348015610bf757600080fd5b5061058e610c063660046152a0565b611de0565b348015610c1757600080fd5b5061058e610c263660046152e7565b611ea1565b348015610c3757600080fd5b506012546001600160a01b03166105ec565b348015610c5557600080fd5b5061058e610c64366004615312565b611ec3565b348015610c7557600080fd5b5061055e610c84366004615059565b611ef5565b348015610c9557600080fd5b506105a5611f20565b348015610caa57600080fd5b5061095b610cb936600461532e565b611f2f565b348015610cca57600080fd5b5061058e610cd9366004615363565b6120a6565b348015610cea57600080fd5b50610530600081565b348015610cff57600080fd5b5061058e610d0e366004615380565b6120cc565b348015610d1f57600080fd5b5061058e610d2e366004614ea5565b33600090815260106020526040902055565b348015610d4c57600080fd5b5061058e610d5b366004615363565b61217f565b348015610d6c57600080fd5b5061053060255481565b348015610d8257600080fd5b50610530610d91366004614ea5565b600f6020526000908152604090205481565b348015610daf57600080fd5b5061053060295481565b348015610dc557600080fd5b5061055e610dd4366004614ea5565b6121a5565b348015610de557600080fd5b5061058e610df436600461541b565b6121db565b348015610e0557600080fd5b50601e54610e19906001600160601b031681565b6040516001600160601b039091168152602001610507565b348015610e3d57600080fd5b5061058e610e4c366004614ea5565b6122b8565b348015610e5d57600080fd5b506105a5610e6c366004614ea5565b6122d0565b348015610e7d57600080fd5b5061053060215481565b348015610e9357600080fd5b5061058e610ea2366004614f06565b612386565b348015610eb357600080fd5b5061058e610ec2366004615059565b6123bb565b348015610ed357600080fd5b5061053060175481565b348015610ee957600080fd5b506105306123c3565b61058e610f003660046154c9565b6123cd565b348015610f1157600080fd5b5061053060265481565b348015610f2757600080fd5b5061055e610f36366004615562565b6124a9565b61058e610f49366004615590565b6124dd565b348015610f5a57600080fd5b5061095b61254d565b348015610f6f57600080fd5b5061058e610f7e366004614ea5565b61256e565b348015610f8f57600080fd5b5061058e610f9e366004614f06565b612586565b348015610faf57600080fd5b5061058e610fbe3660046155f0565b6125fc565b348015610fcf57600080fd5b5061058e610fde366004614f06565b612803565b348015610fef57600080fd5b5061055e610ffe366004614ea5565b612838565b34801561100f57600080fd5b5061053060275481565b34801561102557600080fd5b5061058e611034366004614f06565b6128aa565b6060611043612c87565b905090565b6000818152601c60205260408120601854815460ff918216911603611071576001015492915050565b50600092915050565b50919050565b600061108b82612c93565b8061109a575061109a82612ce3565b806110a957506110a982612d04565b806110b857506110b882612d42565b92915050565b6420a226a4a760d91b6110d081612d67565b600b80546001600160a01b0319166001600160a01b0384161790555050565b5050565b60606001805461110290615643565b80601f016020809104026020016040519081016040528092919081815260200182805461112e90615643565b801561117b5780601f106111505761010080835404028352916020019161117b565b820191906000526020600020905b81548152906001019060200180831161115e57829003601f168201915b5050505050905090565b600061119082612d71565b6111f95760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b816daaeb6d7670e522a718067333cd4e3b156112be57604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c61711349061125e9030908590600401615677565b602060405180830381865afa15801561127b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129f9190615691565b6112be5780604051633b79c77360e21b81526004016111f09190614f86565b6112c88383612d94565b505050565b6420a226a4a760d91b6112df81612d67565b50601155565b6420a226a4a760d91b6112f781612d67565b50602155565b6000611307612da8565b61130f612e0a565b61104391906156c4565b826daaeb6d7670e522a718067333cd4e3b156113e257336001600160a01b0382160361134f5761134a848484612e1a565b6113ed565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906113829030903390600401615677565b602060405180830381865afa15801561139f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c39190615691565b6113e25733604051633b79c77360e21b81526004016111f09190614f86565b6113ed848484612e1a565b50505050565b60008281526014602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916114685750604080518082019091526013546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611487906001600160601b0316876156d7565b6114919190615704565b91519350909150505b9250929050565b60008181526024602052604081205481036114be57506000919050565b60008281526022602090815260408083205460249092529091205442916114e491615718565b111592915050565b6114f4612e4b565b6110ef8282612ea5565b6420a226a4a760d91b61151081612d67565b601e80546001600160601b0319166001600160601b0384169081179091556016546110ef916101009091046001600160a01b031690612f2b565b6001600160a01b03811633146115ba5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016111f0565b6110ef8282613024565b6420a226a4a760d91b6115d681612d67565b60168054610100600160a81b0319166101006001600160a01b0385811682029290921792839055601e546110ef9391909104909116906001600160601b0316612f2b565b6420a226a4a760d91b61162c81612d67565b61163461308b565b50565b6420a226a4a760d91b61164981612d67565b611634613103565b826daaeb6d7670e522a718067333cd4e3b1561171557336001600160a01b038216036116825761134a84848461314f565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906116b59030903390600401615677565b602060405180830381865afa1580156116d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f69190615691565b6117155733604051633b79c77360e21b81526004016111f09190614f86565b6113ed84848461314f565b60085460009060ff1661173557506000919050565b60026001600160a01b0383166000908152600a602052604090205460ff16600281111561176457611764614fc6565b14806117c057506001600160a01b0382166000908152600a602052604081205460ff16600281111561179857611798614fc6565b1480156117c057506002600854610100900460ff1660028111156117be576117be614fc6565b145b156117cd57506001919050565b506000919050565b606060006117e384846156c4565b6117ee906001615718565b6001600160401b03811115611805576118056153ae565b60405190808252806020026020018201604052801561182e578160200160208202803683370190505b509050600080855b8581116118d65761184681612d71565b8015611856575061185681612838565b1561189157600184848151811061186f5761186f61572b565b911515602092830291909101909101528161188981615741565b9250506118b6565b60008484815181106118a5576118a561572b565b911515602092830291909101909101525b826118c081615741565b93505080806118ce90615741565b915050611836565b506000816001600160401b038111156118f1576118f16153ae565b60405190808252806020026020018201604052801561191a578160200160208202803683370190505b5060009350905082875b8781116119965785858151811061193d5761193d61572b565b602002602001015115611976578083838151811061195d5761195d61572b565b60209081029190910101528161197281615741565b9250505b8461198081615741565b955050808061198e90615741565b915050611924565b5090979650505050505050565b6420a226a4a760d91b6119b581612d67565b6110ef8261316a565b6420a226a4a760d91b6119d081612d67565b50602555565b60008181526024602052604081205481036119f357506000919050565b60008281526023602090815260408083205460249092529091205442916114e491615718565b6420a226a4a760d91b611a2b81612d67565b848314611a3757600080fd5b60005b85811015611aef578215611a9557611a90878783818110611a5d57611a5d61572b565b9050602002016020810190611a729190614f06565b868684818110611a8457611a8461572b565b90506020020135613193565b611add565b611add878783818110611aaa57611aaa61572b565b9050602002016020810190611abf9190614f06565b868684818110611ad157611ad161572b565b905060200201356131ee565b80611ae781615741565b915050611a3a565b50505050505050565b600080611b0483613249565b509392505050565b602a546001600160a01b03163314611b605760405162461bcd60e51b815260206004820152601760248201527637b7363c9031b0b63610333937b69033b4b6b6b4b1b59760491b60448201526064016111f0565b6000908152602860205260409020429055565b6420a226a4a760d91b611b8581612d67565b50602955565b6420a226a4a760d91b611b9d81612d67565b50601755565b60006001600160a01b038216611c115760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b60648201526084016111f0565b506001600160a01b03166000908152602c60205260409020546001600160401b031690565b611c3e612e4b565b611c4860006132e0565b565b6420a226a4a760d91b611c5c81612d67565b6110ef82613332565b600061104360045490565b81611c7a81611af8565b6001600160a01b0316336001600160a01b031614611ced5760405162461bcd60e51b815260206004820152602a60248201527f5265737472696374417070726f76653a206f7065726174696f6e206973206f6e604482015269363c903437b63232b91760b11b60648201526084016111f0565b506000918252600f602052604090912055565b6420a226a4a760d91b611d1281612d67565b611634613377565b6060600080611d2884611ba3565b90506000816001600160401b03811115611d4457611d446153ae565b604051908082528060200260200182016040528015611d6d578160200160208202803683370190505b50905060005b828414611dd757611d8381612d71565b15611dcf57856001600160a01b0316611d9b82611af8565b6001600160a01b031603611dcf5780828580600101965081518110611dc257611dc261572b565b6020026020010181815250505b600101611d73565b50949350505050565b336001600160a01b03831614611e295760405162461bcd60e51b815260206004820152600e60248201526d37b7363c903cb7bab939b2b6331760911b60448201526064016111f0565b60026001600160a01b0383166000908152600a602052604090205460ff166002811115611e5857611e58614fc6565b148015611e7757506002816002811115611e7457611e74614fc6565b14155b15611e97576001600160a01b038216600090815260208052604090204290555b6110ef82826133b4565b6420a226a4a760d91b611eb381612d67565b611ebc8361343d565b50601d5550565b60405162461bcd60e51b81526020600482015260076024820152663737903ab9b29760c91b60448201526064016111f0565b60009182526015602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461110290615643565b6060818310611f805760405162461bcd60e51b815260206004820181905260248201527f7374617274206d7573742062652067726561746572207468616e2073746f702e60448201526064016111f0565b600080611f8c60045490565b905080841115611f9a578093505b6000611fa587611ba3565b905084861015611fc45785850381811015611fbe578091505b50611fc8565b5060005b6000816001600160401b03811115611fe257611fe26153ae565b60405190808252806020026020018201604052801561200b578160200160208202803683370190505b5090508160000361202157935061209f92505050565b865b8681141580156120335750828514155b156120955761204181612d71565b1561208d57886001600160a01b031661205982611af8565b6001600160a01b03160361208d57808286806001019750815181106120805761208061572b565b6020026020010181815250505b600101612023565b5092835250909150505b9392505050565b6420a226a4a760d91b6120b881612d67565b50600e805460ff1916911515919091179055565b816daaeb6d7670e522a718067333cd4e3b1561217557604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906121159030908590600401615677565b602060405180830381865afa158015612132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121569190615691565b6121755780604051633b79c77360e21b81526004016111f09190614f86565b6112c883836134a8565b6420a226a4a760d91b61219181612d67565b506008805460ff1916911515919091179055565b60006121b0826119d6565b80156110b8575060295460008381526028602052604090205442916121d491615718565b1192915050565b836daaeb6d7670e522a718067333cd4e3b156122a557336001600160a01b038216036122125761220d8585858561350f565b6122b1565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906122459030903390600401615677565b602060405180830381865afa158015612262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122869190615691565b6122a55733604051633b79c77360e21b81526004016111f09190614f86565b6122b18585858561350f565b5050505050565b6420a226a4a760d91b6122ca81612d67565b50602655565b60606122db82612d71565b6123155760405162461bcd60e51b815260206004820152600b60248201526a3737ba1032bc34b9ba399760a91b60448201526064016111f0565b602b5460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa15801561235e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110b8919081019061575a565b6420a226a4a760d91b61239881612d67565b50602a80546001600160a01b0319166001600160a01b0392909216919091179055565b6115ba612e4b565b6000611043612da8565b602a54604051632d14c2f960e21b81526001600160a01b039091169063b4530be490349061240790339089908990899089906004016157c7565b6000604051808303818588803b15801561242057600080fd5b505af1158015612434573d6000803e3d6000fd5b505050505060005b838110156122b1576124688585838181106124595761245961572b565b90506040020160000135613541565b61248c85858381811061247d5761247d61572b565b90506040020160200135613541565b6124973360026131ee565b806124a181615741565b91505061243c565b60006124b483611720565b806124c657506124c4838361359b565b155b156124d3575060006110b8565b61209f83836135bb565b60195484906124ed9082906156d7565b34101561252e5760405162461bcd60e51b815260206004820152600f60248201526e3737ba1032b737bab3b41032ba341760891b60448201526064016111f0565b61253b86868686866135e2565b61254533866131ee565b505050505050565b606060008061255b60045490565b905061256782826117d5565b9250505090565b6420a226a4a760d91b61258081612d67565b50602755565b61258e612e4b565b6001600160a01b0381166125f35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016111f0565b611634816132e0565b60005b828110156126875761262884848381811061261c5761261c61572b565b90506020020135611af8565b6001600160a01b0316336001600160a01b0316146126755760405162461bcd60e51b815260206004820152600a6024820152693737ba1037bbb732b91760b11b60448201526064016111f0565b8061267f81615741565b9150506125ff565b50336000908152600a602052604081205460ff16905b838110156127f75760028260028111156126b9576126b9614fc6565b14801561270a57506001600960008787858181106126d9576126d961572b565b602090810292909201358352508101919091526040016000205460ff16600281111561270757612707614fc6565b14155b80156127275750600183600281111561272557612725614fc6565b145b806127af5750600282600281111561274157612741614fc6565b1415801561279257506002600960008787858181106127625761276261572b565b602090810292909201358352508101919091526040016000205460ff16600281111561279057612790614fc6565b145b80156127af575060018360028111156127ad576127ad614fc6565b145b156127e55742601f60008787858181106127cb576127cb61572b565b905060200201358152602001908152602001600020819055505b806127ef81615741565b91505061269d565b506113ed848484613697565b6420a226a4a760d91b61281581612d67565b50602b80546001600160a01b0319166001600160a01b0392909216919091179055565b600061284382612b2b565b8061286857506021546000838152601f6020526040902054429161286691615718565b115b806110b85750426021546020600061287f86611af8565b6001600160a01b03166001600160a01b03168152602001908152602001600020546121d49190615718565b6420a226a4a760d91b6128bc81612d67565b6110ef8261377b565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6001600160a01b0384161580159061291157506001600160a01b03831615155b156113ed5761291f82612838565b156113ed5760405162461bcd60e51b815260206004820152602760248201527f4c6f636b61626c653a2043616e206e6f74207472616e73666572206c6f636b6560448201526632103a37b5b2b760c91b60648201526084016111f0565b612988848484846129a3565b6113ed848484846129cd565b6001600160a01b03163b151590565b6001600160a01b038416156113ed576000828152600960205260409020805460ff191690556113ed565b6001600160a01b038416156113ed576000828152600f60205260408120556113ed565b600881901c600090815260208390526040902054600160ff1b60ff83161c16151592915050565b6000612a2260045490565b821080156110b857508160006114e4565b600881901c60008181526020849052604081205490919060ff808516919082181c8015612a7557612a6381612c1d565b60ff168203600884901b179350612b22565b60008311612ae25760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b60648201526084016111f0565b506000199091016000818152602086905260409020549091908015612b1d57612b0a81612c1d565b60ff0360ff16600884901b179350612b22565b612a75565b50505092915050565b600081612b3781612d71565b612b995760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b61626c653a206c6f636b696e6720717565727920666f72206e6f6e6560448201526c3c34b9ba32b73a103a37b5b2b760991b60648201526084016111f0565b60085460ff16612bac576000915061107a565b600260008481526009602052604090205460ff166002811115612bd157612bd1614fc6565b1480612c0f575060008381526009602052604081205460ff166002811115612bfb57612bfb614fc6565b148015612c0f5750612c0f61093684611af8565b15611071576001915061107a565b60006040518061012001604052806101008152602001615b6f610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff612c66856137c0565b02901c81518110612c7957612c7961572b565b016020015160f81c92915050565b6060611043600c6137d8565b60006001600160e01b031982166380ac58cd60e01b1480612cc457506001600160e01b03198216635b5e139f60e01b145b806110b857506301ffc9a760e01b6001600160e01b03198316146110b8565b60006001600160e01b0319821663152a902d60e11b14806110b857506110b8825b6000612d0f82612c93565b80612d1e5750612d1e826137e5565b80612d2d5750612d2d8261380a565b806110b85750506001600160e01b0319161590565b60006001600160e01b03198216637965db0b60e01b14806110b857506110b882612ce3565b611634813361382f565b6000612d7e6007836129f0565b15612d8b57506000919050565b6110b882612a17565b612d9e8282613893565b6110ef82826138a7565b60045460009081908190612dc09060081c6001615718565b9050815b81811015612e0457600081815260076020526040902054612de4816139b9565b612dee9086615718565b9450508080612dfc90615741565b915050612dc4565b50505090565b60008060045461104391906156c4565b612e2433826139d8565b612e405760405162461bcd60e51b81526004016111f09061584f565b6112c8838383613a9d565b6012546001600160a01b03163314611c485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111f0565b612eaf8282611ef5565b6110ef5760008281526015602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612ee73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6127106001600160601b0382161115612f995760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016111f0565b6001600160a01b038216612feb5760405162461bcd60e51b815260206004820152601960248201527822a921991c9c189d1034b73b30b634b2103932b1b2b4bb32b960391b60448201526064016111f0565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b61302e8282611ef5565b156110ef5760008281526015602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60165461010090046001600160a01b03166130e85760405162461bcd60e51b815260206004820152601e60248201527f77697468647261772061646472657373206973203020616464726573732e000060448201526064016111f0565b601654611c489061010090046001600160a01b031647613c74565b61310b613d8d565b6016805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516131459190614f86565b60405180910390a1565b6112c8838383604051806020016040528060008152506121db565b6008805482919061ff00191661010083600281111561318b5761318b614fc6565b021790555050565b600061319e60045490565b90506131aa8383613dd6565b60005b828110156113ed5760006131c18284615718565b60008181526024602052604081205590506131db81613df0565b50806131e681615741565b9150506131ad565b60005b8181101561323e5760008161320560045490565b61320f9190615718565b6000818152602460205260409020429055905061322b81613df0565b508061323681615741565b9150506131f1565b506110ef8282613dd6565b60008061325583612d71565b6132b65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016111f0565b6132bf83613e71565b6000818152600360205260409020546001600160a01b031694909350915050565b601280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61333d600c82613e7d565b506040516001600160a01b0382169033907f3b01c97343869ca2757fcc37cdb8f71683b0a7aed858e3755f4529a1db85729290600090a350565b61337f613e92565b6016805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586131383390565b6001600160a01b0382166000908152600a60205260409020805482919060ff191660018360028111156133e9576133e9614fc6565b0217905550336001600160a01b0316826001600160a01b03167f9fdb14457e6a7bd3753c649831b026de987c06e52d16459a928540738c2ea34b836040516134319190614fdc565b60405180910390a35050565b6018805460ff1690829061345182826158b2565b50506000601b557f75e3689da7799229d232f2c15fc530f1a386e47a961aea8ccc86ed74cfb4bd4f81613487602085018561590e565b6040805160ff93841681529290911660208301520160405180910390a15050565b6134b133611720565b15806134bb575080155b6134d75760405162461bcd60e51b81526004016111f09061592b565b6134e082613ed8565b806134e9575080155b6135055760405162461bcd60e51b81526004016111f090615962565b6110ef8282613ee4565b61351933836139d8565b6135355760405162461bcd60e51b81526004016111f09061584f565b6113ed84848484613f1c565b600061354c82611af8565b905061355c816000846001613f51565b6135676007836128c5565b60405182906000906001600160a01b03841690600080516020615b4f833981519152908390a46110ef816000846001613f5d565b6000806135a784613fa9565b90506135b38382613feb565b949350505050565b60006135c7838361359b565b15156000036135d8575060006110b8565b61209f8383614084565b8484848484600085338560405160200161361c9392919092835260609190911b6001600160601b0319166020830152603482015260540190565b6040516020818303038152906040528051906020012090506136428383601d54846140ca565b61367f5760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b210383937b7b31760911b60448201526064016111f0565b61368a8b8b8b6140e2565b5050505050505050505050565b60005b828110156113ed5781600960008686858181106136b9576136b961572b565b60209081029290920135835250810191909152604001600020805460ff191660018360028111156136ec576136ec614fc6565b02179055508383828181106137035761370361572b565b90506020020135336001600160a01b031661372986868581811061261c5761261c61572b565b6001600160a01b03167f80a668baf7ac68b329075f26c37b4428d4aa272c3bd4c9611b25f5fb1c473f7c856040516137619190614fdc565b60405180910390a48061377381615741565b91505061369a565b613786600c82614295565b506040516001600160a01b0382169033907fbd0af1fe0a2c1c7bb340c17a284a291138979c8eeb797e176dbd1c415199af3c90600090a350565b60008082116137ce57600080fd5b5060008190031690565b6060600061209f836142aa565b60006001600160e01b03198216632742b5b960e01b14806110b857506110b882612c93565b60006001600160e01b03198216630101c11560e71b14806110b857506110b8826137e5565b6138398282611ef5565b6110ef57613851816001600160a01b03166014614306565b61385c836020614306565b60405160200161386d9291906159af565b60408051601f198184030181529082905262461bcd60e51b82526111f091600401614f73565b61389d82826144a1565b6110ef8282614506565b60006138b282611af8565b9050806001600160a01b0316836001600160a01b0316036139215760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b60648201526084016111f0565b336001600160a01b038216148061393d575061393d81336124a9565b6139af5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c000000000060648201526084016111f0565b6112c88383614581565b60005b81156139d3576000198201909116906001016139bc565b919050565b60006139e382612d71565b613a475760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016111f0565b6000613a5283611af8565b9050806001600160a01b0316846001600160a01b03161480613a8d5750836001600160a01b0316613a8284611185565b6001600160a01b0316145b806135b357506135b381856124a9565b600080613aa983613249565b91509150846001600160a01b0316826001600160a01b031614613b235760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b60648201526084016111f0565b6001600160a01b038416613b895760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b60648201526084016111f0565b613b968585856001613f51565b613ba1600084614581565b6000613bae846001615718565b9050613bbb6000826129f0565b158015613bc9575060045481105b15613bff57600081815260036020526040812080546001600160a01b0319166001600160a01b038916179055613bff90826128c5565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414613c3857613c386000856128c5565b83856001600160a01b0316876001600160a01b0316600080516020615b4f83398151915260405160405180910390a46125458686866001613f5d565b80471015613cc45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016111f0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613d11576040519150601f19603f3d011682016040523d82523d6000602084013e613d16565b606091505b50509050806112c85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016111f0565b60165460ff16611c485760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016111f0565b6110ef8282604051806020016040528060008152506145ef565b6103e8613dfc82614614565b602554613e0991906156d7565b613e139190615704565b602554613e209190615718565b6000828152602260205260409020556103e8613e3b82614614565b602654613e4891906156d7565b613e529190615704565b602654613e5f9190615718565b60009182526023602052604090912055565b60006110b88183612a33565b600061209f836001600160a01b03841661465b565b60165460ff1615611c485760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016111f0565b60006110b8338361359b565b613eed82613ed8565b80613ef6575080155b613f125760405162461bcd60e51b81526004016111f090615962565b6110ef8282614755565b613f27848484613a9d565b613f3584848460018561478e565b6113ed5760405162461bcd60e51b81526004016111f090615a1e565b6113ed848484846128f1565b600082815260286020908152604080832042905560249091528120549003613f915760008281526024602052604090204290555b613f9d848484846148cc565b6113ed8484848461297c565b6001600160a01b03811660009081526010602052604081205415613fe357506001600160a01b031660009081526010602052604090205490565b505060115490565b600e5460009060ff16614000575060016110b8565b61400983614a75565b8061209f5750600b54604051630f8350ed60e41b81526001600160a01b038581166004830152602482018590529091169063f8350ed090604401602060405180830381865afa158015614060573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209f9190615691565b600061408f83611720565b1561409c575060006110b8565b6001600160a01b0380841660009081526006602090815260408083209386168352929052205460ff1661209f565b6000826140d8868685614a82565b1495945050505050565b6140ea613e92565b816017546140f6614ac5565b6141009083615718565b111561414e5760405162461bcd60e51b815260206004820152601d60248201527f636c61696d206973206f76657220746865206d617820737570706c792e00000060448201526064016111f0565b601a54601b548491906141619083615718565b11156141ba5760405162461bcd60e51b815260206004820152602260248201527f636c61696d206973206f76657220746865206d61782073616c6520737570706c6044820152613c9760f11b60648201526084016111f0565b84848480826141c885611048565b6141d29190615718565b11156142205760405162461bcd60e51b815260206004820152601d60248201527f636c61696d206973206f76657220616c6c6f77656420616d6f756e742e00000060448201526064016111f0565b6000601854610100900460ff16600181111561423e5761423e614fc6565b146142815760405162461bcd60e51b81526020600482015260136024820152723737ba1031b630b4b69039b0b632903737bb9760691b60448201526064016111f0565b61428b8888614acf565b5050505050505050565b600061209f836001600160a01b038416614b42565b6060816000018054806020026020016040519081016040528092919081815260200182805480156142fa57602002820191906000526020600020905b8154815260200190600101908083116142e6575b50505050509050919050565b606060006143158360026156d7565b614320906002615718565b6001600160401b03811115614337576143376153ae565b6040519080825280601f01601f191660200182016040528015614361576020820181803683370190505b509050600360fc1b8160008151811061437c5761437c61572b565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106143ab576143ab61572b565b60200101906001600160f81b031916908160001a90535060006143cf8460026156d7565b6143da906001615718565b90505b6001811115614452576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061440e5761440e61572b565b1a60f81b8282815181106144245761442461572b565b60200101906001600160f81b031916908160001a90535060049490941c9361444b81615a73565b90506143dd565b50831561209f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016111f0565b6144aa81612838565b156110ef5760405162461bcd60e51b815260206004820152602660248201527f4c6f636b61626c653a2043616e206e6f7420617070726f7665206c6f636b6564604482015265103a37b5b2b760d11b60648201526084016111f0565b6001600160a01b038216156110ef5761451f8183614b91565b6110ef5760405162461bcd60e51b815260206004820152602d60248201527f5265737472696374417070726f76653a2054686520636f6e747261637420697360448201526c103737ba1030b63637bbb2b21760991b60648201526084016111f0565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906145b682611af8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006145fa60045490565b90506146068484614b9e565b613f3560008583868661478e565b6027546000906146256001436156c4565b604080519140602083015281018490526060016040516020818303038152906040528051906020012060001c6110b89190615a8a565b6000818152600183016020526040812054801561474457600061467f6001836156c4565b8554909150600090614693906001906156c4565b90508181146146f85760008660000182815481106146b3576146b361572b565b90600052602060002001549050808760000184815481106146d6576146d661572b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061470957614709615a9e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110b8565b60009150506110b8565b5092915050565b61475e33611720565b1580614768575080155b6147845760405162461bcd60e51b81526004016111f09061592b565b6110ef8282614d18565b60006147a2856001600160a01b0316612994565b156148bf57506001835b6147b68486615718565b8110156148b957604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906147ef9033908b9086908990600401615ab4565b6020604051808303816000875af192505050801561482a575060408051601f3d908101601f1916820190925261482791810190615af1565b60015b614887573d808015614858576040519150601f19603f3d011682016040523d82523d6000602084013e61485d565b606091505b50805160000361487f5760405162461bcd60e51b81526004016111f090615a1e565b805181602001fd5b8280156148a457506001600160e01b03198116630a85bd0160e11b145b925050806148b181615741565b9150506147ac565b506148c3565b5060015b95945050505050565b600160401b81106148dc57600080fd5b806001600160a01b03851615614946576001600160a01b0385166000908152602c60205260408120805483929061491d9084906001600160401b0316615b0e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506149a6565b6001600160a01b0384166000908152602c602052604090208054829190600890614981908490600160401b90046001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b03841615614a0f576001600160a01b0384166000908152602c6020526040812080548392906149e69084906001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506122b1565b6001600160a01b0385166000908152602c602052604090208054829190601090614a4a908490600160801b90046001600160401b0316615b2e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050505050565b60006110b8600c83614dd5565b600081815b84811015611dd757614ab182878784818110614aa557614aa561572b565b90506020020135614df7565b915080614abd81615741565b915050614a87565b60006110436112fd565b6000828152601c60205260409020601854815460ff918216911603614b0d5781816001016000828254614b029190615718565b90915550614b269050565b601854815460ff191660ff909116178155600181018290555b81601b6000828254614b389190615718565b9091555050505050565b6000818152600183016020526040812054614b89575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110b8565b5060006110b8565b6000806135a73385614e26565b6000614ba960045490565b905060008211614c095760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b60648201526084016111f0565b6001600160a01b038316614c6b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b60648201526084016111f0565b614c786000848385613f51565b8160046000828254614c8a9190615718565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b038616179055614cc090826128c5565b614ccd6000848385613f5d565b805b614cd98383615718565b8110156113ed5760405181906001600160a01b03861690600090600080516020615b4f833981519152908290a480614d1081615741565b915050614ccf565b336001600160a01b03831603614d705760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c65720000000060448201526064016111f0565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101613431565b6001600160a01b0381166000908152600183016020526040812054151561209f565b6000818310614e1357600082815260208490526040902061209f565b600083815260208390526040902061209f565b6000818152600f602052604081205415614e4f57506000818152600f60205260409020546110b8565b61209f83613fa9565b6020808252825182820181905260009190848201906040850190845b81811015614e995783516001600160a01b031683529284019291840191600101614e74565b50909695505050505050565b600060208284031215614eb757600080fd5b5035919050565b6001600160e01b03198116811461163457600080fd5b600060208284031215614ee657600080fd5b813561209f81614ebe565b6001600160a01b038116811461163457600080fd5b600060208284031215614f1857600080fd5b813561209f81614ef1565b60005b83811015614f3e578181015183820152602001614f26565b50506000910152565b60008151808452614f5f816020860160208601614f23565b601f01601f19169290920160200192915050565b60208152600061209f6020830184614f47565b6001600160a01b0391909116815260200190565b60008060408385031215614fad57600080fd5b8235614fb881614ef1565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310614ff057614ff0614fc6565b91905290565b60008060006060848603121561500b57600080fd5b833561501681614ef1565b9250602084013561502681614ef1565b929592945050506040919091013590565b6000806040838503121561504a57600080fd5b50508035926020909101359150565b6000806040838503121561506c57600080fd5b82359150602083013561507e81614ef1565b809150509250929050565b60006020828403121561509b57600080fd5b81356001600160601b038116811461209f57600080fd5b60008083601f8401126150c457600080fd5b5081356001600160401b038111156150db57600080fd5b6020830191508360208260051b850101111561149a57600080fd5b6000806000806000806080878903121561510f57600080fd5b8635955060208701356001600160401b038082111561512d57600080fd5b6151398a838b016150b2565b909750955060408901359450606089013591508082111561515957600080fd5b5061516689828a016150b2565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b81811015614e9957835183529284019291840191600101615194565b8035600381106139d357600080fd5b6000602082840312156151d157600080fd5b61209f826151b0565b60ff8516815260808101600285106151f4576151f4614fc6565b84602083015283604083015282606083015295945050505050565b801515811461163457600080fd5b60008060008060006060868803121561523557600080fd5b85356001600160401b038082111561524c57600080fd5b61525889838a016150b2565b9097509550602088013591508082111561527157600080fd5b5061527e888289016150b2565b90945092505060408601356152928161520f565b809150509295509295909350565b600080604083850312156152b357600080fd5b82356152be81614ef1565b91506152cc602084016151b0565b90509250929050565b60006080828403121561107a57600080fd5b60008060a083850312156152fa57600080fd5b61530484846152d5565b946080939093013593505050565b60006080828403121561532457600080fd5b61209f83836152d5565b60008060006060848603121561534357600080fd5b833561534e81614ef1565b95602085013595506040909401359392505050565b60006020828403121561537557600080fd5b813561209f8161520f565b6000806040838503121561539357600080fd5b823561539e81614ef1565b9150602083013561507e8161520f565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156153ec576153ec6153ae565b604052919050565b60006001600160401b0382111561540d5761540d6153ae565b50601f01601f191660200190565b6000806000806080858703121561543157600080fd5b843561543c81614ef1565b9350602085013561544c81614ef1565b92506040850135915060608501356001600160401b0381111561546e57600080fd5b8501601f8101871361547f57600080fd5b803561549261548d826153f4565b6153c4565b8181528860208385010111156154a757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600080604085870312156154df57600080fd5b84356001600160401b03808211156154f657600080fd5b818701915087601f83011261550a57600080fd5b81358181111561551957600080fd5b8860208260061b850101111561552e57600080fd5b60209283019650945090860135908082111561554957600080fd5b50615556878288016150b2565b95989497509550505050565b6000806040838503121561557557600080fd5b823561558081614ef1565b9150602083013561507e81614ef1565b6000806000806000608086880312156155a857600080fd5b85359450602086013593506040860135925060608601356001600160401b038111156155d357600080fd5b6155df888289016150b2565b969995985093965092949392505050565b60008060006040848603121561560557600080fd5b83356001600160401b0381111561561b57600080fd5b615627868287016150b2565b909450925061563a9050602085016151b0565b90509250925092565b600181811c9082168061565757607f821691505b60208210810361107a57634e487b7160e01b600052602260045260246000fd5b6001600160a01b0392831681529116602082015260400190565b6000602082840312156156a357600080fd5b815161209f8161520f565b634e487b7160e01b600052601160045260246000fd5b818103818111156110b8576110b86156ae565b80820281158282048414176110b8576110b86156ae565b634e487b7160e01b600052601260045260246000fd5b600082615713576157136156ee565b500490565b808201808211156110b8576110b86156ae565b634e487b7160e01b600052603260045260246000fd5b600060018201615753576157536156ae565b5060010190565b60006020828403121561576c57600080fd5b81516001600160401b0381111561578257600080fd5b8201601f8101841361579357600080fd5b80516157a161548d826153f4565b8181528560208385010111156157b657600080fd5b6148c3826020830160208601614f23565b6001600160a01b038616815260606020808301829052908201859052600090869060808401835b8881101561581457833582528284013583830152604093840193909101906001016157ee565b5084810360408601528581526001600160fb1b0386111561583457600080fd5b8560051b925082878383013790910101979650505050505050565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b60ff8116811461163457600080fd5b81356158bd816158a3565b60ff8116905081548160ff1982161783556020840135600281106158e057600080fd5b61ff008160081b168361ffff1984161717845550505060408201356001820155606082013560028201555050565b60006020828403121561592057600080fd5b813561209f816158a3565b6020808252601c908201527f43616e206e6f7420617070726f7665206c6f636b656420746f6b656e00000000604082015260600190565b6020808252602d908201527f5265737472696374417070726f76653a2043616e206e6f7420617070726f766560408201526c103637b1b5b2b2103a37b5b2b760991b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516159e1816017850160208801614f23565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615a12816028840160208801614f23565b01602801949350505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b600081615a8257615a826156ae565b506000190190565b600082615a9957615a996156ee565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615ae790830184614f47565b9695505050505050565b600060208284031215615b0357600080fd5b815161209f81614ebe565b6001600160401b0382811682821603908082111561474e5761474e6156ae565b6001600160401b0381811683821601908082111561474e5761474e6156ae56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a264697066735822122085a655f44993efbdf29e985818b76679c867d908f2e19560f21c67de991ba69d64736f6c63430008110033

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

000000000000000000000000c57e443a24892ac9f721d66ac4b31eda426bff69000000000000000000000000000000000000000000000000000000000000000a

-----Decoded View---------------
Arg [0] : ownerAddress (address): 0xC57E443A24892ac9f721d66AC4b31EDa426Bff69
Arg [1] : ownerMintAmount (uint256): 10

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c57e443a24892ac9f721d66ac4b31eda426bff69
Arg [1] : 000000000000000000000000000000000000000000000000000000000000000a


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.