Contract 0x9af0a33b1ec0518b085c73da984286348f0baeb7

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x78fffd5495893bee6d89f08645ec9644a803aaf4450cdd7748efe11d7b8eb119Withdraw Fees285570352022-05-20 17:48:21314 days 22 hrs ago0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb IN  Pot Heads: POTS Token0 MATIC0.001118797643 34.055693511
0x2f6c8ef89c5c4e7823a853e03a643d1d7bf47306ffcccb922bb85c98cd6e446bMint285554352022-05-20 16:48:58314 days 23 hrs ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token146 MATIC0.114370425374 60.39142356
0x0dfc5535dc9328f3b0ae4215f5a85e066f6a45e9f338445298025cd104bc954dMint285546492022-05-20 16:21:57315 days 11 mins ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC1.261645860905 69.816850921
0x7ffbef715751d371dbc88d66bc61958646d56dfa26ccfc8f1f1499c2abd707ccMint285536022022-05-20 15:45:59315 days 47 mins ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token2 MATIC0.003550490661 54.255664141
0xd8680a7f1e8857fadf3447acc11c27f74685b1319196cb9328e75ac145984236Mint285536022022-05-20 15:45:59315 days 47 mins ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC1.072363636819 59.342367367
0x68b26dc6037ce53cd661c24140e6b57ad583e3e008d31f844217a93727e6fdc7Mint285535262022-05-20 15:41:11315 days 52 mins ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.713026071525 39.457375862
0x71eba33b499f55717b3ce256e9a74dcca9dfaaebf1fefad26442b7bfb03d6c52Mint285534962022-05-20 15:40:11315 days 53 mins ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.752369782311 41.63457477
0xb3aa8df0a126384576cc86522704a06aab3f3cc330dbc5e2a3bb833dc8b7f71fWithdraw Fees285525872022-05-20 15:08:57315 days 1 hr ago0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb IN  Pot Heads: POTS Token0 MATIC0.00632151358 192.424010122
0xbf89a0a00948a52ced72b73fcf8b865bb94fe73774edd29cf6e1c89cfb41390aMint285359372022-05-20 5:00:21315 days 11 hrs ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.76362834177 42.257599972
0x3ec552dfafccdf61bec839f74b4ef3d6732c863eb595ff48144086144ee953f4Mint285358152022-05-20 4:56:09315 days 11 hrs ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.779212593852 43.119999983
0x3f9324ee811a3fd8be19c0f93eab4977607ebef3d1ac886bb5a8fd600674bedaMint285357502022-05-20 4:53:55315 days 11 hrs ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.665117642492 36.806223307
0xfe4fb19c3fd2bedba5237183073e35a8d7eed3ebef46095a2ee8ec95df6d1cb7Mint285357432022-05-20 4:53:37315 days 11 hrs ago0x722a9f8240f8af61e0131298f68e93a617d50134 IN  Pot Heads: POTS Token1,420 MATIC0.698693343076 38.627680022
0xc9edc8af450af49ca251ecce0f933e07a29f21362e00618d86aefd1783af509aWithdraw Fees285351692022-05-20 4:33:37315 days 11 hrs ago0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb IN  Pot Heads: POTS Token0 MATIC0.001161850873 35.366214332
0xd38a967c1416ff63182b36bfb4c9cdedd9ff84cd6c3fb32b25b92b07aec889dcMint285346792022-05-20 4:16:45315 days 12 hrs ago0xde5b3720cb11d7b50c844492806d5125ff6e24e9 IN  Pot Heads: POTS Token50 MATIC0.024413654157 35.279999997
0x4b9ffe2d34a13c852b6fddeb843f672e829f44a70490eb051fbcc6dffa422d9aMint285346622022-05-20 4:16:11315 days 12 hrs ago0x86e6899e6915e513635056c94b447092836588d7 IN  Pot Heads: POTS Token50 MATIC0.022389454252 32.354842943
0x3a7aed3adabc6b8580caadb8772657d2df5904799b4e2a23739178567ac537a2Mint285346442022-05-20 4:15:31315 days 12 hrs ago0xdfcbcd37d6144bdba27b56b5ec57337c6820de8b IN  Pot Heads: POTS Token50 MATIC0.022888717177 33.076324287
0xab0912b288cb90284a846a63ac3b501b257156751aa8aae472fadeacbe2575cbMint285346312022-05-20 4:15:05315 days 12 hrs ago0xa4c69b4c89657cd533fb1ab15705695c4e4a9a82 IN  Pot Heads: POTS Token50 MATIC0.022716141182 32.826935929
0xda444159909e6f83f188dfb68543a12fb70b42240afd30b339b476aeb24a7211Mint285346122022-05-20 4:14:27315 days 12 hrs ago0xb400829ed5a6a45ab6f7fe45865091aaca613650 IN  Pot Heads: POTS Token50 MATIC0.021283415206 30.756513693
0x1964be8ffefa77250e7892af575b7caaa979bbef4f5c91f4e21f6d7b815d43aaMint285346002022-05-20 4:14:03315 days 12 hrs ago0x1a121130b193ded6dbbfa3ee9db2aefa56cda6f3 IN  Pot Heads: POTS Token50 MATIC0.023735497102 34.300000003
0xa913740175f8cc85e4140e95e71d7b7121be9934a01c39cf232752ba71996ef9Mint285345892022-05-20 4:13:37315 days 12 hrs ago0xa8e781feec047b512dc9d920d3ca79869b63255c IN  Pot Heads: POTS Token50 MATIC0.021302172163 30.78361924
0xcd886976dacdc0a5a29f4ae401ad7b2dc459e3410e13f01901c1147546a87c9fMint285345312022-05-20 4:11:40315 days 12 hrs ago0x5873a3c8d37afc8266e6473dbe5bd4bc84a61a22 IN  Pot Heads: POTS Token50 MATIC0.021411791831 30.942029852
0xd453885c6249bcc6dde3fab40489afcb060b974e50e93e24adbfe8e040c62ddaMint285342252022-05-20 4:01:08315 days 12 hrs ago0x03b3995f2e74000722b4012d3c48b93791f07d0a IN  Pot Heads: POTS Token50 MATIC0.028411162346 41.056770978
0xbc6a277d13e2d7cb41c825febd29a19f0e52f1db3eceb9bb8eb694c3cac4d1bdMint285342072022-05-20 4:00:28315 days 12 hrs ago0xec6999a0138d6f2bbdf67af936a3c5e760e80c72 IN  Pot Heads: POTS Token50 MATIC0.024470619297 35.36231992
0xff0394aa8478bbbaa171a380af4537b1d44721280fa38ebb8cf45ce2f036fcfeMint285341952022-05-20 4:00:04315 days 12 hrs ago0x4bbb66bfb98ca007000a9311398c225bcd60f5d4 IN  Pot Heads: POTS Token50 MATIC0.021448353125 30.994864321
0x4187534ecdd13a7501ab5836d13e00be690c534bae966daacadf134ee12cd114Mint285341802022-05-20 3:59:34315 days 12 hrs ago0x4c5a70ca72e6fc78c252520690fbd7c4bb4fdbc5 IN  Pot Heads: POTS Token50 MATIC0.021886074619 31.627412575
[ Download CSV Export 

OVERVIEW

Pot Heads are digital collectables living on the Polygon Ecosystem. Each Pot Head is unique and programmatically generated from over 100 possible traits.

Latest 4 internal transactions
Parent Txn Hash Block From To Value
0x78fffd5495893bee6d89f08645ec9644a803aaf4450cdd7748efe11d7b8eb119285570352022-05-20 17:48:21314 days 22 hrs ago Pot Heads: POTS Token0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb5,828 MATIC
0xb3aa8df0a126384576cc86522704a06aab3f3cc330dbc5e2a3bb833dc8b7f71f285525872022-05-20 15:08:57315 days 1 hr ago Pot Heads: POTS Token0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb5,680 MATIC
0xc9edc8af450af49ca251ecce0f933e07a29f21362e00618d86aefd1783af509a285351692022-05-20 4:33:37315 days 11 hrs ago Pot Heads: POTS Token0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb4,700 MATIC
0x616b70658b651875e4855e9af6522946d26a4a2d79d14b280b718109db1f9729278058972022-05-01 18:50:48333 days 21 hrs ago Pot Heads: POTS Token0x6cbd092ee8614eadc1a122ddabf3e0242fbb65eb3,792 MATIC
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x19Aa68cdDfad3907BF73E1942c9c44Bc013d2D28

Contract Name:
NFTCollectionContract

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 20 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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, _msgSender());
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view 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.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

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

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

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * 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.
     */
    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.
     */
    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 20 : 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 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "./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 payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 5 of 20 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

    function _isConstructor() private view returns (bool) {
        return !Address.isContract(address(this));
    }
}

File 6 of 20 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

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

    /**
     * @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 (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

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

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

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

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

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: 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), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_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), "ERC721: 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), "ERC721: 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, _data), "ERC721: 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`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @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), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @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 owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), 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 {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 7 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

File 8 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 9 of 20 : 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 10 of 20 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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)
        external
        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:
     *
     * - `tokenId` must be already minted.
     * - `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 11 of 20 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 20 : 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 13 of 20 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 14 of 20 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees 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.
 */
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 Returns the rebuilt hash obtained by traversing a Merklee 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++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 15 of 20 : 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 16 of 20 : 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 17 of 20 : NFTCollectionContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../templates/NFTCollection.sol";

contract NFTCollectionContract is NFTCollection {
    constructor(
        DeploymentConfig memory deploymentConfig,
        RuntimeConfig memory runtimeConfig
    ) {
        _preventInitialization = false;
        initialize(deploymentConfig, runtimeConfig);
    }
}

File 18 of 20 : Base64.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
    bytes internal constant TABLE =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
        uint256 len = data.length;
        if (len == 0) return "";

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((len + 2) / 3);

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(
                    out,
                    and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)
                )
                out := shl(8, out)
                out := add(
                    out,
                    and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)
                )
                out := shl(8, out)
                out := add(
                    out,
                    and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)
                )
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

File 19 of 20 : ERC2981.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";

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

File 20 of 20 : NFTCollection.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

import "../lib/ERC2981.sol";
import "../lib/Base64.sol";

contract NFTCollection is ERC721, ERC2981, AccessControl, Initializable {
    using Address for address payable;
    using Strings for uint256;

    /// Fixed at deployment time
    struct DeploymentConfig {
        /// Name of the NFT contract.
        string name;
        /// Symbol of the NFT contract.
        string symbol;
        /// The contract owner address. If you wish to own the contract, then set it as your wallet address.
        /// This is also the wallet that can manage the contract on NFT marketplaces. Use `transferOwnership()`
        /// to update the contract owner.
        address owner;
        /// The maximum number of tokens that can be minted in this collection.
        uint256 maxSupply;
        /// Minting price per token.
        uint256 mintPrice;
        /// The maximum number of tokens the user can mint per transaction.
        uint256 tokensPerMint;
        /// Treasury address is the address where minting fees can be withdrawn to.
        /// Use `withdrawFees()` to transfer the entire contract balance to the treasury address.
        address payable treasuryAddress;
    }

    /// Updatable by admins and owner
    struct RuntimeConfig {
        /// Metadata base URI for tokens, NFTs minted in this contract will have metadata URI of `baseURI` + `tokenID`.
        /// Set this to reveal token metadata.
        string baseURI;
        /// If true, the base URI of the NFTs minted in the specified contract can be updated after minting (token URIs
        /// are not frozen on the contract level). This is useful for revealing NFTs after the drop. If false, all the
        /// NFTs minted in this contract are frozen by default which means token URIs are non-updatable.
        bool metadataUpdatable;
        /// Starting timestamp for public minting.
        uint256 publicMintStart;
        /// Starting timestamp for whitelisted/presale minting.
        uint256 presaleMintStart;
        /// Pre-reveal token URI for placholder metadata. This will be returned for all token IDs until a `baseURI`
        /// has been set.
        string prerevealTokenURI;
        /// Root of the Merkle tree of whitelisted addresses. This is used to check if a wallet has been whitelisted
        /// for presale minting.
        bytes32 presaleMerkleRoot;
        /// Secondary market royalties in basis points (100 bps = 1%)
        uint256 royaltiesBps;
        /// Address for royalties
        address royaltiesAddress;
    }

    struct ContractInfo {
        uint256 version;
        DeploymentConfig deploymentConfig;
        RuntimeConfig runtimeConfig;
    }

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

    /*************
     * Constants *
     *************/

    /// Contract version, semver-style uint X_YY_ZZ
    uint256 public constant VERSION = 1_01_00;

    /// Admin role
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    // Basis for calculating royalties.
    // This has to be 10k for royaltiesBps to be in basis points.
    uint16 constant ROYALTIES_BASIS = 10000;

    /********************
     * Public variables *
     ********************/

    /// The number of currently minted tokens
    /// @dev Managed by the contract
    uint256 public totalSupply;

    /***************************
     * Contract initialization *
     ***************************/

    constructor() ERC721("", "") {
        _preventInitialization = true;
    }

    /// Contract initializer
    function initialize(
        DeploymentConfig memory deploymentConfig,
        RuntimeConfig memory runtimeConfig
    ) public initializer {
        require(!_preventInitialization, "Cannot be initialized");
        _validateDeploymentConfig(deploymentConfig);

        _grantRole(ADMIN_ROLE, msg.sender);
        _grantRole(ADMIN_ROLE, deploymentConfig.owner);
        _grantRole(DEFAULT_ADMIN_ROLE, deploymentConfig.owner);

        _deploymentConfig = deploymentConfig;
        _runtimeConfig = runtimeConfig;
    }

    /****************
     * User actions *
     ****************/

    /// Mint tokens
    function mint(uint256 amount) external payable {
        require(mintingActive(), "Minting has not started yet");

        _mintTokens(msg.sender, amount);
    }

    /// Mint tokens if the wallet has been whitelisted
    function presaleMint(uint256 amount, bytes32[] calldata proof)
        external
        payable
    {
        require(presaleActive(), "Presale has not started yet");
        require(
            isWhitelisted(msg.sender, proof),
            "Not whitelisted for presale"
        );

        _presaleMinted[msg.sender] = true;
        _mintTokens(msg.sender, amount);
    }

    /******************
     * View functions *
     ******************/

    /// Check if public minting is active
    function mintingActive() public view returns (bool) {
        return block.timestamp > _runtimeConfig.publicMintStart;
    }

    /// Check if presale minting is active
    function presaleActive() public view returns (bool) {
        return block.timestamp > _runtimeConfig.presaleMintStart;
    }

    /// Check if the wallet is whitelisted for the presale
    function isWhitelisted(address wallet, bytes32[] calldata proof)
        public
        view
        returns (bool)
    {
        require(!_presaleMinted[wallet], "Already minted");

        bytes32 leaf = keccak256(abi.encodePacked(wallet));

        return
            MerkleProof.verify(proof, _runtimeConfig.presaleMerkleRoot, leaf);
    }

    /// Contract owner address
    /// @dev Required for easy integration with OpenSea
    function owner() public view returns (address) {
        return _deploymentConfig.owner;
    }

    /*******************
     * Access controls *
     *******************/

    /// Transfer contract ownership
    function transferOwnership(address newOwner)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(newOwner != _deploymentConfig.owner, "Already the owner");

        _revokeRole(ADMIN_ROLE, _deploymentConfig.owner);
        _revokeRole(DEFAULT_ADMIN_ROLE, _deploymentConfig.owner);

        address previousOwner = _deploymentConfig.owner;
        _deploymentConfig.owner = newOwner;

        _grantRole(ADMIN_ROLE, _deploymentConfig.owner);
        _grantRole(DEFAULT_ADMIN_ROLE, _deploymentConfig.owner);

        emit OwnershipTransferred(previousOwner, newOwner);
    }

    /// Transfer contract ownership
    function transferAdminRights(address to) external onlyRole(ADMIN_ROLE) {
        require(!hasRole(ADMIN_ROLE, to), "Already an admin");
        require(msg.sender != _deploymentConfig.owner, "Use transferOwnership");

        _revokeRole(ADMIN_ROLE, msg.sender);
        _grantRole(ADMIN_ROLE, to);
    }

    /*****************
     * Admin actions *
     *****************/

    /// Get full contract information
    /// @dev Convenience helper
    function getInfo() external view returns (ContractInfo memory info) {
        info.version = VERSION;
        info.deploymentConfig = _deploymentConfig;
        info.runtimeConfig = _runtimeConfig;
    }

    /// Update contract configuration
    /// @dev Callable by admin roles only
    function updateConfig(RuntimeConfig calldata newConfig)
        external
        onlyRole(ADMIN_ROLE)
    {
        _validateRuntimeConfig(newConfig);
        _runtimeConfig = newConfig;
    }

    /// Withdraw minting fees to the treasury address
    /// @dev Callable by admin roles only
    function withdrawFees() external onlyRole(ADMIN_ROLE) {
        _deploymentConfig.treasuryAddress.sendValue(address(this).balance);
    }

    /*************
     * Internals *
     *************/

    /// Contract configuration
    RuntimeConfig internal _runtimeConfig;
    DeploymentConfig internal _deploymentConfig;

    /// Flag for disabling initalization for template contracts
    bool internal _preventInitialization;

    /// Mapping for tracking presale mint status
    mapping(address => bool) internal _presaleMinted;

    /// @dev Internal function for performing token mints
    function _mintTokens(address to, uint256 amount) internal {
        require(amount <= _deploymentConfig.tokensPerMint, "Amount too large");
        require(
            msg.value >= amount * _deploymentConfig.mintPrice,
            "Payment too small"
        );

        uint256 newSupply = totalSupply + amount;
        require(
            newSupply <= _deploymentConfig.maxSupply,
            "Maximum supply reached"
        );

        // Update totalSupply only once with the total minted amount
        totalSupply = newSupply;
        // Mint the required amount of tokens,
        // starting with the highest token ID
        for (uint256 i = 1; i <= amount; i++) {
            _safeMint(to, totalSupply - i);
        }
    }

    /// Validate deployment config
    function _validateDeploymentConfig(DeploymentConfig memory config)
        internal
        pure
    {
        require(config.maxSupply > 0, "Maximum supply must be non-zero");
        require(config.tokensPerMint > 0, "Tokens per mint must be non-zero");
        require(
            config.treasuryAddress != address(0),
            "Treasury address cannot be the null address"
        );
        require(config.owner != address(0), "Contract must have an owner");
    }

    /// Validate a runtime configuration change
    function _validateRuntimeConfig(RuntimeConfig calldata config)
        internal
        view
    {
        // Can't set royalties to more than 100%
        require(config.royaltiesBps <= ROYALTIES_BASIS, "Royalties too high");

        // If metadata is updatable, we don't have any other limitations
        if (_runtimeConfig.metadataUpdatable) return;

        // If it isn't, has we can't allow the flag to change anymore
        require(
            _runtimeConfig.metadataUpdatable == config.metadataUpdatable,
            "Cannot unfreeze metadata"
        );

        // We also can't allow base URI to change
        require(
            keccak256(abi.encodePacked(_runtimeConfig.baseURI)) ==
                keccak256(abi.encodePacked(config.baseURI)),
            "Metadata is frozen"
        );
    }

    /// @dev See {IERC165-supportsInterface}.
    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, AccessControl, ERC2981)
        returns (bool)
    {
        return
            ERC721.supportsInterface(interfaceId) ||
            AccessControl.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId);
    }

    /// Get the token metadata URI
    function tokenURI(uint256 tokenId)
        public
        view
        override
        returns (string memory)
    {
        require(_exists(tokenId), "Token does not exist");

        return
            bytes(_runtimeConfig.baseURI).length > 0
                ? string(
                    abi.encodePacked(_runtimeConfig.baseURI, tokenId.toString())
                )
                : _runtimeConfig.prerevealTokenURI;
    }

    /// @dev Need name() to support setting it in the initializer instead of constructor
    function name() public view override returns (string memory) {
        return _deploymentConfig.name;
    }

    /// @dev Need symbol() to support setting it in the initializer instead of constructor
    function symbol() public view override returns (string memory) {
        return _deploymentConfig.symbol;
    }

    /// @dev ERC2981 token royalty info
    function royaltyInfo(uint256, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount)
    {
        receiver = _runtimeConfig.royaltiesAddress;
        royaltyAmount =
            (_runtimeConfig.royaltiesBps * salePrice) /
            ROYALTIES_BASIS;
    }

    /// @dev OpenSea contract metadata
    function contractURI() external view returns (string memory) {
        string memory json = Base64.encode(
            bytes(
                string(
                    abi.encodePacked(
                        '{"seller_fee_basis_points": ',
                        _runtimeConfig.royaltiesBps.toString(),
                        ', "fee_recipient": "',
                        uint256(uint160(_runtimeConfig.royaltiesAddress))
                            .toHexString(20),
                        '"}'
                    )
                )
            )
        );

        string memory output = string(
            abi.encodePacked("data:application/json;base64,", json)
        );

        return output;
    }

    /***********************
     * Convenience getters *
     ***********************/

    function maxSupply() public view returns (uint256) {
        return _deploymentConfig.maxSupply;
    }

    function mintPrice() public view returns (uint256) {
        return _deploymentConfig.mintPrice;
    }

    function tokensPerMint() public view returns (uint256) {
        return _deploymentConfig.tokensPerMint;
    }

    function treasuryAddress() public view returns (address) {
        return _deploymentConfig.treasuryAddress;
    }

    function publicMintStart() public view returns (uint256) {
        return _runtimeConfig.publicMintStart;
    }

    function presaleMintStart() public view returns (uint256) {
        return _runtimeConfig.presaleMintStart;
    }

    function presaleMerkleRoot() public view returns (bytes32) {
        return _runtimeConfig.presaleMerkleRoot;
    }

    function baseURI() public view returns (string memory) {
        return _runtimeConfig.baseURI;
    }

    function metadataUpdatable() public view returns (bool) {
        return _runtimeConfig.metadataUpdatable;
    }

    function prerevealTokenURI() public view returns (string memory) {
        return _runtimeConfig.prerevealTokenURI;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"tokensPerMint","type":"uint256"},{"internalType":"address payable","name":"treasuryAddress","type":"address"}],"internalType":"struct NFTCollection.DeploymentConfig","name":"deploymentConfig","type":"tuple"},{"components":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"metadataUpdatable","type":"bool"},{"internalType":"uint256","name":"publicMintStart","type":"uint256"},{"internalType":"uint256","name":"presaleMintStart","type":"uint256"},{"internalType":"string","name":"prerevealTokenURI","type":"string"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"royaltiesBps","type":"uint256"},{"internalType":"address","name":"royaltiesAddress","type":"address"}],"internalType":"struct NFTCollection.RuntimeConfig","name":"runtimeConfig","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInfo","outputs":[{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"tokensPerMint","type":"uint256"},{"internalType":"address payable","name":"treasuryAddress","type":"address"}],"internalType":"struct NFTCollection.DeploymentConfig","name":"deploymentConfig","type":"tuple"},{"components":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"metadataUpdatable","type":"bool"},{"internalType":"uint256","name":"publicMintStart","type":"uint256"},{"internalType":"uint256","name":"presaleMintStart","type":"uint256"},{"internalType":"string","name":"prerevealTokenURI","type":"string"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"royaltiesBps","type":"uint256"},{"internalType":"address","name":"royaltiesAddress","type":"address"}],"internalType":"struct NFTCollection.RuntimeConfig","name":"runtimeConfig","type":"tuple"}],"internalType":"struct NFTCollection.ContractInfo","name":"info","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"tokensPerMint","type":"uint256"},{"internalType":"address payable","name":"treasuryAddress","type":"address"}],"internalType":"struct NFTCollection.DeploymentConfig","name":"deploymentConfig","type":"tuple"},{"components":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"metadataUpdatable","type":"bool"},{"internalType":"uint256","name":"publicMintStart","type":"uint256"},{"internalType":"uint256","name":"presaleMintStart","type":"uint256"},{"internalType":"string","name":"prerevealTokenURI","type":"string"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"royaltiesBps","type":"uint256"},{"internalType":"address","name":"royaltiesAddress","type":"address"}],"internalType":"struct NFTCollection.RuntimeConfig","name":"runtimeConfig","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"isWhitelisted","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":"metadataUpdatable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"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":"prerevealTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"presaleMintStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensPerMint","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":"to","type":"address"}],"name":"transferAdminRights","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"metadataUpdatable","type":"bool"},{"internalType":"uint256","name":"publicMintStart","type":"uint256"},{"internalType":"uint256","name":"presaleMintStart","type":"uint256"},{"internalType":"string","name":"prerevealTokenURI","type":"string"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"royaltiesBps","type":"uint256"},{"internalType":"address","name":"royaltiesAddress","type":"address"}],"internalType":"struct NFTCollection.RuntimeConfig","name":"newConfig","type":"tuple"}],"name":"updateConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620045bb380380620045bb833981016040819052620000349162000860565b604080516020808201808452600080845284519283019094528382528251929391926200006392919062000596565b5080516200007990600190602084019062000596565b50506018805460ff19169055506200009282826200009a565b5050620009a5565b600754610100900460ff16620000b75760075460ff1615620000c1565b620000c162000349565b6200012a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600754610100900460ff161580156200014d576007805461ffff19166101011790555b60185460ff1615620001a25760405162461bcd60e51b815260206004820152601560248201527f43616e6e6f7420626520696e697469616c697a65640000000000000000000000604482015260640162000121565b620001ad8362000367565b620001c86000805160206200459b83398151915233620004e2565b620001ed6000805160206200459b8339815191528460400151620004e260201b60201c565b60408301516200020090600090620004e2565b8251805184916011916200021c91839160209091019062000596565b50602082810151805162000237926001850192019062000596565b5060408201516002820180546001600160a01b03199081166001600160a01b0393841617909155606084015160038401556080840151600484015560a0840151600584015560c090930151600690920180549093169116179055815180518391600991620002ad91839160209091019062000596565b5060208281015160018301805460ff1916911515919091179055604083015160028301556060830151600383015560808301518051620002f4926004850192019062000596565b5060a0820151600582015560c0820151600682015560e090910151600790910180546001600160a01b0319166001600160a01b03909216919091179055801562000344576007805461ff00191690555b505050565b600062000361306200058760201b6200194c1760201c565b15905090565b6000816060015111620003bd5760405162461bcd60e51b815260206004820152601f60248201527f4d6178696d756d20737570706c79206d757374206265206e6f6e2d7a65726f00604482015260640162000121565b60008160a0015111620004135760405162461bcd60e51b815260206004820181905260248201527f546f6b656e7320706572206d696e74206d757374206265206e6f6e2d7a65726f604482015260640162000121565b60c08101516001600160a01b0316620004835760405162461bcd60e51b815260206004820152602b60248201527f547265617375727920616464726573732063616e6e6f7420626520746865206e60448201526a756c6c206164647265737360a81b606482015260840162000121565b60408101516001600160a01b0316620004df5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206d757374206861766520616e206f776e65720000000000604482015260640162000121565b50565b60008281526006602090815260408083206001600160a01b038516845290915290205460ff16620005835760008281526006602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620005423390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6001600160a01b03163b151590565b828054620005a49062000968565b90600052602060002090601f016020900481019282620005c8576000855562000613565b82601f10620005e357805160ff191683800117855562000613565b8280016001018555821562000613579182015b8281111562000613578251825591602001919060010190620005f6565b506200062192915062000625565b5090565b5b8082111562000621576000815560010162000626565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b03811182821017156200067857620006786200063c565b60405290565b60405160e081016001600160401b03811182821017156200067857620006786200063c565b604051601f8201601f191681016001600160401b0381118282101715620006ce57620006ce6200063c565b604052919050565b600082601f830112620006e857600080fd5b81516001600160401b038111156200070457620007046200063c565b60206200071a601f8301601f19168201620006a3565b82815285828487010111156200072f57600080fd5b60005b838110156200074f57858101830151828201840152820162000732565b83811115620007615760008385840101525b5095945050505050565b80516001600160a01b03811681146200078357600080fd5b919050565b805180151581146200078357600080fd5b60006101008284031215620007ad57600080fd5b620007b762000652565b82519091506001600160401b0380821115620007d257600080fd5b620007e085838601620006d6565b8352620007f06020850162000788565b6020840152604084015160408401526060840151606084015260808401519150808211156200081e57600080fd5b506200082d84828501620006d6565b60808301525060a082015160a082015260c082015160c08201526200085560e083016200076b565b60e082015292915050565b600080604083850312156200087457600080fd5b82516001600160401b03808211156200088c57600080fd5b9084019060e08287031215620008a157600080fd5b620008ab6200067e565b825182811115620008bb57600080fd5b620008c988828601620006d6565b825250602083015182811115620008df57600080fd5b620008ed88828601620006d6565b60208301525062000901604084016200076b565b6040820152606083015160608201526080830151608082015260a083015160a08201526200093260c084016200076b565b60c082015260208601519094509150808211156200094f57600080fd5b506200095e8582860162000799565b9150509250929050565b600181811c908216806200097d57607f821691505b602082108114156200099f57634e487b7160e01b600052602260045260246000fd5b50919050565b613be680620009b56000396000f3fe60806040526004361061027d5760003560e01c806370a082311161014f578063b88d4fde116100c1578063e8a3d4851161007a578063e8a3d48514610740578063e985e9c514610755578063f2fde38b1461079e578063f4ad0f97146107be578063fa0440b6146107d3578063ffa1ad74146107f357600080fd5b8063b88d4fde1461069a578063c5f956af146106ba578063c87b56dd146106d8578063d547741f146106f8578063d5abeb0114610718578063e3e1e8ef1461072d57600080fd5b806391d148541161011357806391d14854146105fd57806395d89b411461061d578063a0712d6814610632578063a217fddf14610645578063a22cb4651461065a578063b5106add1461067a57600080fd5b806370a082311461056857806375b238fc14610588578063877bb1ae146105aa5780638cfec4c0146105ca5780638da5cb5b146105df57600080fd5b806331f9c919116101f357806353135ca0116101ac57806353135ca0146104c55780635a23dd99146104dc5780635a9b0b89146104fc5780636352211e1461051e5780636817c76c1461053e5780636c0360eb1461055357600080fd5b806331f9c9191461042c57806336568abe1461044357806342842e0e146104635780634653124b14610483578063476343ee146104985780634e6f9dd6146104ad57600080fd5b806318160ddd1161024557806318160ddd1461035257806322212e2b1461036857806323b872dd1461037d578063248a9ca31461039d5780632a55205a146103cd5780632f2ff15d1461040c57600080fd5b806301ffc9a71461028257806306fdde03146102b75780630807b9e2146102d9578063081812fc146102f8578063095ea7b314610330575b600080fd5b34801561028e57600080fd5b506102a261029d366004612cd1565b610809565b60405190151581526020015b60405180910390f35b3480156102c357600080fd5b506102cc610844565b6040516102ae9190612d46565b3480156102e557600080fd5b506016545b6040519081526020016102ae565b34801561030457600080fd5b50610318610313366004612d59565b6108d9565b6040516001600160a01b0390911681526020016102ae565b34801561033c57600080fd5b5061035061034b366004612d97565b610973565b005b34801561035e57600080fd5b506102ea60085481565b34801561037457600080fd5b50600e546102ea565b34801561038957600080fd5b50610350610398366004612dc3565b610a89565b3480156103a957600080fd5b506102ea6103b8366004612d59565b60009081526006602052604090206001015490565b3480156103d957600080fd5b506103ed6103e8366004612e04565b610aba565b604080516001600160a01b0390931683526020830191909152016102ae565b34801561041857600080fd5b50610350610427366004612e26565b610af1565b34801561043857600080fd5b50600b5442116102a2565b34801561044f57600080fd5b5061035061045e366004612e26565b610b17565b34801561046f57600080fd5b5061035061047e366004612dc3565b610b95565b34801561048f57600080fd5b50600c546102ea565b3480156104a457600080fd5b50610350610bb0565b3480156104b957600080fd5b50600a5460ff166102a2565b3480156104d157600080fd5b50600c5442116102a2565b3480156104e857600080fd5b506102a26104f7366004612ea1565b610be2565b34801561050857600080fd5b50610511610cc0565b6040516102ae9190612f78565b34801561052a57600080fd5b50610318610539366004612d59565b610fd7565b34801561054a57600080fd5b506015546102ea565b34801561055f57600080fd5b506102cc61104e565b34801561057457600080fd5b506102ea610583366004613029565b611060565b34801561059457600080fd5b506102ea600080516020613b9183398151915281565b3480156105b657600080fd5b506103506105c5366004613046565b6110e7565b3480156105d657600080fd5b50600b546102ea565b3480156105eb57600080fd5b506013546001600160a01b0316610318565b34801561060957600080fd5b506102a2610618366004612e26565b61111c565b34801561062957600080fd5b506102cc611147565b610350610640366004612d59565b611159565b34801561065157600080fd5b506102ea600081565b34801561066657600080fd5b5061035061067536600461309a565b6111b4565b34801561068657600080fd5b50610350610695366004613029565b6111bf565b3480156106a657600080fd5b506103506106b536600461319e565b6112b3565b3480156106c657600080fd5b506017546001600160a01b0316610318565b3480156106e457600080fd5b506102cc6106f3366004612d59565b6112e5565b34801561070457600080fd5b50610350610713366004612e26565b61141d565b34801561072457600080fd5b506014546102ea565b61035061073b36600461321d565b611443565b34801561074c57600080fd5b506102cc61150f565b34801561076157600080fd5b506102a261077036600461324f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107aa57600080fd5b506103506107b9366004613029565b61158c565b3480156107ca57600080fd5b506102cc6116be565b3480156107df57600080fd5b506103506107ee366004613356565b6116d0565b3480156107ff57600080fd5b506102ea61277481565b60006108148261195b565b806108235750610823826119ab565b8061083e575063152a902d60e11b6001600160e01b03198316145b92915050565b6060601160000180546108569061344b565b80601f01602080910402602001604051908101604052809291908181526020018280546108829061344b565b80156108cf5780601f106108a4576101008083540402835291602001916108cf565b820191906000526020600020905b8154815290600101906020018083116108b257829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166109575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061097e82610fd7565b9050806001600160a01b0316836001600160a01b031614156109ec5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161094e565b336001600160a01b0382161480610a085750610a088133610770565b610a7a5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161094e565b610a8483836119e0565b505050565b610a933382611a4e565b610aaf5760405162461bcd60e51b815260040161094e90613486565b610a84838383611b45565b601054600f546001600160a01b039091169060009061271090610ade9085906134ed565b610ae89190613522565b90509250929050565b600082815260066020526040902060010154610b0d8133611ce1565b610a848383611d45565b6001600160a01b0381163314610b875760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161094e565b610b918282611dcb565b5050565b610a84838383604051806020016040528060008152506112b3565b600080516020613b91833981519152610bc98133611ce1565b601754610bdf906001600160a01b031647611e32565b50565b6001600160a01b03831660009081526019602052604081205460ff1615610c3c5760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b604482015260640161094e565b6040516bffffffffffffffffffffffff19606086901b166020820152600090603401604051602081830303815290604052805190602001209050610cb784848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e549150849050611f4b565b95945050505050565b610cc8612b5e565b61277481526040805160e081019091526011805482908290610ce99061344b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d159061344b565b8015610d625780601f10610d3757610100808354040283529160200191610d62565b820191906000526020600020905b815481529060010190602001808311610d4557829003601f168201915b50505050508152602001600182018054610d7b9061344b565b80601f0160208091040260200160405190810160405280929190818152602001828054610da79061344b565b8015610df45780601f10610dc957610100808354040283529160200191610df4565b820191906000526020600020905b815481529060010190602001808311610dd757829003601f168201915b505050918352505060028201546001600160a01b039081166020808401919091526003840154604080850191909152600485015460608501526005850154608085015260069094015490911660a090920191909152830191909152805161010081019091526009805482908290610e6a9061344b565b80601f0160208091040260200160405190810160405280929190818152602001828054610e969061344b565b8015610ee35780601f10610eb857610100808354040283529160200191610ee3565b820191906000526020600020905b815481529060010190602001808311610ec657829003601f168201915b5050509183525050600182015460ff16151560208201526002820154604082015260038201546060820152600482018054608090920191610f239061344b565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4f9061344b565b8015610f9c5780601f10610f7157610100808354040283529160200191610f9c565b820191906000526020600020905b815481529060010190602001808311610f7f57829003601f168201915b50505091835250506005820154602082015260068201546040808301919091526007909201546001600160a01b031660609091015282015290565b6000818152600260205260408120546001600160a01b03168061083e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161094e565b6060600960000180546108569061344b565b60006001600160a01b0382166110cb5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161094e565b506001600160a01b031660009081526003602052604090205490565b600080516020613b918339815191526111008133611ce1565b61110982611f61565b81600961111682826136a4565b50505050565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060601160010180546108569061344b565b600b5442116111aa5760405162461bcd60e51b815260206004820152601b60248201527f4d696e74696e6720686173206e6f742073746172746564207965740000000000604482015260640161094e565b610bdf33826120bc565b610b913383836121e7565b600080516020613b918339815191526111d88133611ce1565b6111f0600080516020613b918339815191528361111c565b156112305760405162461bcd60e51b815260206004820152601060248201526f20b63932b0b23c9030b71030b236b4b760811b604482015260640161094e565b6013546001600160a01b03163314156112835760405162461bcd60e51b81526020600482015260156024820152740557365207472616e736665724f776e65727368697605c1b604482015260640161094e565b61129b600080516020613b9183398151915233611dcb565b610b91600080516020613b9183398151915283611d45565b6112bd3383611a4e565b6112d95760405162461bcd60e51b815260040161094e90613486565b611116848484846122b6565b6000818152600260205260409020546060906001600160a01b03166113435760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161094e565b6000600960000180546113559061344b565b9050116113ec57600d80546113699061344b565b80601f01602080910402602001604051908101604052809291908181526020018280546113959061344b565b80156113e25780601f106113b7576101008083540402835291602001916113e2565b820191906000526020600020905b8154815290600101906020018083116113c557829003601f168201915b505050505061083e565b60096113f7836122e9565b60405160200161140892919061387a565b60405160208183030381529060405292915050565b6000828152600660205260409020600101546114398133611ce1565b610a848383611dcb565b600c5442116114945760405162461bcd60e51b815260206004820152601b60248201527f50726573616c6520686173206e6f742073746172746564207965740000000000604482015260640161094e565b61149f338383610be2565b6114eb5760405162461bcd60e51b815260206004820152601b60248201527f4e6f742077686974656c697374656420666f722070726573616c650000000000604482015260640161094e565b336000818152601960205260409020805460ff19166001179055610a8490846120bc565b606060006115606115246009600601546122e9565b60105461153b906001600160a01b031660146123e6565b60405160200161154c92919061389f565b604051602081830303815290604052612588565b90506000816040516020016115759190613926565b60408051601f198184030181529190529392505050565b60006115988133611ce1565b6013546001600160a01b03838116911614156115ea5760405162461bcd60e51b815260206004820152601160248201527020b63932b0b23c903a34329037bbb732b960791b604482015260640161094e565b60135461160f90600080516020613b91833981519152906001600160a01b0316611dcb565b601354611627906000906001600160a01b0316611dcb565b601380546001600160a01b038481166001600160a01b031983168117909355169061166190600080516020613b9183398151915290611d45565b601354611679906000906001600160a01b0316611d45565b826001600160a01b0316816001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b6060600960040180546108569061344b565b600754610100900460ff166116eb5760075460ff16156116ef565b303b155b6117525760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161094e565b600754610100900460ff16158015611774576007805461ffff19166101011790555b60185460ff16156117bf5760405162461bcd60e51b815260206004820152601560248201527410d85b9b9bdd081899481a5b9a5d1a585b1a5e9959605a1b604482015260640161094e565b6117c8836126ed565b6117e0600080516020613b9183398151915233611d45565b6117fc600080516020613b918339815191528460400151611d45565b61180d6000801b8460400151611d45565b825180518491601191611827918391602090910190612c22565b5060208281015180516118409260018501920190612c22565b5060408201516002820180546001600160a01b03199081166001600160a01b0393841617909155606084015160038401556080840151600484015560a0840151600584015560c0909301516006909201805490931691161790558151805183916009916118b4918391602090910190612c22565b5060208281015160018301805460ff19169115159190911790556040830151600283015560608301516003830155608083015180516118f99260048501920190612c22565b5060a0820151600582015560c0820151600682015560e090910151600790910180546001600160a01b0319166001600160a01b039092169190911790558015610a84576007805461ff0019169055505050565b6001600160a01b03163b151590565b60006001600160e01b031982166380ac58cd60e01b148061198c57506001600160e01b03198216635b5e139f60e01b145b8061083e57506301ffc9a760e01b6001600160e01b031983161461083e565b60006001600160e01b03198216637965db0b60e01b148061083e575063152a902d60e11b6001600160e01b031983161461083e565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611a1582610fd7565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316611ac75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161094e565b6000611ad283610fd7565b9050806001600160a01b0316846001600160a01b03161480611b0d5750836001600160a01b0316611b02846108d9565b6001600160a01b0316145b80611b3d57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611b5882610fd7565b6001600160a01b031614611bbc5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161094e565b6001600160a01b038216611c1e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161094e565b611c296000826119e0565b6001600160a01b0383166000908152600360205260408120805460019290611c5290849061396b565b90915550506001600160a01b0382166000908152600360205260408120805460019290611c80908490613982565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611ceb828261111c565b610b9157611d03816001600160a01b031660146123e6565b611d0e8360206123e6565b604051602001611d1f92919061399a565b60408051601f198184030181529082905262461bcd60e51b825261094e91600401612d46565b611d4f828261111c565b610b915760008281526006602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d873390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611dd5828261111c565b15610b915760008281526006602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80471015611e825760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161094e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611ecf576040519150601f19603f3d011682016040523d82523d6000602084013e611ed4565b606091505b5050905080610a845760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161094e565b600082611f58858461285d565b14949350505050565b61271060c08201351115611fac5760405162461bcd60e51b81526020600482015260126024820152710a4def2c2d8e8d2cae640e8dede40d0d2ced60731b604482015260640161094e565b600a5460ff1615611fba5750565b611fca6040820160208301613a0f565b600a5460ff161515901515146120225760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420756e667265657a65206d657461646174610000000000000000604482015260640161094e565b61202c8180613536565b60405160200161203d929190613a2c565b60408051601f19818403018152908290528051602091820120916120649160099101613a3c565b6040516020818303038152906040528051906020012014610bdf5760405162461bcd60e51b815260206004820152601260248201527126b2ba30b230ba309034b990333937bd32b760711b604482015260640161094e565b6016548111156121015760405162461bcd60e51b815260206004820152601060248201526f416d6f756e7420746f6f206c6172676560801b604482015260640161094e565b60155461210e90826134ed565b3410156121515760405162461bcd60e51b815260206004820152601160248201527014185e5b595b9d081d1bdbc81cdb585b1b607a1b604482015260640161094e565b6000816008546121619190613982565b6014549091508111156121af5760405162461bcd60e51b815260206004820152601660248201527513585e1a5b5d5b481cdd5c1c1b1e481c995858da195960521b604482015260640161094e565b600881905560015b828111611116576121d584826008546121d0919061396b565b6128d1565b806121df81613a48565b9150506121b7565b816001600160a01b0316836001600160a01b031614156122495760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161094e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6122c1848484611b45565b6122cd848484846128eb565b6111165760405162461bcd60e51b815260040161094e90613a63565b60608161230d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612337578061232181613a48565b91506123309050600a83613522565b9150612311565b6000816001600160401b03811115612351576123516130c8565b6040519080825280601f01601f19166020018201604052801561237b576020820181803683370190505b5090505b8415611b3d5761239060018361396b565b915061239d600a86613ab5565b6123a8906030613982565b60f81b8183815181106123bd576123bd613ac9565b60200101906001600160f81b031916908160001a9053506123df600a86613522565b945061237f565b606060006123f58360026134ed565b612400906002613982565b6001600160401b03811115612417576124176130c8565b6040519080825280601f01601f191660200182016040528015612441576020820181803683370190505b509050600360fc1b8160008151811061245c5761245c613ac9565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061248b5761248b613ac9565b60200101906001600160f81b031916908160001a90535060006124af8460026134ed565b6124ba906001613982565b90505b6001811115612532576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106124ee576124ee613ac9565b1a60f81b82828151811061250457612504613ac9565b60200101906001600160f81b031916908160001a90535060049490941c9361252b81613adf565b90506124bd565b5083156125815760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161094e565b9392505050565b8051606090806125a8575050604080516020810190915260008152919050565b600060036125b7836002613982565b6125c19190613522565b6125cc9060046134ed565b905060006125db826020613982565b6001600160401b038111156125f2576125f26130c8565b6040519080825280601f01601f19166020018201604052801561261c576020820181803683370190505b5090506000604051806060016040528060408152602001613b51604091399050600181016020830160005b868110156126a8576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101612647565b5060038606600181146126c257600281146126d3576126df565b613d3d60f01b6001198301526126df565b603d60f81b6000198301525b505050918152949350505050565b60008160600151116127415760405162461bcd60e51b815260206004820152601f60248201527f4d6178696d756d20737570706c79206d757374206265206e6f6e2d7a65726f00604482015260640161094e565b60008160a00151116127955760405162461bcd60e51b815260206004820181905260248201527f546f6b656e7320706572206d696e74206d757374206265206e6f6e2d7a65726f604482015260640161094e565b60c08101516001600160a01b03166128035760405162461bcd60e51b815260206004820152602b60248201527f547265617375727920616464726573732063616e6e6f7420626520746865206e60448201526a756c6c206164647265737360a81b606482015260840161094e565b60408101516001600160a01b0316610bdf5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206d757374206861766520616e206f776e65720000000000604482015260640161094e565b600081815b84518110156128c957600085828151811061287f5761287f613ac9565b602002602001015190508083116128a557600083815260208290526040902092506128b6565b600081815260208490526040902092505b50806128c181613a48565b915050612862565b509392505050565b610b918282604051806020016040528060008152506129e9565b60006001600160a01b0384163b156129de57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061292f903390899088908890600401613af6565b6020604051808303816000875af192505050801561296a575060408051601f3d908101601f1916820190925261296791810190613b33565b60015b6129c4573d808015612998576040519150601f19603f3d011682016040523d82523d6000602084013e61299d565b606091505b5080516129bc5760405162461bcd60e51b815260040161094e90613a63565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611b3d565b506001949350505050565b6129f38383612a1c565b612a0060008484846128eb565b610a845760405162461bcd60e51b815260040161094e90613a63565b6001600160a01b038216612a725760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161094e565b6000818152600260205260409020546001600160a01b031615612ad75760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161094e565b6001600160a01b0382166000908152600360205260408120805460019290612b00908490613982565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b604051806060016040528060008152602001612bc26040518060e00160405280606081526020016060815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b8152602001612c1d60405180610100016040528060608152602001600015158152602001600081526020016000815260200160608152602001600080191681526020016000815260200160006001600160a01b031681525090565b905290565b828054612c2e9061344b565b90600052602060002090601f016020900481019282612c505760008555612c96565b82601f10612c6957805160ff1916838001178555612c96565b82800160010185558215612c96579182015b82811115612c96578251825591602001919060010190612c7b565b50612ca2929150612ca6565b5090565b5b80821115612ca25760008155600101612ca7565b6001600160e01b031981168114610bdf57600080fd5b600060208284031215612ce357600080fd5b813561258181612cbb565b60005b83811015612d09578181015183820152602001612cf1565b838111156111165750506000910152565b60008151808452612d32816020860160208601612cee565b601f01601f19169290920160200192915050565b6020815260006125816020830184612d1a565b600060208284031215612d6b57600080fd5b5035919050565b6001600160a01b0381168114610bdf57600080fd5b8035612d9281612d72565b919050565b60008060408385031215612daa57600080fd5b8235612db581612d72565b946020939093013593505050565b600080600060608486031215612dd857600080fd5b8335612de381612d72565b92506020840135612df381612d72565b929592945050506040919091013590565b60008060408385031215612e1757600080fd5b50508035926020909101359150565b60008060408385031215612e3957600080fd5b823591506020830135612e4b81612d72565b809150509250929050565b60008083601f840112612e6857600080fd5b5081356001600160401b03811115612e7f57600080fd5b6020830191508360208260051b8501011115612e9a57600080fd5b9250929050565b600080600060408486031215612eb657600080fd5b8335612ec181612d72565b925060208401356001600160401b03811115612edc57600080fd5b612ee886828701612e56565b9497909650939450505050565b60006101008251818552612f0b82860182612d1a565b915050602083015115156020850152604083015160408501526060830151606085015260808301518482036080860152612f458282612d1a565b60a0858101519087015260c0808601519087015260e0948501516001600160a01b03169490950193909352509192915050565b60208152815160208201526000602083015160606040840152805160e06080850152612fa8610160850182612d1a565b90506020820151607f198583030160a0860152612fc58282612d1a565b6040848101516001600160a01b0390811660c08981019190915260608088015160e08b015260808801516101008b015260a08801516101208b015296015116610140880152870151868203601f1901948701949094529150610cb790508183612ef5565b60006020828403121561303b57600080fd5b813561258181612d72565b60006020828403121561305857600080fd5b81356001600160401b0381111561306e57600080fd5b8201610100818503121561258157600080fd5b8015158114610bdf57600080fd5b8035612d9281613081565b600080604083850312156130ad57600080fd5b82356130b881612d72565b91506020830135612e4b81613081565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715613101576131016130c8565b60405290565b60405160e081016001600160401b0381118282101715613101576131016130c8565b60006001600160401b0380841115613143576131436130c8565b604051601f8501601f19908116603f0116810190828211818310171561316b5761316b6130c8565b8160405280935085815286868601111561318457600080fd5b858560208301376000602087830101525050509392505050565b600080600080608085870312156131b457600080fd5b84356131bf81612d72565b935060208501356131cf81612d72565b92506040850135915060608501356001600160401b038111156131f157600080fd5b8501601f8101871361320257600080fd5b61321187823560208401613129565b91505092959194509250565b60008060006040848603121561323257600080fd5b8335925060208401356001600160401b03811115612edc57600080fd5b6000806040838503121561326257600080fd5b823561326d81612d72565b91506020830135612e4b81612d72565b600082601f83011261328e57600080fd5b61258183833560208501613129565b600061010082840312156132b057600080fd5b6132b86130de565b905081356001600160401b03808211156132d157600080fd5b6132dd8583860161327d565b83526132eb6020850161308f565b60208401526040840135604084015260608401356060840152608084013591508082111561331857600080fd5b506133258482850161327d565b60808301525060a082013560a082015260c082013560c082015261334b60e08301612d87565b60e082015292915050565b6000806040838503121561336957600080fd5b82356001600160401b038082111561338057600080fd5b9084019060e0828703121561339457600080fd5b61339c613107565b8235828111156133ab57600080fd5b6133b78882860161327d565b8252506020830135828111156133cc57600080fd5b6133d88882860161327d565b6020830152506133ea60408401612d87565b6040820152606083013560608201526080830135608082015260a083013560a082015261341960c08401612d87565b60c08201529350602085013591508082111561343457600080fd5b506134418582860161329d565b9150509250929050565b600181811c9082168061345f57607f821691505b6020821081141561348057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613507576135076134d7565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826135315761353161350c565b500490565b6000808335601e1984360301811261354d57600080fd5b8301803591506001600160401b0382111561356757600080fd5b602001915036819003821315612e9a57600080fd5b601f821115610a8457600081815260208120601f850160051c810160208610156135a35750805b601f850160051c820191505b818110156135c2578281556001016135af565b505050505050565b6001600160401b038311156135e1576135e16130c8565b6135f5836135ef835461344b565b8361357c565b6000601f84116001811461362957600085156136115750838201355b600019600387901b1c1916600186901b178355613683565b600083815260209020601f19861690835b8281101561365a578685013582556020948501946001909201910161363a565b50868210156136775760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6000813561083e81613081565b6000813561083e81612d72565b6136ae8283613536565b6001600160401b038111156136c5576136c56130c8565b6136d9816136d3855461344b565b8561357c565b6000601f82116001811461370d57600083156136f55750838201355b600019600385901b1c1916600184901b178555613767565b600085815260209020601f19841690835b8281101561373e578685013582556020948501946001909201910161371e565b508482101561375b5760001960f88660031b161c19848701351681555b505060018360011b0185555b5050505061379361377a6020840161368a565b6001830160ff1981541660ff8315151681178255505050565b60408201356002820155606082013560038201556137b46080830183613536565b6137c28183600486016135ca565b505060a0820135600582015560c08201356006820155610b916137e760e08401613697565b6007830180546001600160a01b0319166001600160a01b0392909216919091179055565b600081546138188161344b565b60018281168015613830576001811461384157613870565b60ff19841687528287019450613870565b8560005260208060002060005b858110156138675781548a82015290840190820161384e565b50505082870194505b5050505092915050565b6000613886828561380b565b8351613896818360208801612cee565b01949350505050565b7f7b2273656c6c65725f6665655f62617369735f706f696e7473223a20000000008152600083516138d781601c850160208801612cee565b731610113332b2afb932b1b4b834b2b73a111d101160611b601c91840191820152835161390b816030840160208801612cee565b61227d60f01b60309290910191820152603201949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161395e81601d850160208701612cee565b91909101601d0192915050565b60008282101561397d5761397d6134d7565b500390565b60008219821115613995576139956134d7565b500190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516139d2816017850160208801612cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613a03816028840160208801612cee565b01602801949350505050565b600060208284031215613a2157600080fd5b813561258181613081565b8183823760009101908152919050565b6000612581828461380b565b6000600019821415613a5c57613a5c6134d7565b5060010190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082613ac457613ac461350c565b500690565b634e487b7160e01b600052603260045260246000fd5b600081613aee57613aee6134d7565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613b2990830184612d1a565b9695505050505050565b600060208284031215613b4557600080fd5b815161258181612cbb56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212202e87d85bd9df02566ad03b421d7d5f548b207d8e3c5ff8be1686a93c03b67ac164736f6c634300080b0033a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000e7d7696c8f11278124f39fb7cdd39fd9442d502600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000e7d7696c8f11278124f39fb7cdd39fd9442d5026000000000000000000000000000000000000000000000000000000000000000d4e4654436f6c6c656374696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000622e06e000000000000000000000000000000000000000000000000000000000622e06e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fa000000000000000000000000e7d7696c8f11278124f39fb7cdd39fd9442d502600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.