ETH Price: $3,829.87 (+5.98%)

Token

Hedgies by dYdX (HEDGIES)
 

Overview

Max Total Supply

4,177 HEDGIES

Holders

2,357

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
jimmychu0807.eth
Balance
1 HEDGIES
0xb0fd5a878dbf3f9358a251caf9b6fc692a999ca7
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Meet a very special group of small, spiny mammals who love nothing more than trading perpetuals. Each of the 4,200 Hedgies will make its way home to a trader, voter, or supporter of the dYdX community.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Hedgies

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : Hedgies.sol
/*

    Copyright 2022 dYdX Trading Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

*/

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { ERC721 }  from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { ERC721Enumerable }  from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { HedgiesRoles } from "./HedgiesRoles.sol";

/**
 * @title Hedgies
 * @author dYdX
 *
 * @notice The Hedgies NFT contract.
 */
contract Hedgies is
    HedgiesRoles,
    ERC721Enumerable,
    Pausable
{
    //  ============ Structs ============

    struct MerkleRoot {
        bytes32 merkleRoot;
        bytes ipfsCid;
    }

    struct TierMintingInformation {
        uint256 unlockTimestamp;
        uint256 maxSupply;
    }

    // ============ Events ============

    event StartingIndexBlockSet(
        uint256 startingIndexBlock
    );

    event StartingIndexValueSet(
        uint256 startingIndexValue
    );

    event BaseURISet(
        string baseURI
    );

    event MerkleRootSet(
        MerkleRoot merkleRoot
    );

    event DistributionMintRateSet(
        uint256 distributionMintRate
    );

    event DistributionOffsetSet(
        uint256 distributionOffset
    );

    event FinalizedUri();

    // ============ Constants ============

    uint256 constant public NUM_TIERS = 3;

    uint256 constant public DISTRIBUTION_BASE = 10 ** 18;

    bytes32 immutable public PROVENANCE_HASH;

    uint256 immutable public MAX_SUPPLY;

    uint256 immutable public RESERVE_SUPPLY;

    uint256 immutable public TIER_ZERO_MINTS_UNLOCK_TIMESTAMP;

    uint256 immutable public TIER_ONE_MINTS_UNLOCK_TIMESTAMP;

    uint256 immutable public TIER_TWO_MINTS_UNLOCK_TIMESTAMP;

    uint256 immutable public TIER_ZERO_MINTS_MAX_SUPPLY;

    uint256 immutable public TIER_ONE_MINTS_MAX_SUPPLY;

    uint256 immutable public TIER_TWO_MINTS_MAX_SUPPLY;

    // ============ State Variables ============

    MerkleRoot public _MERKLE_ROOT_;

    uint256 public _HEDGIE_DISTRIBUTION_MINT_RATE_;

    uint256 public _HEDGIE_DISTRIBUTION_OFFSET_;

    string public _BASE_URI_ = "";

    bool public _URI_IS_FINALIZED_ = false;

    mapping (address => bool) public _HAS_CLAIMED_HEDGIE_;

    uint256 public _STARTING_INDEX_BLOCK_ = 0;

    // Note: Packed into a shared storage slot.
    bool public _STARTING_INDEX_SET_ = false;
    uint248 public _STARTING_INDEX_VALUE_ = 0;

    // ============ Constructor ============

    constructor(
        string[2] memory nameAndSymbol,
        bytes32 provenanceHash,
        uint256 reserveSupply,
        bytes32 merkleRoot,
        bytes memory ipfsCid,
        uint256[3] memory mintTierTimestamps,
        uint256[3] memory mintTierMaxSupplies,
        uint256 maxSupply,
        address[3] memory roleOwners,
        uint256[2] memory mintToVariables
    )
        HedgiesRoles(roleOwners[0], roleOwners[1], roleOwners[2])
        ERC721(nameAndSymbol[0], nameAndSymbol[1])
    {
        // Verify the mint tier information is all correct.
        require(
            (
                reserveSupply <= mintTierMaxSupplies[0] &&
                mintTierMaxSupplies[0] <= mintTierMaxSupplies[1] &&
                mintTierMaxSupplies[1] <= mintTierMaxSupplies[2] &&
                mintTierMaxSupplies[2] <= maxSupply
            ),
            "Each mint tier must gte the previous, includes reserveSupply and maxSupply"
        );
        require(
            (
                mintTierTimestamps[0] < mintTierTimestamps[1] &&
                mintTierTimestamps[1] < mintTierTimestamps[2]
            ),
            "Each tier must unlock later than the previous one"
        );

        // Set the provenanceHash.
        PROVENANCE_HASH = provenanceHash;

        // Set the maxSupply.
        MAX_SUPPLY = maxSupply;

        // The reserve supply is the number of hedgies set aside for the team and giveaways.
        RESERVE_SUPPLY = reserveSupply;

        // The tier mint unlock timestamps.
        TIER_ZERO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[0];
        TIER_ONE_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[1];
        TIER_TWO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[2];

        // The tier max supplies.
        TIER_ZERO_MINTS_MAX_SUPPLY = mintTierMaxSupplies[0];
        TIER_ONE_MINTS_MAX_SUPPLY = mintTierMaxSupplies[1];
        TIER_TWO_MINTS_MAX_SUPPLY = mintTierMaxSupplies[2];

        // Set the merkle-root for eligible minters.
        _setMerkleRootAndCid(
            merkleRoot,
            ipfsCid
        );

        // Set the hedgie distribution information.
        _setDistributionMintRate(mintToVariables[0]);
        _setDistributionOffset(mintToVariables[1]);
    }

    // ============ Modifiers ============

    modifier uriNotFinalized {
        // Verify the sale has not been finalized.
        require(
            !_URI_IS_FINALIZED_,
            'Cannot update once the sale has been finalized'
        );
        _;
    }

    // ============ External Admin-Only Functions ============

    /**
     * @notice Pause this contract.
     */
    function pause()
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _pause();
    }

    /**
     * @notice Unpause this contract.
     */
    function unpause()
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _unpause();
    }

    /**
     * @notice Set the sale of the collection as finalized, preventing the baseURI from
     * being updated again.
     * @dev Emits finalized event.
     */
    function finalize()
        external
        uriNotFinalized
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _URI_IS_FINALIZED_ = true;
        emit FinalizedUri();
    }

    /**
     * @notice Mint a hedgie to a specific address up to the reserve supply.
     *
     * Important: The reserve supply should be minted before the sale is enabled.
     *
     * @param  maxMint    The maximum number of NFTs to mint in one call to the function.
     * @param  recipient  The address to mint the token to.
     */
    function reserveHedgies(
        uint256 maxMint,
        address recipient
    )
        external
        whenNotPaused
        onlyRole(RESERVER_ROLE)
    {
        // Get supply and NFTs to mint.
        uint256 supply = totalSupply();
        uint256 hedgiesToMint = Math.min(maxMint, RESERVE_SUPPLY - supply);
        require(
            hedgiesToMint > 0,
            "Cannot premint once max premint supply has been reached"
        );

        // Mint each NFT sequentially.
        for (uint256 i = 0; i < hedgiesToMint; i++) {
            // Use _mint() instead of _safeMint() since we don't plan to mint to any smart contracts.
            _mint(recipient, supply + i);
        }
    }

    /**
     * @notice Mint a hedgie to a specific address.
     *
     * @param  recipient  The address to mint the token to.
     * @param  tokenId    The id of the token to mint.
     */
    function mintHedgieTo(
        address recipient,
        uint256 tokenId
    )
        external
        whenNotPaused
        onlyRole(MINTER_ROLE)
    {
        // Do not mint tokenId that should have been minted by now.
        require(
            tokenId >= TIER_TWO_MINTS_MAX_SUPPLY,
            "Cannot mint token with tokenId lte tier two maxSupply"
        );

        // Do not mint tokens with invalid tokenIds.
        // Prevents supply > MAX_SUPPLY as no duplicate tokenIds are allowed either.
        require(
            tokenId < MAX_SUPPLY,
            "Cannot mint token with tokenId greater than maxSupply"
        );

        uint256 supply = totalSupply();

        // Do not begin minting until all hedgies from tier 2 are minted.
        require(
            supply >= TIER_TWO_MINTS_MAX_SUPPLY,
            "Cannot mint token for distribution before sale has completed"
        );

        // Verify that the maximum distributable supply at this timestamp has not been exceeded.
        // Note: If _HEDGIE_DISTRIBUTION_OFFSET_ >= block.timestamp this call will revert.
        uint256 availableHedgiesToMint = (
            _HEDGIE_DISTRIBUTION_MINT_RATE_* (
                block.timestamp - _HEDGIE_DISTRIBUTION_OFFSET_
            ) / DISTRIBUTION_BASE
        );
        require(
            supply < availableHedgiesToMint + TIER_TWO_MINTS_MAX_SUPPLY,
            'At the current timestamp supply is capped for distributing'
        );

        // Use _mint() instead of _safeMint() since we don't plan to mint to any smart contracts.
        _mint(recipient, tokenId);
    }

    /**
     * @notice Set the mint rate to distribute Hedgies at.
     * @dev Emits DistributionMintRateSet event from an internal call.
     *
     * @param  distributionMintRate  The mint rate to distribute Hedgies at.
     */
    function setDistributionMintRate(
        uint256 distributionMintRate
    )
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _setDistributionMintRate(distributionMintRate);
    }

    /**
     * @notice Set the offset for the mint rate to distribute Hedgies at. This is the timestamp at
     * which we consider distribution via mintHedgieTo to have started.
     * @dev Emits DistributionOffsetSet event from an internal call.
     *
     * @param  distributionOffset  The offset for the mint rate to distribute Hedgies at.
     */
    function setDistributionOffset(
        uint256 distributionOffset
    )
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _setDistributionOffset(distributionOffset);
    }

    /**
     * @notice Set the base URI which determines the metadata URI for all tokens.
     * Note: this call will revert if the contract is finalized.
     * @dev Emits BaseURISet event.
     *
     * @param  baseURI  The URI that determines the metadata URI for all tokens.
     */
    function setBaseURI(
        string calldata baseURI
    )
        external
        uriNotFinalized
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        // Set the base URI.
        _BASE_URI_ = baseURI;
        emit BaseURISet(baseURI);
    }

    /**
     * @notice Update the Merkle root and CID for the minting tiers. This should not be necessary
     *  since these values should be set when the contract is constructed. This function is
     *  provided just in case.
     * @dev Emits MerkleRootSet event from an internal call.
     *
     * @param  merkleRoot  The root of the Merkle tree that proves who is eligible for distribution.
     * @param  ipfsCid     The content identifier in IPFS for the Merkle tree.
     */
    function setMerkleRootAndCid(
        bytes32 merkleRoot,
        bytes calldata ipfsCid
    )
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _setMerkleRootAndCid(merkleRoot, ipfsCid);
    }

    // ============ Other External Functions ============

    /**
     * @notice Mint a Hedgie if the tier 1 supply has not been reached. If we haven't set the starting index
     *  and this is the last token to be sold from tier 1, set the starting index block.
     * @dev Emits StartingIndexBlockSet event from an internal call.
     *
     * @param  tier         The tier of the account minting a Hedgie.
     * @param  merkleProof  The proof verifying the account is in the tier they are claiming to be in.
     */
    function mintHedgie(
        uint256 tier,
        bytes32[] calldata merkleProof
    )
        external
        whenNotPaused
    {
        // Get the tier minting information and verify that it is past the time when tier minting started.
        TierMintingInformation memory tierMintingInformation = getMintsAndMintTimeForTier(tier);
        require(
            block.timestamp >= tierMintingInformation.unlockTimestamp,
            "Tier minting is not yet allowed"
        );

        uint256 mintIndex = totalSupply();

        // Verify the reserve supply has been minted.
        require(
            mintIndex >= RESERVE_SUPPLY,
            "Not all Hedgies from the reserve supply have been minted"
        );

        // Verify the mint index is not past the max supply for the tier.
        // Note: First ID to be minted is 0, and last to be minted is TIER_TWO_MINTS_MAX_SUPPLY - 1.
        require(
            mintIndex < tierMintingInformation.maxSupply,
            "No Hedgies left to mint at this tier"
        );

        // The final tier is open to all.
        if (tier < NUM_TIERS - 1) {
            // Verify the address has not already minted.
            require(
                !_HAS_CLAIMED_HEDGIE_[msg.sender],
                'Sender already claimed'
            );

            // Check if address is in the tier. The final tier is open to all.
            require(
                isAddressEligible(msg.sender, tier, merkleProof),
                'Invalid Merkle proof'
            );

            // Mark the sender as having claimed.
            _HAS_CLAIMED_HEDGIE_[msg.sender] = true;
        }

        // Use _mint() instead of _safeMint() since any contract calling this must be directly doing so.
        _mint(msg.sender, mintIndex);

        // Set the starting index block automatically when minting the last token.
        if (mintIndex == TIER_TWO_MINTS_MAX_SUPPLY - 1) {
            _setStartingIndexBlock(block.number);
        }
    }

    /**
     * @notice Set the starting index using the previously determined block number.
     * @dev Emits StartingIndexBlockSet event from an internal call and StartingIndexValueSet event.
     */
    function setStartingIndex()
        external
    {
        // Verify the starting index has not been set.
        require(
            !_STARTING_INDEX_SET_,
            "Starting index is already set"
        );

        // Verify the starting block has already been set.
        uint256 startingIndexBlock = _STARTING_INDEX_BLOCK_;
        require(
            startingIndexBlock != 0,
            "Starting index block must be set"
        );

        // Ensure the starting index block is within 256 blocks exclusive of the previous block
        // and is not the current block as it has no blockHash yet.
        // https://docs.soliditylang.org/en/v0.8.11/units-and-global-variables.html#block-and-transaction-properties
        uint256 prevBlock = block.number - 1;
        uint256 blockDifference = prevBlock - startingIndexBlock;

        // If needed, set the starting index block to be within 256 of the current block.
        if (blockDifference >= 256) {
            startingIndexBlock = prevBlock - (blockDifference % 256);
            _setStartingIndexBlock(startingIndexBlock);
        }

        // Set the starting index.
        uint248 startingIndexValue = uint248(
            uint256(blockhash(startingIndexBlock)) % MAX_SUPPLY
        );

        // Note: Packed into a shared storage slot.
        _STARTING_INDEX_VALUE_ = startingIndexValue;
        _STARTING_INDEX_SET_ = true;
        emit StartingIndexValueSet(startingIndexValue);
    }

    // ============ Public Functions ============

    /**
     * @notice Get params for a minting tier: the unlock timestamp and number of mints available.
     *
     * @param  tier  The tier being checked for its unlock timestamp and number of total mints.
     */
    function getMintsAndMintTimeForTier(
        uint256 tier
    )
        public
        view
        returns (TierMintingInformation memory)
    {
        // Verify the tier is a valid mint tier.
        require(
            tier < NUM_TIERS,
            "Invalid tier provided"
        );

        // Return the information for the tier being requested.
        if (tier == 0) {
            return TierMintingInformation({
                unlockTimestamp: TIER_ZERO_MINTS_UNLOCK_TIMESTAMP,
                maxSupply: TIER_ZERO_MINTS_MAX_SUPPLY
            });
        }
        if (tier == 1) {
            return TierMintingInformation({
                unlockTimestamp: TIER_ONE_MINTS_UNLOCK_TIMESTAMP,
                maxSupply: TIER_ONE_MINTS_MAX_SUPPLY
            });
        }
        return TierMintingInformation({
            unlockTimestamp: TIER_TWO_MINTS_UNLOCK_TIMESTAMP,
            maxSupply: TIER_TWO_MINTS_MAX_SUPPLY
        });
    }

    /**
     * @notice Check if an address is eligible for a given tier.
     *
     * @param  ethereumAddress  The address trying to mint a hedige.
     * @param  tier             The tier to check.
     * @param  merkleProof      The Merkle proof proving that (ethereumAddress, tier) is in the tree.
     */
    function isAddressEligible(
        address ethereumAddress,
        uint256 tier,
        bytes32[] calldata merkleProof
    )
        public
        view
        returns (bool)
    {
        // Get the node of the ethereumAddress and tier and verify it is in the Merkle tree.
        bytes32 node = keccak256(abi.encodePacked(ethereumAddress, tier));
        return MerkleProof.verify(merkleProof, _MERKLE_ROOT_.merkleRoot, node);
    }

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

    // ============ Internal Functions ============

    /**
     * @notice Get the base URI.
     */
    function _baseURI()
        internal
        view
        override
        returns (string memory)
    {
        // Get the base URI.
        return _BASE_URI_;
    }

    /**
     * @notice Set the starting index.
     * @dev Emits StartingIndexBlockSet event.
     *
     * @param  startingIndexBlock  The block number to set the starting index to.
     */
    function _setStartingIndexBlock(
        uint256 startingIndexBlock
    )
        internal
    {
        _STARTING_INDEX_BLOCK_ = startingIndexBlock;
        emit StartingIndexBlockSet(startingIndexBlock);
    }

    /**
     * @notice Set the merkle root and CID.
     * @dev Emits MerkleRootSet event.
     *
     * @param  merkleRoot  The root of the Merkle tree that proves who is eligible for distribution.
     * @param  ipfsCid     The content identifier in IPFS for the Merkle tree data.
     */
    function _setMerkleRootAndCid(
        bytes32 merkleRoot,
        bytes memory ipfsCid
    )
        internal
    {
        // Get the full Merkle root and set _MERKLE_ROOT_ in storage.
        MerkleRoot memory fullMerkleRoot = MerkleRoot({
            merkleRoot: merkleRoot,
            ipfsCid: ipfsCid
        });
        _MERKLE_ROOT_ = fullMerkleRoot;
        emit MerkleRootSet(fullMerkleRoot);
    }

    /**
     * @notice Set the mint rate to distribute Hedgies at.
     * @dev Emits DistributionMintRateSet event.
     *
     * @param  distributionMintRate  The mint rate to distribute Hedgies at.
     */
    function _setDistributionMintRate(
        uint256 distributionMintRate
    )
        internal
    {
        // Set the distribution mint rate.
        _HEDGIE_DISTRIBUTION_MINT_RATE_ = distributionMintRate;
        emit DistributionMintRateSet(distributionMintRate);
    }

    /**
     * @notice Set the offset for the mint rate to distribute Hedgies at. This is the timestamp at
     * which we consider distribution via mintHedgieTo to have started.
     * @dev Emits DistributionOffsetSet event.
     *
     * @param  distributionOffset  The offset for the mint rate to distribute Hedgies at.
     */
    function _setDistributionOffset(
        uint256 distributionOffset
    )
        internal
    {
        // Set the offset for the distribution mint rate.
        _HEDGIE_DISTRIBUTION_OFFSET_ = distributionOffset;
        emit DistributionOffsetSet(distributionOffset);
    }
}

File 2 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 override returns (bool) {
        return _roles[role].members[account];
    }

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

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

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

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

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been 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 3 of 18 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

File 4 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
    }

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

    /**
     * @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 of token that is not own");
        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);
    }

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

File 5 of 18 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

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

    /**
     * @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` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * 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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 6 of 18 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

File 7 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 8 of 18 : HedgiesRoles.sol
/*

    Copyright 2022 dYdX Trading Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

*/

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * @title HedgiesRoles
 * @author dYdX
 *
 * @notice Defines roles used in the Hedgies contract. The hierarchy of roles and powers
 *  of each role are described below.
 *
 *  Roles:
 *
 *    DEFAULT_ADMIN_ROLE
 *      | -> May add or remove users from any of the below roles it manages.
 *      |
 *      +-- RESERVER_ROLE
 *      |    -> May reserve to any address as long as reserve supply has not been met.
 *      |
 *      +-- MINTER_ROLE
 *           -> May mint to any address as long as mint supply has not been met.
 */
contract HedgiesRoles is
  AccessControl
{
  bytes32 public constant RESERVER_ROLE = keccak256('RESERVER_ROLE');
  bytes32 public constant MINTER_ROLE = keccak256('MINTER_ROLE');

  constructor(
    address admin,
    address reserver,
    address minter
  ) {
    // Assign roles.
    _grantRole(DEFAULT_ADMIN_ROLE, admin);
    _grantRole(RESERVER_ROLE, reserver);
    _grantRole(MINTER_ROLE, minter);
  }
}

File 9 of 18 : 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 10 of 18 : 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 11 of 18 : 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 12 of 18 : 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 13 of 18 : 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 14 of 18 : 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 15 of 18 : 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 16 of 18 : 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 17 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string[2]","name":"nameAndSymbol","type":"string[2]"},{"internalType":"bytes32","name":"provenanceHash","type":"bytes32"},{"internalType":"uint256","name":"reserveSupply","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes","name":"ipfsCid","type":"bytes"},{"internalType":"uint256[3]","name":"mintTierTimestamps","type":"uint256[3]"},{"internalType":"uint256[3]","name":"mintTierMaxSupplies","type":"uint256[3]"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"address[3]","name":"roleOwners","type":"address[3]"},{"internalType":"uint256[2]","name":"mintToVariables","type":"uint256[2]"}],"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":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"distributionMintRate","type":"uint256"}],"name":"DistributionMintRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"distributionOffset","type":"uint256"}],"name":"DistributionOffsetSet","type":"event"},{"anonymous":false,"inputs":[],"name":"FinalizedUri","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes","name":"ipfsCid","type":"bytes"}],"indexed":false,"internalType":"struct Hedgies.MerkleRoot","name":"merkleRoot","type":"tuple"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startingIndexBlock","type":"uint256"}],"name":"StartingIndexBlockSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startingIndexValue","type":"uint256"}],"name":"StartingIndexValueSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DISTRIBUTION_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUM_TIERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVENANCE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_ONE_MINTS_MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_ONE_MINTS_UNLOCK_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_TWO_MINTS_MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_TWO_MINTS_UNLOCK_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_ZERO_MINTS_MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIER_ZERO_MINTS_UNLOCK_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_BASE_URI_","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_HAS_CLAIMED_HEDGIE_","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HEDGIE_DISTRIBUTION_MINT_RATE_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HEDGIE_DISTRIBUTION_OFFSET_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_MERKLE_ROOT_","outputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes","name":"ipfsCid","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_STARTING_INDEX_BLOCK_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_STARTING_INDEX_SET_","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_STARTING_INDEX_VALUE_","outputs":[{"internalType":"uint248","name":"","type":"uint248"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_URI_IS_FINALIZED_","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"getMintsAndMintTimeForTier","outputs":[{"components":[{"internalType":"uint256","name":"unlockTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"internalType":"struct Hedgies.TierMintingInformation","name":"","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":[{"internalType":"address","name":"ethereumAddress","type":"address"},{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"isAddressEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintHedgie","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintHedgieTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxMint","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"reserveHedgies","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":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"distributionMintRate","type":"uint256"}],"name":"setDistributionMintRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"distributionOffset","type":"uint256"}],"name":"setDistributionOffset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes","name":"ipfsCid","type":"bytes"}],"name":"setMerkleRootAndCid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setStartingIndex","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101c0604081905260006101a08190526200001d91601091620003d0565b506011805460ff19169055600060138190556014553480156200003f57600080fd5b50604051620042f8380380620042f88339810160408190526200006291620006c1565b89516020808c01518451918501516040860151919291620000856000846200022e565b620000b17f166dd142f324932e2bb9b86545e760e8c544f1f10f7296e5bc613dfb913294b7836200022e565b620000dd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6826200022e565b50508251620000f591506001906020850190620003d0565b5080516200010b906002906020840190620003d0565b5050600b805460ff1916905550835188118015906200012f57506020840151845111155b80156200014457506040840151602085015111155b801562000155575060408401518310155b6200017d5760405162461bcd60e51b81526004016200017490620007a1565b60405180910390fd5b6020850151855110801562000199575060408501516020860151105b620001b85760405162461bcd60e51b8152600401620001749062000811565b608089905260a083905260c0889052845160e0526020808601516101005260408087015161012052855161014052908501516101605284015161018052620002018787620002b9565b80516200020e906200032a565b60208101516200021e906200036c565b5050505050505050505062000965565b6200023a8282620003a3565b620002b5576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905562000274620003cc565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b604080518082019091528281526020808201839052600c84815583518392620002e891600d91870190620003d0565b509050507fd64adf355d64820626fb2b4bc48f5eb3f69cd779b3b8a648b2189a4e439a5e6a816040516200031d919062000862565b60405180910390a1505050565b600e8190556040517f388689f95f0b631a107fe728d4bb2294bc297bbcf80ef0ac7913728f154ee94c9062000361908390620008aa565b60405180910390a150565b600f8190556040517f9c8f75dfe41f02770d5fa8683102d310f05f02ad8fc46599a0f530cdfdfc51629062000361908390620008aa565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3390565b828054620003de9062000912565b90600052602060002090601f0160209004810192826200040257600085556200044d565b82601f106200041d57805160ff19168380011785556200044d565b828001600101855582156200044d579182015b828111156200044d57825182559160200191906001019062000430565b506200045b9291506200045f565b5090565b5b808211156200045b576000815560010162000460565b60006001600160401b038311156200049257620004926200094f565b6020808402620004a281620008b3565b92508284878387011115620004b657600080fd5b600092505b86831015620004db578051825260019290920191908301908301620004bb565b505050509392505050565b60006001600160401b038311156200050257620005026200094f565b62000517601f8401601f1916602001620008b3565b90508281528383830111156200052c57600080fd5b6200053c836020830184620008df565b9392505050565b600082601f83011262000554578081fd5b604051606081016001600160401b03811182821017156200057957620005796200094f565b6040528083606081018610156200058e578384fd5b835b6003811015620005c75781516001600160a01b0381168114620005b1578586fd5b8352602092830192919091019060010162000590565b509195945050505050565b6000601f8381840112620005e4578182fd5b604080519081016001600160401b03811182821017156200060957620006096200094f565b6040528084845b600281101562000655578151870188868201126200062c578687fd5b805160206200063f8b83838601620004e6565b8652948501949390930192505060010162000610565b50919695505050505050565b600082601f83011262000672578081fd5b6200053c8360028462000476565b600082601f83011262000691578081fd5b6200053c8360038462000476565b600082601f830112620006b0578081fd5b6200053c83835160208501620004e6565b6000806000806000806000806000806102208b8d031215620006e1578586fd5b8a516001600160401b0380821115620006f8578788fd5b620007068e838f01620005d2565b9b5060208d01519a5060408d0151995060608d0151985060808d015191508082111562000731578788fd5b50620007408d828e016200069f565b965050620007528c60a08d0162000680565b9450620007648c6101008d0162000680565b93506101608b015192506200077e8c6101808d0162000543565b9150620007908c6101e08d0162000661565b90509295989b9194979a5092959850565b6020808252604a908201527f45616368206d696e742074696572206d7573742067746520746865207072657660408201527f696f75732c20696e636c756465732072657365727665537570706c7920616e64606082015269206d6178537570706c7960b01b608082015260a00190565b60208082526031908201527f456163682074696572206d75737420756e6c6f636b206c61746572207468616e604082015270207468652070726576696f7573206f6e6560781b606082015260800190565b600060208252825160208301526020830151604080840152805180606085015262000895816080860160208501620008df565b601f01601f1916929092016080019392505050565b90815260200190565b6040518181016001600160401b0381118282101715620008d757620008d76200094f565b604052919050565b60005b83811015620008fc578181015183820152602001620008e2565b838111156200090c576000848401525b50505050565b6002810460018216806200092757607f821691505b602082108114156200094957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610180516138c062000a38600039600081816107820152818161080d0152818161088201528181610c0e0152818161127e01526116fe015260008181610bb4015261105b015260008181610b520152611580015260008181610beb0152611415015260008181610b9101526116d1015260008181610b2f01526110c3015260008181610de90152818161118601526112ec0152600081816107c201528181610d1b01526114f60152600061177001526138c06000f3fe608060405234801561001057600080fd5b506004361061038e5760003560e01c80636a2cdaa4116101de578063c87b56dd1161010f578063ea372cdf116100ad578063f8a7aa261161007c578063f8a7aa26146106d3578063fc350dcb146106db578063fd7f7e9d146106e3578063ff1b6556146106f65761038e565b8063ea372cdf146106a8578063efb37b37146106b0578063f1aea36c146106b8578063f31a1b63146106cb5761038e565b8063d5872709116100e9578063d58727091461067d578063e985e9c514610685578063e986655014610698578063ea0ad7dd146106a05761038e565b8063c87b56dd1461064f578063d539139314610662578063d547741f1461066a5761038e565b806396bb414f1161017c578063a22cb46511610156578063a22cb46514610619578063a3ba95841461062c578063aa66797b14610634578063b88d4fde1461063c5761038e565b806396bb414f14610601578063980cd4b214610609578063a217fddf146106115761038e565b80638456cb59116101b85780638456cb59146105cb57806391d14854146105d3578063921aab7e146105e657806395d89b41146105f95761038e565b80636a2cdaa4146105a857806370a08231146105b0578063830f7467146105c35761038e565b80632f745c59116102c35780634bb278f3116102615780635b12179f116102305780635b12179f146105725780635c975abb146105855780636352211e1461058d578063648c9f40146105a05761038e565b80634bb278f31461053c5780634f6ccce71461054457806351db9d981461055757806355f804b31461055f5761038e565b80633da232e21161029d5780633da232e2146104fb5780633f4ba83a1461050e57806342842e0e14610516578063463ea48f146105295761038e565b80632f745c59146104cd57806332cb6b0c146104e057806336568abe146104e85761038e565b80630badd4da116103305780632277390f1161030a5780632277390f1461047f57806323b872dd14610494578063248a9ca3146104a75780632f2ff15d146104ba5761038e565b80630badd4da14610442578063135206581461046257806318160ddd146104775761038e565b8063062089a01161036c578063062089a0146103e457806306fdde03146103fa578063081812fc1461040f578063095ea7b31461042f5761038e565b806301ffc9a714610393578063028d41e3146103bc5780630550b96e146103d1575b600080fd5b6103a66103a1366004612b20565b6106fe565b6040516103b39190612d26565b60405180910390f35b6103cf6103ca366004612a1b565b610720565b005b6103cf6103df366004612a9c565b6108d6565b6103ec6108f1565b6040516103b3929190612d3a565b610402610988565b6040516103b39190612d82565b61042261041d366004612a9c565b610a1a565b6040516103b39190612cd5565b6103cf61043d366004612a1b565b610a5d565b610455610450366004612a9c565b610af5565b6040516103b391906136f8565b61046a610c35565b6040516103b39190612d31565b61046a610c41565b610487610c47565b6040516103b3919061370f565b6103cf6104a23660046128da565b610c5b565b61046a6104b5366004612a9c565b610c93565b6103cf6104c8366004612ab4565b610ca8565b61046a6104db366004612a1b565b610cc7565b61046a610d19565b6103cf6104f6366004612ab4565b610d3d565b6103cf610509366004612ab4565b610d7f565b6103cf610e6c565b6103cf6105243660046128da565b610e85565b6103a661053736600461288e565b610ea0565b6103cf610eb5565b61046a610552366004612a9c565b610f1f565b6103a6610f7a565b6103cf61056d366004612b58565b610f83565b6103cf610580366004612a9c565b610fff565b6103a6611016565b61042261059b366004612a9c565b61101f565b61046a611054565b61046a611059565b61046a6105be36600461288e565b61107d565b61046a6110c1565b6103cf6110e5565b6103a66105e1366004612ab4565b6110fb565b6103cf6105f4366004612b98565b611124565b6104026112b2565b61046a6112c1565b61046a6112c7565b61046a6112cd565b6103cf6106273660046129e1565b6112d2565b61046a6112e4565b61046a6112ea565b6103cf61064a366004612915565b61130e565b61040261065d366004612a9c565b61134d565b61046a6113d0565b6103cf610678366004612ab4565b6113f4565b61046a611413565b6103a66106933660046128a8565b611437565b6103cf611465565b61046a61157e565b6104026115a2565b61046a611630565b6103a66106c6366004612a44565b611654565b61046a6116cf565b6103a66116f3565b61046a6116fc565b6103cf6106f1366004612ad6565b611720565b61046a61176e565b600061070982611792565b806107185750610718826117b7565b90505b919050565b610728611016565b1561074e5760405162461bcd60e51b815260040161074590613201565b60405180910390fd5b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66107808161077b6117dc565b6117e0565b7f00000000000000000000000000000000000000000000000000000000000000008210156107c05760405162461bcd60e51b815260040161074590613475565b7f000000000000000000000000000000000000000000000000000000000000000082106107ff5760405162461bcd60e51b815260040161074590612feb565b6000610809610c41565b90507f000000000000000000000000000000000000000000000000000000000000000081101561084b5760405162461bcd60e51b815260040161074590613040565b6000670de0b6b3a7640000600f5442610864919061376e565b600e54610871919061374f565b61087b919061373b565b90506108a77f000000000000000000000000000000000000000000000000000000000000000082613723565b82106108c55760405162461bcd60e51b815260040161074590613627565b6108cf8585611844565b5050505050565b60006108e48161077b6117dc565b6108ed82611923565b5050565b600c8054600d8054919291610905906137c8565b80601f0160208091040260200160405190810160405280929190818152602001828054610931906137c8565b801561097e5780601f106109535761010080835404028352916020019161097e565b820191906000526020600020905b81548152906001019060200180831161096157829003601f168201915b5050505050905082565b606060018054610997906137c8565b80601f01602080910402602001604051908101604052809291908181526020018280546109c3906137c8565b8015610a105780601f106109e557610100808354040283529160200191610a10565b820191906000526020600020905b8154815290600101906020018083116109f357829003601f168201915b5050505050905090565b6000610a2582611963565b610a415760405162461bcd60e51b815260040161074590613350565b506000908152600560205260409020546001600160a01b031690565b6000610a688261101f565b9050806001600160a01b0316836001600160a01b03161415610a9c5760405162461bcd60e51b815260040161074590613434565b806001600160a01b0316610aae6117dc565b6001600160a01b03161480610aca5750610aca816106936117dc565b610ae65760405162461bcd60e51b81526004016107459061322b565b610af08383611980565b505050565b610afd6126c7565b60038210610b1d5760405162461bcd60e51b81526004016107459061314f565b81610b7b5750604080518082019091527f000000000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000602082015261071b565b8160011415610bdd5750604080518082019091527f000000000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000602082015261071b565b5050604080518082019091527f000000000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000602082015290565b670de0b6b3a764000081565b60095490565b60145461010090046001600160f81b031681565b610c6c610c666117dc565b826119ee565b610c885760405162461bcd60e51b8152600401610745906134ff565b610af0838383611a6b565b60009081526020819052604090206001015490565b610cb182610c93565b610cbd8161077b6117dc565b610af08383611b98565b6000610cd28361107d565b8210610cf05760405162461bcd60e51b815260040161074590612f17565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b7f000000000000000000000000000000000000000000000000000000000000000081565b610d456117dc565b6001600160a01b0316816001600160a01b031614610d755760405162461bcd60e51b815260040161074590613684565b6108ed8282611c1d565b610d87611016565b15610da45760405162461bcd60e51b815260040161074590613201565b7f166dd142f324932e2bb9b86545e760e8c544f1f10f7296e5bc613dfb913294b7610dd18161077b6117dc565b6000610ddb610c41565b90506000610e1285610e0d847f000000000000000000000000000000000000000000000000000000000000000061376e565b611ca0565b905060008111610e345760405162461bcd60e51b815260040161074590612e6c565b60005b81811015610e6457610e5285610e4d8386613723565b611844565b80610e5c81613803565b915050610e37565b505050505050565b6000610e7a8161077b6117dc565b610e82611cb6565b50565b610af08383836040518060200160405280600081525061130e565b60126020526000908152604090205460ff1681565b60115460ff1615610ed85760405162461bcd60e51b815260040161074590612ec9565b6000610ee68161077b6117dc565b6011805460ff191660011790556040517f70849f32426c8e8e9b091c426d915ade1748f549c898739533b9e4527f235f3a90600090a150565b6000610f29610c41565b8210610f475760405162461bcd60e51b81526004016107459061357e565b60098281548110610f6857634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60115460ff1681565b60115460ff1615610fa65760405162461bcd60e51b815260040161074590612ec9565b6000610fb48161077b6117dc565b610fc0601084846126e1565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f68383604051610ff2929190612d53565b60405180910390a1505050565b600061100d8161077b6117dc565b6108ed82611d24565b600b5460ff1690565b6000818152600360205260408120546001600160a01b0316806107185760405162461bcd60e51b8152600401610745906132d2565b600381565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006001600160a01b0382166110a55760405162461bcd60e51b815260040161074590613288565b506001600160a01b031660009081526004602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006110f38161077b6117dc565b610e82611d59565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61112c611016565b156111495760405162461bcd60e51b815260040161074590613201565b600061115484610af5565b80519091504210156111785760405162461bcd60e51b815260040161074590613118565b6000611182610c41565b90507f00000000000000000000000000000000000000000000000000000000000000008110156111c45760405162461bcd60e51b8152600401610745906135ca565b816020015181106111e75760405162461bcd60e51b815260040161074590612e28565b6111f36001600361376e565b85101561126d573360009081526012602052604090205460ff161561122a5760405162461bcd60e51b815260040161074590612dca565b61123633868686611654565b6112525760405162461bcd60e51b815260040161074590613550565b336000908152601260205260409020805460ff191660011790555b6112773382611844565b6112a260017f000000000000000000000000000000000000000000000000000000000000000061376e565b8114156108cf576108cf43611db4565b606060028054610997906137c8565b600f5481565b60135481565b600081565b6108ed6112dd6117dc565b8383611de9565b600e5481565b7f000000000000000000000000000000000000000000000000000000000000000081565b61131f6113196117dc565b836119ee565b61133b5760405162461bcd60e51b8152600401610745906134ff565b61134784848484611e8c565b50505050565b606061135882611963565b6113745760405162461bcd60e51b8152600401610745906133e5565b600061137e611ebf565b9050600081511161139e57604051806020016040528060008152506113c9565b806113a884611ece565b6040516020016113b9929190612c31565b6040516020818303038152906040525b9392505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6113fd82610c93565b6114098161077b6117dc565b610af08383611c1d565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60145460ff16156114885760405162461bcd60e51b8152600401610745906131ca565b601354806114a85760405162461bcd60e51b8152600401610745906134ca565b60006114b560014361376e565b905060006114c3838361376e565b905061010081106114ef576114da6101008261381e565b6114e4908361376e565b92506114ef83611db4565b600061151c7f0000000000000000000000000000000000000000000000000000000000000000854061381e565b601480546001600160f81b0383166101000260ff9091161760ff191660011790556040519091507fd9845ef2ab80825e3d5d8fc0d194ccd09d895e75161664caa6c2cb9776c726179061157090839061370f565b60405180910390a150505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b601080546115af906137c8565b80601f01602080910402602001604051908101604052809291908181526020018280546115db906137c8565b80156116285780601f106115fd57610100808354040283529160200191611628565b820191906000526020600020905b81548152906001019060200180831161160b57829003601f168201915b505050505081565b7f166dd142f324932e2bb9b86545e760e8c544f1f10f7296e5bc613dfb913294b781565b600080858560405160200161166a929190612c01565b6040516020818303038152906040528051906020012090506116c384848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600c549150849050611fe9565b9150505b949350505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60145460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600061172e8161077b6117dc565b6113478484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611fff92505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006001600160e01b03198216637965db0b60e01b148061071857506107188261205f565b60006001600160e01b0319821663780e9d6360e01b1480610718575061071882612078565b3390565b6117ea82826110fb565b6108ed57611802816001600160a01b031660146120b8565b61180d8360206120b8565b60405160200161181e929190612c60565b60408051601f198184030181529082905262461bcd60e51b825261074591600401612d82565b6001600160a01b03821661186a5760405162461bcd60e51b81526004016107459061331b565b61187381611963565b156118905760405162461bcd60e51b815260040161074590612fb4565b61189c6000838361226a565b6001600160a01b03821660009081526004602052604081208054600192906118c5908490613723565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600e8190556040517f388689f95f0b631a107fe728d4bb2294bc297bbcf80ef0ac7913728f154ee94c90611958908390612d31565b60405180910390a150565b6000908152600360205260409020546001600160a01b0316151590565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119b58261101f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006119f982611963565b611a155760405162461bcd60e51b81526004016107459061317e565b6000611a208361101f565b9050806001600160a01b0316846001600160a01b03161480611a5b5750836001600160a01b0316611a5084610a1a565b6001600160a01b0316145b806116c757506116c78185611437565b826001600160a01b0316611a7e8261101f565b6001600160a01b031614611aa45760405162461bcd60e51b81526004016107459061339c565b6001600160a01b038216611aca5760405162461bcd60e51b81526004016107459061309d565b611ad583838361226a565b611ae0600082611980565b6001600160a01b0383166000908152600460205260408120805460019290611b0990849061376e565b90915550506001600160a01b0382166000908152600460205260408120805460019290611b37908490613723565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611ba282826110fb565b6108ed576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611bd96117dc565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611c2782826110fb565b156108ed576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055611c5c6117dc565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000818310611caf57816113c9565b5090919050565b611cbe611016565b611cda5760405162461bcd60e51b815260040161074590612dfa565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611d0d6117dc565b604051611d1a9190612cd5565b60405180910390a1565b600f8190556040517f9c8f75dfe41f02770d5fa8683102d310f05f02ad8fc46599a0f530cdfdfc516290611958908390612d31565b611d61611016565b15611d7e5760405162461bcd60e51b815260040161074590613201565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d0d6117dc565b60138190556040517f869ad862af4a9c4e17b697db8f3808f4c71cefaddbd8be16d1e105da1a0a010b90611958908390612d31565b816001600160a01b0316836001600160a01b03161415611e1b5760405162461bcd60e51b8152600401610745906130e1565b6001600160a01b0383811660008181526006602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611e7f908590612d26565b60405180910390a3505050565b611e97848484611a6b565b611ea3848484846122f3565b6113475760405162461bcd60e51b815260040161074590612f62565b606060108054610997906137c8565b606081611ef357506040805180820190915260018152600360fc1b602082015261071b565b8160005b8115611f1d5780611f0781613803565b9150611f169050600a8361373b565b9150611ef7565b60008167ffffffffffffffff811115611f4657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611f70576020820181803683370190505b5090505b84156116c757611f8560018361376e565b9150611f92600a8661381e565b611f9d906030613723565b60f81b818381518110611fc057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611fe2600a8661373b565b9450611f74565b600082611ff6858461240b565b14949350505050565b604080518082019091528281526020808201839052600c8481558351839261202c91600d91870190612765565b509050507fd64adf355d64820626fb2b4bc48f5eb3f69cd779b3b8a648b2189a4e439a5e6a81604051610ff291906136d3565b6001600160e01b031981166301ffc9a760e01b14919050565b60006001600160e01b031982166380ac58cd60e01b14806120a957506001600160e01b03198216635b5e139f60e01b145b80610718575061071882611792565b606060006120c783600261374f565b6120d2906002613723565b67ffffffffffffffff8111156120f857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612122576020820181803683370190505b509050600360fc1b8160008151811061214b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061218857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006121ac84600261374f565b6121b7906001613723565b90505b600181111561224b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106121f957634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061221d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612244816137b1565b90506121ba565b5083156113c95760405162461bcd60e51b815260040161074590612d95565b612275838383610af0565b6001600160a01b0383166122915761228c816124c3565b6122b4565b816001600160a01b0316836001600160a01b0316146122b4576122b48382612507565b6001600160a01b0382166122d0576122cb816125a4565b610af0565b826001600160a01b0316826001600160a01b031614610af057610af0828261267d565b6000612307846001600160a01b03166126c1565b1561240357836001600160a01b031663150b7a026123236117dc565b8786866040518563ffffffff1660e01b81526004016123459493929190612ce9565b602060405180830381600087803b15801561235f57600080fd5b505af192505050801561238f575060408051601f3d908101601f1916820190925261238c91810190612b3c565b60015b6123e9573d8080156123bd576040519150601f19603f3d011682016040523d82523d6000602084013e6123c2565b606091505b5080516123e15760405162461bcd60e51b815260040161074590612f62565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506116c7565b5060016116c7565b600081815b84518110156124bb57600085828151811061243b57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161247c57828160405160200161245f929190612c23565b6040516020818303038152906040528051906020012092506124a8565b808360405160200161248f929190612c23565b6040516020818303038152906040528051906020012092505b50806124b381613803565b915050612410565b509392505050565b600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b600060016125148461107d565b61251e919061376e565b600083815260086020526040902054909150808214612571576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b6009546000906125b69060019061376e565b6000838152600a6020526040812054600980549394509092849081106125ec57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806009838154811061261b57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548061266157634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006126888361107d565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b3b151590565b604051806040016040528060008152602001600081525090565b8280546126ed906137c8565b90600052602060002090601f01602090048101928261270f5760008555612755565b82601f106127285782800160ff19823516178555612755565b82800160010185558215612755579182015b8281111561275557823582559160200191906001019061273a565b506127619291506127d9565b5090565b828054612771906137c8565b90600052602060002090601f0160209004810192826127935760008555612755565b82601f106127ac57805160ff1916838001178555612755565b82800160010185558215612755579182015b828111156127555782518255916020019190600101906127be565b5b8082111561276157600081556001016127da565b80356001600160a01b038116811461071b57600080fd5b60008083601f840112612816578081fd5b50813567ffffffffffffffff81111561282d578182fd5b602083019150836020808302850101111561284757600080fd5b9250929050565b60008083601f84011261285f578182fd5b50813567ffffffffffffffff811115612876578182fd5b60208301915083602082850101111561284757600080fd5b60006020828403121561289f578081fd5b6113c9826127ee565b600080604083850312156128ba578081fd5b6128c3836127ee565b91506128d1602084016127ee565b90509250929050565b6000806000606084860312156128ee578081fd5b6128f7846127ee565b9250612905602085016127ee565b9150604084013590509250925092565b6000806000806080858703121561292a578081fd5b612933856127ee565b935060206129428187016127ee565b935060408601359250606086013567ffffffffffffffff80821115612965578384fd5b818801915088601f830112612978578384fd5b81358181111561298a5761298a61385e565b604051601f8201601f19168101850183811182821017156129ad576129ad61385e565b60405281815283820185018b10156129c3578586fd5b81858501868301379081019093019390935250939692955090935050565b600080604083850312156129f3578182fd5b6129fc836127ee565b915060208301358015158114612a10578182fd5b809150509250929050565b60008060408385031215612a2d578182fd5b612a36836127ee565b946020939093013593505050565b60008060008060608587031215612a59578384fd5b612a62856127ee565b935060208501359250604085013567ffffffffffffffff811115612a84578283fd5b612a9087828801612805565b95989497509550505050565b600060208284031215612aad578081fd5b5035919050565b60008060408385031215612ac6578182fd5b823591506128d1602084016127ee565b600080600060408486031215612aea578283fd5b83359250602084013567ffffffffffffffff811115612b07578283fd5b612b138682870161284e565b9497909650939450505050565b600060208284031215612b31578081fd5b81356113c981613874565b600060208284031215612b4d578081fd5b81516113c981613874565b60008060208385031215612b6a578182fd5b823567ffffffffffffffff811115612b80578283fd5b612b8c8582860161284e565b90969095509350505050565b600080600060408486031215612bac578081fd5b83359250602084013567ffffffffffffffff811115612bc9578182fd5b612b1386828701612805565b60008151808452612bed816020860160208601613785565b601f01601f19169290920160200192915050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b918252602082015260400190565b60008351612c43818460208801613785565b835190830190612c57818360208801613785565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612c98816017850160208801613785565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612cc9816028840160208801613785565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d1c90830184612bd5565b9695505050505050565b901515815260200190565b90815260200190565b6000838252604060208301526116c76040830184612bd5565b60006020825282602083015282846040840137818301604090810191909152601f909201601f19160101919050565b6000602082526113c96020830184612bd5565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b60208082526016908201527514d95b99195c88185b1c9958591e4818db185a5b595960521b604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526024908201527f4e6f2048656467696573206c65667420746f206d696e742061742074686973206040820152633a34b2b960e11b606082015260800190565b60208082526037908201527f43616e6e6f74207072656d696e74206f6e6365206d6178207072656d696e742060408201527f737570706c7920686173206265656e2072656163686564000000000000000000606082015260800190565b6020808252602e908201527f43616e6e6f7420757064617465206f6e6365207468652073616c65206861732060408201526d1899595b88199a5b985b1a5e995960921b606082015260800190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526035908201527f43616e6e6f74206d696e7420746f6b656e207769746820746f6b656e49642067604082015274726561746572207468616e206d6178537570706c7960581b606082015260800190565b6020808252603c908201527f43616e6e6f74206d696e7420746f6b656e20666f72206469737472696275746960408201527f6f6e206265666f72652073616c652068617320636f6d706c6574656400000000606082015260800190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252601f908201527f54696572206d696e74696e67206973206e6f742079657420616c6c6f77656400604082015260600190565b602080825260159082015274125b9d985b1a59081d1a595c881c1c9bdd9a591959605a1b604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601d908201527f5374617274696e6720696e64657820697320616c726561647920736574000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526035908201527f43616e6e6f74206d696e7420746f6b656e207769746820746f6b656e4964206c604082015274746520746965722074776f206d6178537570706c7960581b606082015260800190565b6020808252818101527f5374617274696e6720696e64657820626c6f636b206d75737420626520736574604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526014908201527324b73b30b634b21026b2b935b63290383937b7b360611b604082015260600190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b60208082526038908201527f4e6f7420616c6c20486564676965732066726f6d20746865207265736572766560408201527f20737570706c792068617665206265656e206d696e7465640000000000000000606082015260800190565b6020808252603a908201527f4174207468652063757272656e742074696d657374616d7020737570706c792060408201527f69732063617070656420666f7220646973747269627574696e67000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b6000602082528251602083015260208301516040808401526116c76060840182612bd5565b815181526020918201519181019190915260400190565b6001600160f81b0391909116815260200190565b6000821982111561373657613736613832565b500190565b60008261374a5761374a613848565b500490565b600081600019048311821515161561376957613769613832565b500290565b60008282101561378057613780613832565b500390565b60005b838110156137a0578181015183820152602001613788565b838111156113475750506000910152565b6000816137c0576137c0613832565b506000190190565b6002810460018216806137dc57607f821691505b602082108114156137fd57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561381757613817613832565b5060010190565b60008261382d5761382d613848565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610e8257600080fdfea264697066735822122021da85f49cc321129910fe7167e2f2bd8c5f2b50ecdaf7f58d74417841ea6b4964736f6c634300080000330000000000000000000000000000000000000000000000000000000000000220956aa77e5564397136dda794eda1f94ef6b13885ef62e53adfb01476beed494e000000000000000000000000000000000000000000000000000000000000012d414a1d07fdcca8b4e38e6fa88cacbb7a5e90ca86c6e7c17e0b7d2ed2a6ed669200000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000061f94af00000000000000000000000000000000000000000000000000000000061fa9c700000000000000000000000000000000000000000000000000000000061fe90f00000000000000000000000000000000000000000000000000000000000000452000000000000000000000000000000000000000000000000000000000000098b000000000000000000000000000000000000000000000000000000000000098b0000000000000000000000000000000000000000000000000000000000001068000000000000000000000000058633dae2eb155f74f3010b81877a13a0a7d11b00000000000000000000000063eb2274670069456153d7d6f79b16f1803f28aa000000000000000000000000500dd93a74dbfa65a4eeda44da489adcef530cb900000000000000000000000000000000000000000000000000001990831b9711000000000000000000000000000000000000000000000000000000006202857000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000f4865646769657320627920645964580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000748454447494553000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020d248eb270db23ccc0d86c347fb15203384a7335533ff10c90bf3fa2bd2842c39

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061038e5760003560e01c80636a2cdaa4116101de578063c87b56dd1161010f578063ea372cdf116100ad578063f8a7aa261161007c578063f8a7aa26146106d3578063fc350dcb146106db578063fd7f7e9d146106e3578063ff1b6556146106f65761038e565b8063ea372cdf146106a8578063efb37b37146106b0578063f1aea36c146106b8578063f31a1b63146106cb5761038e565b8063d5872709116100e9578063d58727091461067d578063e985e9c514610685578063e986655014610698578063ea0ad7dd146106a05761038e565b8063c87b56dd1461064f578063d539139314610662578063d547741f1461066a5761038e565b806396bb414f1161017c578063a22cb46511610156578063a22cb46514610619578063a3ba95841461062c578063aa66797b14610634578063b88d4fde1461063c5761038e565b806396bb414f14610601578063980cd4b214610609578063a217fddf146106115761038e565b80638456cb59116101b85780638456cb59146105cb57806391d14854146105d3578063921aab7e146105e657806395d89b41146105f95761038e565b80636a2cdaa4146105a857806370a08231146105b0578063830f7467146105c35761038e565b80632f745c59116102c35780634bb278f3116102615780635b12179f116102305780635b12179f146105725780635c975abb146105855780636352211e1461058d578063648c9f40146105a05761038e565b80634bb278f31461053c5780634f6ccce71461054457806351db9d981461055757806355f804b31461055f5761038e565b80633da232e21161029d5780633da232e2146104fb5780633f4ba83a1461050e57806342842e0e14610516578063463ea48f146105295761038e565b80632f745c59146104cd57806332cb6b0c146104e057806336568abe146104e85761038e565b80630badd4da116103305780632277390f1161030a5780632277390f1461047f57806323b872dd14610494578063248a9ca3146104a75780632f2ff15d146104ba5761038e565b80630badd4da14610442578063135206581461046257806318160ddd146104775761038e565b8063062089a01161036c578063062089a0146103e457806306fdde03146103fa578063081812fc1461040f578063095ea7b31461042f5761038e565b806301ffc9a714610393578063028d41e3146103bc5780630550b96e146103d1575b600080fd5b6103a66103a1366004612b20565b6106fe565b6040516103b39190612d26565b60405180910390f35b6103cf6103ca366004612a1b565b610720565b005b6103cf6103df366004612a9c565b6108d6565b6103ec6108f1565b6040516103b3929190612d3a565b610402610988565b6040516103b39190612d82565b61042261041d366004612a9c565b610a1a565b6040516103b39190612cd5565b6103cf61043d366004612a1b565b610a5d565b610455610450366004612a9c565b610af5565b6040516103b391906136f8565b61046a610c35565b6040516103b39190612d31565b61046a610c41565b610487610c47565b6040516103b3919061370f565b6103cf6104a23660046128da565b610c5b565b61046a6104b5366004612a9c565b610c93565b6103cf6104c8366004612ab4565b610ca8565b61046a6104db366004612a1b565b610cc7565b61046a610d19565b6103cf6104f6366004612ab4565b610d3d565b6103cf610509366004612ab4565b610d7f565b6103cf610e6c565b6103cf6105243660046128da565b610e85565b6103a661053736600461288e565b610ea0565b6103cf610eb5565b61046a610552366004612a9c565b610f1f565b6103a6610f7a565b6103cf61056d366004612b58565b610f83565b6103cf610580366004612a9c565b610fff565b6103a6611016565b61042261059b366004612a9c565b61101f565b61046a611054565b61046a611059565b61046a6105be36600461288e565b61107d565b61046a6110c1565b6103cf6110e5565b6103a66105e1366004612ab4565b6110fb565b6103cf6105f4366004612b98565b611124565b6104026112b2565b61046a6112c1565b61046a6112c7565b61046a6112cd565b6103cf6106273660046129e1565b6112d2565b61046a6112e4565b61046a6112ea565b6103cf61064a366004612915565b61130e565b61040261065d366004612a9c565b61134d565b61046a6113d0565b6103cf610678366004612ab4565b6113f4565b61046a611413565b6103a66106933660046128a8565b611437565b6103cf611465565b61046a61157e565b6104026115a2565b61046a611630565b6103a66106c6366004612a44565b611654565b61046a6116cf565b6103a66116f3565b61046a6116fc565b6103cf6106f1366004612ad6565b611720565b61046a61176e565b600061070982611792565b806107185750610718826117b7565b90505b919050565b610728611016565b1561074e5760405162461bcd60e51b815260040161074590613201565b60405180910390fd5b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66107808161077b6117dc565b6117e0565b7f000000000000000000000000000000000000000000000000000000000000098b8210156107c05760405162461bcd60e51b815260040161074590613475565b7f000000000000000000000000000000000000000000000000000000000000106882106107ff5760405162461bcd60e51b815260040161074590612feb565b6000610809610c41565b90507f000000000000000000000000000000000000000000000000000000000000098b81101561084b5760405162461bcd60e51b815260040161074590613040565b6000670de0b6b3a7640000600f5442610864919061376e565b600e54610871919061374f565b61087b919061373b565b90506108a77f000000000000000000000000000000000000000000000000000000000000098b82613723565b82106108c55760405162461bcd60e51b815260040161074590613627565b6108cf8585611844565b5050505050565b60006108e48161077b6117dc565b6108ed82611923565b5050565b600c8054600d8054919291610905906137c8565b80601f0160208091040260200160405190810160405280929190818152602001828054610931906137c8565b801561097e5780601f106109535761010080835404028352916020019161097e565b820191906000526020600020905b81548152906001019060200180831161096157829003601f168201915b5050505050905082565b606060018054610997906137c8565b80601f01602080910402602001604051908101604052809291908181526020018280546109c3906137c8565b8015610a105780601f106109e557610100808354040283529160200191610a10565b820191906000526020600020905b8154815290600101906020018083116109f357829003601f168201915b5050505050905090565b6000610a2582611963565b610a415760405162461bcd60e51b815260040161074590613350565b506000908152600560205260409020546001600160a01b031690565b6000610a688261101f565b9050806001600160a01b0316836001600160a01b03161415610a9c5760405162461bcd60e51b815260040161074590613434565b806001600160a01b0316610aae6117dc565b6001600160a01b03161480610aca5750610aca816106936117dc565b610ae65760405162461bcd60e51b81526004016107459061322b565b610af08383611980565b505050565b610afd6126c7565b60038210610b1d5760405162461bcd60e51b81526004016107459061314f565b81610b7b5750604080518082019091527f0000000000000000000000000000000000000000000000000000000061f94af081527f0000000000000000000000000000000000000000000000000000000000000452602082015261071b565b8160011415610bdd5750604080518082019091527f0000000000000000000000000000000000000000000000000000000061fa9c7081527f000000000000000000000000000000000000000000000000000000000000098b602082015261071b565b5050604080518082019091527f0000000000000000000000000000000000000000000000000000000061fe90f081527f000000000000000000000000000000000000000000000000000000000000098b602082015290565b670de0b6b3a764000081565b60095490565b60145461010090046001600160f81b031681565b610c6c610c666117dc565b826119ee565b610c885760405162461bcd60e51b8152600401610745906134ff565b610af0838383611a6b565b60009081526020819052604090206001015490565b610cb182610c93565b610cbd8161077b6117dc565b610af08383611b98565b6000610cd28361107d565b8210610cf05760405162461bcd60e51b815260040161074590612f17565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b7f000000000000000000000000000000000000000000000000000000000000106881565b610d456117dc565b6001600160a01b0316816001600160a01b031614610d755760405162461bcd60e51b815260040161074590613684565b6108ed8282611c1d565b610d87611016565b15610da45760405162461bcd60e51b815260040161074590613201565b7f166dd142f324932e2bb9b86545e760e8c544f1f10f7296e5bc613dfb913294b7610dd18161077b6117dc565b6000610ddb610c41565b90506000610e1285610e0d847f000000000000000000000000000000000000000000000000000000000000012d61376e565b611ca0565b905060008111610e345760405162461bcd60e51b815260040161074590612e6c565b60005b81811015610e6457610e5285610e4d8386613723565b611844565b80610e5c81613803565b915050610e37565b505050505050565b6000610e7a8161077b6117dc565b610e82611cb6565b50565b610af08383836040518060200160405280600081525061130e565b60126020526000908152604090205460ff1681565b60115460ff1615610ed85760405162461bcd60e51b815260040161074590612ec9565b6000610ee68161077b6117dc565b6011805460ff191660011790556040517f70849f32426c8e8e9b091c426d915ade1748f549c898739533b9e4527f235f3a90600090a150565b6000610f29610c41565b8210610f475760405162461bcd60e51b81526004016107459061357e565b60098281548110610f6857634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60115460ff1681565b60115460ff1615610fa65760405162461bcd60e51b815260040161074590612ec9565b6000610fb48161077b6117dc565b610fc0601084846126e1565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f68383604051610ff2929190612d53565b60405180910390a1505050565b600061100d8161077b6117dc565b6108ed82611d24565b600b5460ff1690565b6000818152600360205260408120546001600160a01b0316806107185760405162461bcd60e51b8152600401610745906132d2565b600381565b7f000000000000000000000000000000000000000000000000000000000000098b81565b60006001600160a01b0382166110a55760405162461bcd60e51b815260040161074590613288565b506001600160a01b031660009081526004602052604090205490565b7f0000000000000000000000000000000000000000000000000000000061f94af081565b60006110f38161077b6117dc565b610e82611d59565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61112c611016565b156111495760405162461bcd60e51b815260040161074590613201565b600061115484610af5565b80519091504210156111785760405162461bcd60e51b815260040161074590613118565b6000611182610c41565b90507f000000000000000000000000000000000000000000000000000000000000012d8110156111c45760405162461bcd60e51b8152600401610745906135ca565b816020015181106111e75760405162461bcd60e51b815260040161074590612e28565b6111f36001600361376e565b85101561126d573360009081526012602052604090205460ff161561122a5760405162461bcd60e51b815260040161074590612dca565b61123633868686611654565b6112525760405162461bcd60e51b815260040161074590613550565b336000908152601260205260409020805460ff191660011790555b6112773382611844565b6112a260017f000000000000000000000000000000000000000000000000000000000000098b61376e565b8114156108cf576108cf43611db4565b606060028054610997906137c8565b600f5481565b60135481565b600081565b6108ed6112dd6117dc565b8383611de9565b600e5481565b7f000000000000000000000000000000000000000000000000000000000000012d81565b61131f6113196117dc565b836119ee565b61133b5760405162461bcd60e51b8152600401610745906134ff565b61134784848484611e8c565b50505050565b606061135882611963565b6113745760405162461bcd60e51b8152600401610745906133e5565b600061137e611ebf565b9050600081511161139e57604051806020016040528060008152506113c9565b806113a884611ece565b6040516020016113b9929190612c31565b6040516020818303038152906040525b9392505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6113fd82610c93565b6114098161077b6117dc565b610af08383611c1d565b7f0000000000000000000000000000000000000000000000000000000061fe90f081565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60145460ff16156114885760405162461bcd60e51b8152600401610745906131ca565b601354806114a85760405162461bcd60e51b8152600401610745906134ca565b60006114b560014361376e565b905060006114c3838361376e565b905061010081106114ef576114da6101008261381e565b6114e4908361376e565b92506114ef83611db4565b600061151c7f0000000000000000000000000000000000000000000000000000000000001068854061381e565b601480546001600160f81b0383166101000260ff9091161760ff191660011790556040519091507fd9845ef2ab80825e3d5d8fc0d194ccd09d895e75161664caa6c2cb9776c726179061157090839061370f565b60405180910390a150505050565b7f000000000000000000000000000000000000000000000000000000000000045281565b601080546115af906137c8565b80601f01602080910402602001604051908101604052809291908181526020018280546115db906137c8565b80156116285780601f106115fd57610100808354040283529160200191611628565b820191906000526020600020905b81548152906001019060200180831161160b57829003601f168201915b505050505081565b7f166dd142f324932e2bb9b86545e760e8c544f1f10f7296e5bc613dfb913294b781565b600080858560405160200161166a929190612c01565b6040516020818303038152906040528051906020012090506116c384848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600c549150849050611fe9565b9150505b949350505050565b7f0000000000000000000000000000000000000000000000000000000061fa9c7081565b60145460ff1681565b7f000000000000000000000000000000000000000000000000000000000000098b81565b600061172e8161077b6117dc565b6113478484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611fff92505050565b7f956aa77e5564397136dda794eda1f94ef6b13885ef62e53adfb01476beed494e81565b60006001600160e01b03198216637965db0b60e01b148061071857506107188261205f565b60006001600160e01b0319821663780e9d6360e01b1480610718575061071882612078565b3390565b6117ea82826110fb565b6108ed57611802816001600160a01b031660146120b8565b61180d8360206120b8565b60405160200161181e929190612c60565b60408051601f198184030181529082905262461bcd60e51b825261074591600401612d82565b6001600160a01b03821661186a5760405162461bcd60e51b81526004016107459061331b565b61187381611963565b156118905760405162461bcd60e51b815260040161074590612fb4565b61189c6000838361226a565b6001600160a01b03821660009081526004602052604081208054600192906118c5908490613723565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600e8190556040517f388689f95f0b631a107fe728d4bb2294bc297bbcf80ef0ac7913728f154ee94c90611958908390612d31565b60405180910390a150565b6000908152600360205260409020546001600160a01b0316151590565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119b58261101f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006119f982611963565b611a155760405162461bcd60e51b81526004016107459061317e565b6000611a208361101f565b9050806001600160a01b0316846001600160a01b03161480611a5b5750836001600160a01b0316611a5084610a1a565b6001600160a01b0316145b806116c757506116c78185611437565b826001600160a01b0316611a7e8261101f565b6001600160a01b031614611aa45760405162461bcd60e51b81526004016107459061339c565b6001600160a01b038216611aca5760405162461bcd60e51b81526004016107459061309d565b611ad583838361226a565b611ae0600082611980565b6001600160a01b0383166000908152600460205260408120805460019290611b0990849061376e565b90915550506001600160a01b0382166000908152600460205260408120805460019290611b37908490613723565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611ba282826110fb565b6108ed576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611bd96117dc565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611c2782826110fb565b156108ed576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055611c5c6117dc565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000818310611caf57816113c9565b5090919050565b611cbe611016565b611cda5760405162461bcd60e51b815260040161074590612dfa565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611d0d6117dc565b604051611d1a9190612cd5565b60405180910390a1565b600f8190556040517f9c8f75dfe41f02770d5fa8683102d310f05f02ad8fc46599a0f530cdfdfc516290611958908390612d31565b611d61611016565b15611d7e5760405162461bcd60e51b815260040161074590613201565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d0d6117dc565b60138190556040517f869ad862af4a9c4e17b697db8f3808f4c71cefaddbd8be16d1e105da1a0a010b90611958908390612d31565b816001600160a01b0316836001600160a01b03161415611e1b5760405162461bcd60e51b8152600401610745906130e1565b6001600160a01b0383811660008181526006602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611e7f908590612d26565b60405180910390a3505050565b611e97848484611a6b565b611ea3848484846122f3565b6113475760405162461bcd60e51b815260040161074590612f62565b606060108054610997906137c8565b606081611ef357506040805180820190915260018152600360fc1b602082015261071b565b8160005b8115611f1d5780611f0781613803565b9150611f169050600a8361373b565b9150611ef7565b60008167ffffffffffffffff811115611f4657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611f70576020820181803683370190505b5090505b84156116c757611f8560018361376e565b9150611f92600a8661381e565b611f9d906030613723565b60f81b818381518110611fc057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611fe2600a8661373b565b9450611f74565b600082611ff6858461240b565b14949350505050565b604080518082019091528281526020808201839052600c8481558351839261202c91600d91870190612765565b509050507fd64adf355d64820626fb2b4bc48f5eb3f69cd779b3b8a648b2189a4e439a5e6a81604051610ff291906136d3565b6001600160e01b031981166301ffc9a760e01b14919050565b60006001600160e01b031982166380ac58cd60e01b14806120a957506001600160e01b03198216635b5e139f60e01b145b80610718575061071882611792565b606060006120c783600261374f565b6120d2906002613723565b67ffffffffffffffff8111156120f857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612122576020820181803683370190505b509050600360fc1b8160008151811061214b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061218857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006121ac84600261374f565b6121b7906001613723565b90505b600181111561224b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106121f957634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061221d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612244816137b1565b90506121ba565b5083156113c95760405162461bcd60e51b815260040161074590612d95565b612275838383610af0565b6001600160a01b0383166122915761228c816124c3565b6122b4565b816001600160a01b0316836001600160a01b0316146122b4576122b48382612507565b6001600160a01b0382166122d0576122cb816125a4565b610af0565b826001600160a01b0316826001600160a01b031614610af057610af0828261267d565b6000612307846001600160a01b03166126c1565b1561240357836001600160a01b031663150b7a026123236117dc565b8786866040518563ffffffff1660e01b81526004016123459493929190612ce9565b602060405180830381600087803b15801561235f57600080fd5b505af192505050801561238f575060408051601f3d908101601f1916820190925261238c91810190612b3c565b60015b6123e9573d8080156123bd576040519150601f19603f3d011682016040523d82523d6000602084013e6123c2565b606091505b5080516123e15760405162461bcd60e51b815260040161074590612f62565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506116c7565b5060016116c7565b600081815b84518110156124bb57600085828151811061243b57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161247c57828160405160200161245f929190612c23565b6040516020818303038152906040528051906020012092506124a8565b808360405160200161248f929190612c23565b6040516020818303038152906040528051906020012092505b50806124b381613803565b915050612410565b509392505050565b600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b600060016125148461107d565b61251e919061376e565b600083815260086020526040902054909150808214612571576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b6009546000906125b69060019061376e565b6000838152600a6020526040812054600980549394509092849081106125ec57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806009838154811061261b57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548061266157634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006126888361107d565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b3b151590565b604051806040016040528060008152602001600081525090565b8280546126ed906137c8565b90600052602060002090601f01602090048101928261270f5760008555612755565b82601f106127285782800160ff19823516178555612755565b82800160010185558215612755579182015b8281111561275557823582559160200191906001019061273a565b506127619291506127d9565b5090565b828054612771906137c8565b90600052602060002090601f0160209004810192826127935760008555612755565b82601f106127ac57805160ff1916838001178555612755565b82800160010185558215612755579182015b828111156127555782518255916020019190600101906127be565b5b8082111561276157600081556001016127da565b80356001600160a01b038116811461071b57600080fd5b60008083601f840112612816578081fd5b50813567ffffffffffffffff81111561282d578182fd5b602083019150836020808302850101111561284757600080fd5b9250929050565b60008083601f84011261285f578182fd5b50813567ffffffffffffffff811115612876578182fd5b60208301915083602082850101111561284757600080fd5b60006020828403121561289f578081fd5b6113c9826127ee565b600080604083850312156128ba578081fd5b6128c3836127ee565b91506128d1602084016127ee565b90509250929050565b6000806000606084860312156128ee578081fd5b6128f7846127ee565b9250612905602085016127ee565b9150604084013590509250925092565b6000806000806080858703121561292a578081fd5b612933856127ee565b935060206129428187016127ee565b935060408601359250606086013567ffffffffffffffff80821115612965578384fd5b818801915088601f830112612978578384fd5b81358181111561298a5761298a61385e565b604051601f8201601f19168101850183811182821017156129ad576129ad61385e565b60405281815283820185018b10156129c3578586fd5b81858501868301379081019093019390935250939692955090935050565b600080604083850312156129f3578182fd5b6129fc836127ee565b915060208301358015158114612a10578182fd5b809150509250929050565b60008060408385031215612a2d578182fd5b612a36836127ee565b946020939093013593505050565b60008060008060608587031215612a59578384fd5b612a62856127ee565b935060208501359250604085013567ffffffffffffffff811115612a84578283fd5b612a9087828801612805565b95989497509550505050565b600060208284031215612aad578081fd5b5035919050565b60008060408385031215612ac6578182fd5b823591506128d1602084016127ee565b600080600060408486031215612aea578283fd5b83359250602084013567ffffffffffffffff811115612b07578283fd5b612b138682870161284e565b9497909650939450505050565b600060208284031215612b31578081fd5b81356113c981613874565b600060208284031215612b4d578081fd5b81516113c981613874565b60008060208385031215612b6a578182fd5b823567ffffffffffffffff811115612b80578283fd5b612b8c8582860161284e565b90969095509350505050565b600080600060408486031215612bac578081fd5b83359250602084013567ffffffffffffffff811115612bc9578182fd5b612b1386828701612805565b60008151808452612bed816020860160208601613785565b601f01601f19169290920160200192915050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b918252602082015260400190565b60008351612c43818460208801613785565b835190830190612c57818360208801613785565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612c98816017850160208801613785565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612cc9816028840160208801613785565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d1c90830184612bd5565b9695505050505050565b901515815260200190565b90815260200190565b6000838252604060208301526116c76040830184612bd5565b60006020825282602083015282846040840137818301604090810191909152601f909201601f19160101919050565b6000602082526113c96020830184612bd5565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b60208082526016908201527514d95b99195c88185b1c9958591e4818db185a5b595960521b604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526024908201527f4e6f2048656467696573206c65667420746f206d696e742061742074686973206040820152633a34b2b960e11b606082015260800190565b60208082526037908201527f43616e6e6f74207072656d696e74206f6e6365206d6178207072656d696e742060408201527f737570706c7920686173206265656e2072656163686564000000000000000000606082015260800190565b6020808252602e908201527f43616e6e6f7420757064617465206f6e6365207468652073616c65206861732060408201526d1899595b88199a5b985b1a5e995960921b606082015260800190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526035908201527f43616e6e6f74206d696e7420746f6b656e207769746820746f6b656e49642067604082015274726561746572207468616e206d6178537570706c7960581b606082015260800190565b6020808252603c908201527f43616e6e6f74206d696e7420746f6b656e20666f72206469737472696275746960408201527f6f6e206265666f72652073616c652068617320636f6d706c6574656400000000606082015260800190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252601f908201527f54696572206d696e74696e67206973206e6f742079657420616c6c6f77656400604082015260600190565b602080825260159082015274125b9d985b1a59081d1a595c881c1c9bdd9a591959605a1b604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601d908201527f5374617274696e6720696e64657820697320616c726561647920736574000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526035908201527f43616e6e6f74206d696e7420746f6b656e207769746820746f6b656e4964206c604082015274746520746965722074776f206d6178537570706c7960581b606082015260800190565b6020808252818101527f5374617274696e6720696e64657820626c6f636b206d75737420626520736574604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526014908201527324b73b30b634b21026b2b935b63290383937b7b360611b604082015260600190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b60208082526038908201527f4e6f7420616c6c20486564676965732066726f6d20746865207265736572766560408201527f20737570706c792068617665206265656e206d696e7465640000000000000000606082015260800190565b6020808252603a908201527f4174207468652063757272656e742074696d657374616d7020737570706c792060408201527f69732063617070656420666f7220646973747269627574696e67000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b6000602082528251602083015260208301516040808401526116c76060840182612bd5565b815181526020918201519181019190915260400190565b6001600160f81b0391909116815260200190565b6000821982111561373657613736613832565b500190565b60008261374a5761374a613848565b500490565b600081600019048311821515161561376957613769613832565b500290565b60008282101561378057613780613832565b500390565b60005b838110156137a0578181015183820152602001613788565b838111156113475750506000910152565b6000816137c0576137c0613832565b506000190190565b6002810460018216806137dc57607f821691505b602082108114156137fd57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561381757613817613832565b5060010190565b60008261382d5761382d613848565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610e8257600080fdfea264697066735822122021da85f49cc321129910fe7167e2f2bd8c5f2b50ecdaf7f58d74417841ea6b4964736f6c63430008000033

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

0000000000000000000000000000000000000000000000000000000000000220956aa77e5564397136dda794eda1f94ef6b13885ef62e53adfb01476beed494e000000000000000000000000000000000000000000000000000000000000012d414a1d07fdcca8b4e38e6fa88cacbb7a5e90ca86c6e7c17e0b7d2ed2a6ed669200000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000061f94af00000000000000000000000000000000000000000000000000000000061fa9c700000000000000000000000000000000000000000000000000000000061fe90f00000000000000000000000000000000000000000000000000000000000000452000000000000000000000000000000000000000000000000000000000000098b000000000000000000000000000000000000000000000000000000000000098b0000000000000000000000000000000000000000000000000000000000001068000000000000000000000000058633dae2eb155f74f3010b81877a13a0a7d11b00000000000000000000000063eb2274670069456153d7d6f79b16f1803f28aa000000000000000000000000500dd93a74dbfa65a4eeda44da489adcef530cb900000000000000000000000000000000000000000000000000001990831b9711000000000000000000000000000000000000000000000000000000006202857000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000f4865646769657320627920645964580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000748454447494553000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020d248eb270db23ccc0d86c347fb15203384a7335533ff10c90bf3fa2bd2842c39

-----Decoded View---------------
Arg [0] : nameAndSymbol (string[2]): Hedgies by dYdX,HEDGIES
Arg [1] : provenanceHash (bytes32): 0x956aa77e5564397136dda794eda1f94ef6b13885ef62e53adfb01476beed494e
Arg [2] : reserveSupply (uint256): 301
Arg [3] : merkleRoot (bytes32): 0x414a1d07fdcca8b4e38e6fa88cacbb7a5e90ca86c6e7c17e0b7d2ed2a6ed6692
Arg [4] : ipfsCid (bytes): 0xd248eb270db23ccc0d86c347fb15203384a7335533ff10c90bf3fa2bd2842c39
Arg [5] : mintTierTimestamps (uint256[3]): 1643727600,1643814000,1644073200
Arg [6] : mintTierMaxSupplies (uint256[3]): 1106,2443,2443
Arg [7] : maxSupply (uint256): 4200
Arg [8] : roleOwners (address[3]): 0x058633dAE2Eb155f74f3010B81877A13A0A7D11B,0x63EB2274670069456153d7d6F79B16f1803F28AA,0x500dd93A74DbFA65A4Eeda44Da489adCeF530cb9
Arg [9] : mintToVariables (uint256[2]): 28108465608465,1644332400

-----Encoded View---------------
25 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [1] : 956aa77e5564397136dda794eda1f94ef6b13885ef62e53adfb01476beed494e
Arg [2] : 000000000000000000000000000000000000000000000000000000000000012d
Arg [3] : 414a1d07fdcca8b4e38e6fa88cacbb7a5e90ca86c6e7c17e0b7d2ed2a6ed6692
Arg [4] : 00000000000000000000000000000000000000000000000000000000000002e0
Arg [5] : 0000000000000000000000000000000000000000000000000000000061f94af0
Arg [6] : 0000000000000000000000000000000000000000000000000000000061fa9c70
Arg [7] : 0000000000000000000000000000000000000000000000000000000061fe90f0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000452
Arg [9] : 000000000000000000000000000000000000000000000000000000000000098b
Arg [10] : 000000000000000000000000000000000000000000000000000000000000098b
Arg [11] : 0000000000000000000000000000000000000000000000000000000000001068
Arg [12] : 000000000000000000000000058633dae2eb155f74f3010b81877a13a0a7d11b
Arg [13] : 00000000000000000000000063eb2274670069456153d7d6f79b16f1803f28aa
Arg [14] : 000000000000000000000000500dd93a74dbfa65a4eeda44da489adcef530cb9
Arg [15] : 00000000000000000000000000000000000000000000000000001990831b9711
Arg [16] : 0000000000000000000000000000000000000000000000000000000062028570
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [19] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [20] : 4865646769657320627920645964580000000000000000000000000000000000
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [22] : 4845444749455300000000000000000000000000000000000000000000000000
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [24] : d248eb270db23ccc0d86c347fb15203384a7335533ff10c90bf3fa2bd2842c39


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

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