ETH Price: $3,816.49 (+5.50%)

ERC-20: Ethernauts (NAUTS)

Overview

TokenID

114

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
Ethernauts

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : Ethernauts.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

contract Ethernauts is ERC721Enumerable, Ownable {
    using Address for address payable;
    using Strings for uint256;

    error MaxGiftableTokensTooLarge();
    error MaxTokensTooLarge();
    error CannotCallOnCurrentState();
    error NotEnoughETH();
    error NoTokensAvailable();
    error CouponAlreadyRedeemed();
    error InvalidCoupon();
    error NoGiftTokensAvailable();
    error BaseUriIsFrozen();
    error DoesNotChangeSaleState();
    error InvalidRecoveryAddress();
    error InsufficientERC20TokenBalance();
    error NotAuthorized();

    event SaleStateChanged(SaleState state);
    event BaseTokenURIChanged(string baseTokenURI);
    event EarlyMintPriceChanged(uint256 earlyMintPrice);
    event MintPriceChanged(uint256 mintPrice);
    event CouponSignerChanged(address couponSigner);
    event ETHWithdrawn(address beneficiary);
    event PermanentURISet(bool value);
    event UrlChangerChanged(address urlChanger);

    // Can be set only once on deploy
    uint256 public immutable maxTokens;
    uint256 public immutable maxGiftableTokens;
    uint256 public immutable batchSize;
    bytes32 public immutable provenanceHash;

    // Can be changed by owner
    string public baseTokenURI;
    uint256 public mintPrice;
    uint256 public earlyMintPrice;
    address public couponSigner;
    address public urlChanger;

    // Internal usage
    uint256 private _tokensGifted;
    mapping(address => bool) private _redeemedCoupons; // user address => if its single coupon has been redeemed
    uint256[] private _randomNumbers;
    bool public permanentURI;

    // Three different sale stages:
    enum SaleState {
        Paused, // No one can mint, except the owner via gifting (default)
        Early, // Only community can mint, at a discount using signed messages
        Open // Anyone can mint
    }

    SaleState public currentSaleState;

    constructor(
        uint256 definitiveMaxTokens,
        uint256 definitiveMaxGiftableTokens,
        uint256 definitiveBatchSize,
        bytes32 definitiveProvenanceHash,
        uint256 initialMintPrice,
        uint256 initialEarlyMintPrice,
        address initialCouponSigner,
        address initialUrlChanger
    ) ERC721("Ethernauts", "NAUTS") {
        if (definitiveMaxTokens > 10000) {
            revert MaxTokensTooLarge();
        }

        if (definitiveMaxGiftableTokens > 100) {
            revert MaxGiftableTokensTooLarge();
        }

        maxTokens = definitiveMaxTokens;
        maxGiftableTokens = definitiveMaxGiftableTokens;
        batchSize = definitiveBatchSize;
        provenanceHash = definitiveProvenanceHash;

        mintPrice = initialMintPrice;
        earlyMintPrice = initialEarlyMintPrice;
        couponSigner = initialCouponSigner;
        urlChanger = initialUrlChanger;

        currentSaleState = SaleState.Paused;
    }

    // ----------
    // Modifiers
    // ----------

    modifier onlyOnState(SaleState definedSaleState) {
        if (currentSaleState != definedSaleState) {
            revert CannotCallOnCurrentState();
        }

        _;
    }

    // --------------------
    // Public external ABI
    // --------------------

    /// @notice Mints a single token if at least mintPrice is sent and there are tokens available to mint.
    function mint() external payable onlyOnState(SaleState.Open) {
        if (msg.value < mintPrice) {
            revert NotEnoughETH();
        }

        if (availableToMint() == 0) {
            revert NoTokensAvailable();
        }

        _mintNext(msg.sender);
    }

    /// @notice Allows the sender to mint while in early sale state.
    /// @param signedCoupon Coupon given by couponSigner giving the sender early mint access.
    function mintEarly(bytes memory signedCoupon) external payable onlyOnState(SaleState.Early) {
        if (msg.value < earlyMintPrice) {
            revert NotEnoughETH();
        }

        if (availableToMint() == 0) {
            revert NoTokensAvailable();
        }

        if (userRedeemedCoupon(msg.sender)) {
            revert CouponAlreadyRedeemed();
        }

        if (!isCouponSignedForUser(msg.sender, signedCoupon)) {
            revert InvalidCoupon();
        }

        _redeemedCoupons[msg.sender] = true;

        _mintNext(msg.sender);
    }

    /// @notice The number of tokens gifted.
    /// @return The number of tokens gifted.
    function tokensGifted() external view returns (uint256) {
        return _tokensGifted;
    }

    /// @notice Total number of tokens available.
    /// @return The current number of available tokens (max - total current supply).
    function availableSupply() public view returns (uint256) {
        return maxTokens - totalSupply();
    }

    /// @notice Total number of tokens available for minting.
    /// @return The current number of mintable tokens (available supply - gifted supply).
    function availableToMint() public view returns (uint256) {
        return availableSupply() - availableToGift();
    }

    /// @notice Remaining giftable tokens.
    /// @return The amount of giftable tokens remaining (total giftable - already gifted).
    function availableToGift() public view returns (uint256) {
        return maxGiftableTokens - _tokensGifted;
    }

    /// @notice Checks if a token with tokenId exists.
    /// @param tokenId The Id being checked.
    /// @return true if token exists
    function exists(uint256 tokenId) external view returns (bool) {
        return _exists(tokenId);
    }

    /// @notice Checks if the supplied coupon is for the given user.
    /// @param user Address of user.
    /// @param coupon Coupon by couponSigner of the user's address.
    /// @return Returns true if the couponSigner signed for supplied user.
    function isCouponSignedForUser(address user, bytes memory coupon) public view returns (bool) {
        bytes32 messageHash = keccak256(abi.encode(user));
        bytes32 prefixedHash = ECDSA.toEthSignedMessageHash(messageHash);

        address retrievedSigner = ECDSA.recover(prefixedHash, coupon);

        return couponSigner == retrievedSigner;
    }

    /// @notice Checks to see if the user has redeemed a coupon.
    /// @param user Address of the user.
    /// @return True is the user has redeemed a coupon.
    function userRedeemedCoupon(address user) public view returns (bool) {
        return _redeemedCoupons[user];
    }

    /// @notice Returns the uri for a given token.
    /// @param tokenId Id of token
    /// @return URI of `tokenId` token
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        string memory baseURI = _baseURI();

        (uint256 assetId, bool assetAvailable) = getAssetIdForTokenId(tokenId);
        if (!assetAvailable) {
            return string(abi.encodePacked(baseURI, "travelling_to_destination"));
        }

        return string(abi.encodePacked(baseURI, assetId.toString()));
    }

    function getAssetIdForTokenId(uint256 tokenId) public view returns (uint256 assetId, bool assetAvailable) {
        uint256 batchNumber = getBatchForToken(tokenId);
        if (batchNumber >= _randomNumbers.length) {
            return (assetId = 0, assetAvailable = false);
        }

        uint256 randomNumber = _randomNumbers[batchNumber];
        uint256 offset = randomNumber % batchSize;
        uint256 maxTokenIdInBatch = getMaxTokenIdInBatch(batchNumber);

        assetId = tokenId + offset;
        if (assetId > maxTokenIdInBatch) {
            assetId -= batchSize;
        }

        return (assetId, assetAvailable = true);
    }

    function getMaxTokenIdInBatch(uint256 batchNumber) public view returns (uint256) {
        return batchSize * (batchNumber + 1) - 1;
    }

    function getBatchForToken(uint256 tokenId) public view returns (uint256) {
        return tokenId / batchSize;
    }

    /// @notice Fetch the random number for `batchNumber`
    /// @param batchNumber for the batch.
    /// @return Random number for batchNumber
    function getRandomNumberForBatch(uint256 batchNumber) public view returns (uint256) {
        return _randomNumbers[batchNumber];
    }

    /// @notice Get the number of random numbers
    /// @return Number of random numbers in `_randomNumbers`
    function getRandomNumberCount() public view returns (uint256) {
        return _randomNumbers.length;
    }

    /// @notice Checks if the ethernaut reached its destination.
    /// @param tokenId Id for the token.
    /// @return Returns true is the ethernaut arrived
    function isTokenRevealed(uint256 tokenId) public view returns (bool) {
        uint256 batchNumber = getBatchForToken(tokenId);
        if (batchNumber >= _randomNumbers.length) {
            return false;
        }

        return true;
    }

    // -----------------------
    // Protected external ABI
    // -----------------------

    /// @notice Gifts a token to the `to` address.
    /// @dev This can only be called by the contract owner.
    /// @param to The address the token is being gifted to.
    function gift(address to) external onlyOwner {
        if (_tokensGifted >= maxGiftableTokens) {
            revert NoGiftTokensAvailable();
        }

        _tokensGifted += 1;

        _mintNext(to);
    }

    /// @notice Sets the new mint price for a token.
    /// @dev This can only be called by the contract owner.
    /// @param newMintPrice The new price a token can be bought for.
    function setMintPrice(uint256 newMintPrice) external onlyOwner {
        mintPrice = newMintPrice;

        emit MintPriceChanged(newMintPrice);
    }

    /// @notice Sets the new early mint price for a token.
    /// @dev This can only be called by the contract owner.
    /// @param newEarlyMintPrice The new early price a token can be bought for.
    function setEarlyMintPrice(uint256 newEarlyMintPrice) external onlyOwner {
        earlyMintPrice = newEarlyMintPrice;

        emit EarlyMintPriceChanged(newEarlyMintPrice);
    }

    /// @notice Sets the base URI for all token URIs.
    /// @dev This can only be called by the contract owner. Can only be called if if the permanentURI hasn't been set yet.
    /// @param newBaseTokenURI The new base URI for tokens.
    function setBaseURI(string calldata newBaseTokenURI) external {
        if (msg.sender != owner() && msg.sender != urlChanger) {
            revert NotAuthorized();
        }

        if (permanentURI) {
            revert BaseUriIsFrozen();
        }

        baseTokenURI = newBaseTokenURI;

        emit BaseTokenURIChanged(newBaseTokenURI);
    }

    /// @notice Set the sale state for tokens.
    /// @dev This can only be called by the contract owner.
    /// @param newSaleState The new sale state of the tokens.
    function setSaleState(SaleState newSaleState) external onlyOwner {
        if (newSaleState == currentSaleState) {
            revert DoesNotChangeSaleState();
        }

        currentSaleState = newSaleState;

        emit SaleStateChanged(newSaleState);
    }

    /// @notice Set the address that can issue coupons.
    /// @dev This can only be called by the contract owner.
    /// @param newCouponSigner New address that can issue coupons.
    function setCouponSigner(address newCouponSigner) external onlyOwner {
        couponSigner = newCouponSigner;

        emit CouponSignerChanged(newCouponSigner);
    }

    /// @notice Freeze the URI so that it cant be updated anymore.
    /// @dev This can only be called by the contract owner.
    function setPermanentURI() external onlyOwner {
        permanentURI = true;

        emit PermanentURISet(true);
    }

    /// @notice Sets address of `urlChanger`
    /// @dev This can only be called by the contract owner.
    /// @param newUrlChanger New address that can change the URI
    function setUrlChanger(address newUrlChanger) external onlyOwner {
        urlChanger = newUrlChanger;

        emit UrlChangerChanged(newUrlChanger);
    }

    /// @notice Withdraws all eth currently held by the contract.
    /// @dev This can only be called by the contract owner. sendValue used to avoid 2300 gas issuance complications.
    /// @param beneficiary The address that funds will be withdrawn to.
    function withdraw(address payable beneficiary) external onlyOwner {
        beneficiary.sendValue(address(this).balance);

        emit ETHWithdrawn(beneficiary);
    }

    /// @notice Withdraw `value` tokens held by this contract.
    /// @dev This can only be called by the contract owner.
    /// @param token Contract address of erc20 token.
    /// @param to Address tokens are being sent to.
    /// @param value The amount of tokens being withdrawn.
    function recoverTokens(
        address token,
        address to,
        uint256 value
    ) external onlyOwner {
        if (token == to) {
            revert InvalidRecoveryAddress();
        }

        if (IERC20(token).balanceOf(address(this)) < value) {
            revert InsufficientERC20TokenBalance();
        }

        IERC20(token).transfer(to, value);
    }

    /// @notice Manually generate a random number for a token batch in the case that
    /// minting is delayed or stagnates. Calling this should be avoided if possible
    /// because it increases trust on the owner.
    /// @dev This can only be called by the contract owner.
    function generateRandomNumber() external onlyOwner {
        _generateRandomNumber();
    }

    // -------------------
    // Private functions
    // -------------------

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

    function _mintNext(address to) private {
        uint256 tokenId = totalSupply();

        _generateRandomNumberIfNeeded(tokenId);

        _mint(to, tokenId);
    }

    function _generateRandomNumberIfNeeded(uint256 lastTokenId) private {
        uint256 currentBatchNumber = getBatchForToken(lastTokenId);
        if (_randomNumbers.length > currentBatchNumber) {
            return;
        }

        uint256 maxTokenIdInBatch = getMaxTokenIdInBatch(currentBatchNumber);
        if (maxTokenIdInBatch > lastTokenId) {
            return;
        }

        _generateRandomNumber();
    }

    function _generateRandomNumber() private {
        uint256 randomNumber = uint256(
            keccak256(abi.encodePacked(msg.sender, block.difficulty, block.timestamp, _randomNumbers.length))
        );

        _randomNumbers.push(randomNumber);
    }
}

File 2 of 15 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 3 of 15 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 4 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 5 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 6 of 15 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 7 of 15 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

File 8 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 9 of 15 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

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

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

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

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

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

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

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

    /**
     * @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 10 of 15 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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);
}

File 11 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 12 of 15 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 13 of 15 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 15 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"definitiveMaxTokens","type":"uint256"},{"internalType":"uint256","name":"definitiveMaxGiftableTokens","type":"uint256"},{"internalType":"uint256","name":"definitiveBatchSize","type":"uint256"},{"internalType":"bytes32","name":"definitiveProvenanceHash","type":"bytes32"},{"internalType":"uint256","name":"initialMintPrice","type":"uint256"},{"internalType":"uint256","name":"initialEarlyMintPrice","type":"uint256"},{"internalType":"address","name":"initialCouponSigner","type":"address"},{"internalType":"address","name":"initialUrlChanger","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BaseUriIsFrozen","type":"error"},{"inputs":[],"name":"CannotCallOnCurrentState","type":"error"},{"inputs":[],"name":"CouponAlreadyRedeemed","type":"error"},{"inputs":[],"name":"DoesNotChangeSaleState","type":"error"},{"inputs":[],"name":"InsufficientERC20TokenBalance","type":"error"},{"inputs":[],"name":"InvalidCoupon","type":"error"},{"inputs":[],"name":"InvalidRecoveryAddress","type":"error"},{"inputs":[],"name":"MaxGiftableTokensTooLarge","type":"error"},{"inputs":[],"name":"MaxTokensTooLarge","type":"error"},{"inputs":[],"name":"NoGiftTokensAvailable","type":"error"},{"inputs":[],"name":"NoTokensAvailable","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotEnoughETH","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"BaseTokenURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"couponSigner","type":"address"}],"name":"CouponSignerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"}],"name":"ETHWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"earlyMintPrice","type":"uint256"}],"name":"EarlyMintPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mintPrice","type":"uint256"}],"name":"MintPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"PermanentURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Ethernauts.SaleState","name":"state","type":"uint8"}],"name":"SaleStateChanged","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":"urlChanger","type":"address"}],"name":"UrlChangerChanged","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableToGift","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"batchSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"couponSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentSaleState","outputs":[{"internalType":"enum Ethernauts.SaleState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"earlyMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"generateRandomNumber","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":"tokenId","type":"uint256"}],"name":"getAssetIdForTokenId","outputs":[{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"bool","name":"assetAvailable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getBatchForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"batchNumber","type":"uint256"}],"name":"getMaxTokenIdInBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRandomNumberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"batchNumber","type":"uint256"}],"name":"getRandomNumberForBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"gift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bytes","name":"coupon","type":"bytes"}],"name":"isCouponSignedForUser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxGiftableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signedCoupon","type":"bytes"}],"name":"mintEarly","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permanentURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"newBaseTokenURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newCouponSigner","type":"address"}],"name":"setCouponSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEarlyMintPrice","type":"uint256"}],"name":"setEarlyMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPermanentURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Ethernauts.SaleState","name":"newSaleState","type":"uint8"}],"name":"setSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newUrlChanger","type":"address"}],"name":"setUrlChanger","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":"tokensGifted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"urlChanger","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userRedeemedCoupon","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b50604051620037c3380380620037c3833981016040819052620000359162000272565b604080518082018252600a81526945746865726e6175747360b01b6020808301918252835180850190945260058452644e4155545360d81b9084015281519192916200008491600091620001af565b5080516200009a906001906020840190620001af565b505050620000b7620000b16200015960201b60201c565b6200015d565b612710881115620000db576040516317859c7160e31b815260040160405180910390fd5b6064871115620000fe5760405163196da17d60e21b815260040160405180910390fd5b60809790975260a09590955260c09390935260e091909152600c55600d55600e80546001600160a01b039283166001600160a01b031991821617909155600f80549290931691161790556013805461ff001916905562000321565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001bd90620002e4565b90600052602060002090601f016020900481019282620001e157600085556200022c565b82601f10620001fc57805160ff19168380011785556200022c565b828001600101855582156200022c579182015b828111156200022c5782518255916020019190600101906200020f565b506200023a9291506200023e565b5090565b5b808211156200023a57600081556001016200023f565b80516001600160a01b03811681146200026d57600080fd5b919050565b600080600080600080600080610100898b0312156200029057600080fd5b885197506020890151965060408901519550606089015194506080890151935060a08901519250620002c560c08a0162000255565b9150620002d560e08a0162000255565b90509295985092959890939650565b600181811c90821680620002f957607f821691505b602082108114156200031b57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e0516134376200038c60003960006108e5015260008181610a6101528181610f3e01528181611866015281816118b30152611c15015260008181610770015281816116d501526119af01526000818161096e01526116aa01526134376000f3fe60806040526004361061036a5760003560e01c8063715018a6116101c6578063afaea615116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610a0f578063f4a0a52814610a2f578063f4daaba114610a4f578063fdb2022214610a8357600080fd5b8063e985e9c514610990578063f08e414d146109d9578063f1c30d3a146109f957600080fd5b8063c87b56dd116100d1578063c87b56dd14610907578063cbfc4bce14610927578063d547cfb714610947578063e83157421461095c57600080fd5b8063afaea6151461087e578063b88d4fde146108b3578063c6ab67a3146108d357600080fd5b80638da5cb5b1161016457806395d89b411161013e57806395d89b41146108095780639b1a51731461081e578063a22cb4651461083e578063a69956eb1461085e57600080fd5b80638da5cb5b14610792578063911f5843146107b057806394023324146107d057600080fd5b80637ecc2b56116101a05780637ecc2b561461071f57806381b34aaf146107345780638adf990f146107495780638cb7719b1461075e57600080fd5b8063715018a6146106e057806374601c3c146106f5578063773a11541461070a57600080fd5b8063338850fb116102a057806355f804b31161023e5780636352211e116102185780636352211e1461067757806363eb90ba146106975780636817c76c146106aa57806370a08231146106c057600080fd5b806355f804b3146106175780635a67de07146106375780635f3e849f1461065757600080fd5b80634618a4501161027a5780634618a450146105a25780634f558e79146105b75780634f6ccce7146105d757806351cff8d9146105f757600080fd5b8063338850fb146105365780633a698b621461055657806342842e0e1461058257600080fd5b80631ea111791161030d5780632f745c59116102e75780632f745c59146104bc57806331b54a15146104dc5780633267b39b146104f6578063337ea9ad1461051657600080fd5b80631ea111791461045c5780631ff9342b1461047c57806323b872dd1461049c57600080fd5b8063081812fc11610349578063081812fc146103e5578063095ea7b31461041d5780631249c58b1461043f57806318160ddd1461044757600080fd5b80621c0b7d1461036f57806301ffc9a71461039357806306fdde03146103c3575b600080fd5b34801561037b57600080fd5b506012545b6040519081526020015b60405180910390f35b34801561039f57600080fd5b506103b36103ae366004612cb5565b610aa3565b604051901515815260200161038a565b3480156103cf57600080fd5b506103d8610ace565b60405161038a9190612d31565b3480156103f157600080fd5b50610405610400366004612d44565b610b60565b6040516001600160a01b03909116815260200161038a565b34801561042957600080fd5b5061043d610438366004612d72565b610bfa565b005b61043d610d10565b34801561045357600080fd5b50600854610380565b34801561046857600080fd5b50600e54610405906001600160a01b031681565b34801561048857600080fd5b506103b3610497366004612e41565b610da1565b3480156104a857600080fd5b5061043d6104b7366004612e91565b610e3c565b3480156104c857600080fd5b506103806104d7366004612d72565b610e6d565b3480156104e857600080fd5b506013546103b39060ff1681565b34801561050257600080fd5b50610380610511366004612d44565b610f03565b34801561052257600080fd5b50600f54610405906001600160a01b031681565b34801561054257600080fd5b50610380610551366004612d44565b610f2a565b34801561056257600080fd5b5060135461057590610100900460ff1681565b60405161038a9190612ee8565b34801561058e57600080fd5b5061043d61059d366004612e91565b610f6c565b3480156105ae57600080fd5b5061043d610f87565b3480156105c357600080fd5b506103b36105d2366004612d44565b610ff6565b3480156105e357600080fd5b506103806105f2366004612d44565b611015565b34801561060357600080fd5b5061043d610612366004612f10565b611096565b34801561062357600080fd5b5061043d610632366004612f2d565b611113565b34801561064357600080fd5b5061043d610652366004612f9f565b6111c5565b34801561066357600080fd5b5061043d610672366004612e91565b611291565b34801561068357600080fd5b50610405610692366004612d44565b61140e565b61043d6106a5366004612fc0565b611485565b3480156106b657600080fd5b50610380600c5481565b3480156106cc57600080fd5b506103806106db366004612f10565b611589565b3480156106ec57600080fd5b5061043d611610565b34801561070157600080fd5b50610380611646565b34801561071657600080fd5b5061043d611667565b34801561072b57600080fd5b50610380611699565b34801561074057600080fd5b50601054610380565b34801561075557600080fd5b506103806116ce565b34801561076a57600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561079e57600080fd5b50600a546001600160a01b0316610405565b3480156107bc57600080fd5b5061043d6107cb366004612d44565b6116fe565b3480156107dc57600080fd5b506103b36107eb366004612f10565b6001600160a01b031660009081526011602052604090205460ff1690565b34801561081557600080fd5b506103d861175d565b34801561082a57600080fd5b5061043d610839366004612f10565b61176c565b34801561084a57600080fd5b5061043d610859366004613003565b6117e4565b34801561086a57600080fd5b506103b3610879366004612d44565b6117ef565b34801561088a57600080fd5b5061089e610899366004612d44565b611819565b6040805192835290151560208301520161038a565b3480156108bf57600080fd5b5061043d6108ce36600461303c565b6118e9565b3480156108df57600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561091357600080fd5b506103d8610922366004612d44565b61191b565b34801561093357600080fd5b5061043d610942366004612f10565b611983565b34801561095357600080fd5b506103d8611a11565b34801561096857600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561099c57600080fd5b506103b36109ab3660046130a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156109e557600080fd5b5061043d6109f4366004612f10565b611a9f565b348015610a0557600080fd5b50610380600d5481565b348015610a1b57600080fd5b5061043d610a2a366004612f10565b611b17565b348015610a3b57600080fd5b5061043d610a4a366004612d44565b611baf565b348015610a5b57600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b348015610a8f57600080fd5b50610380610a9e366004612d44565b611c0e565b60006001600160e01b0319821663780e9d6360e01b1480610ac85750610ac882611c3a565b92915050565b606060008054610add906130d6565b80601f0160208091040260200160405190810160405280929190818152602001828054610b09906130d6565b8015610b565780601f10610b2b57610100808354040283529160200191610b56565b820191906000526020600020905b815481529060010190602001808311610b3957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610bde5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610c058261140e565b9050806001600160a01b0316836001600160a01b03161415610c735760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610bd5565b336001600160a01b0382161480610c8f5750610c8f81336109ab565b610d015760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610bd5565b610d0b8383611c8a565b505050565b600280601354610100900460ff166002811115610d2f57610d2f612ed2565b14610d4d57604051630d6e554d60e11b815260040160405180910390fd5b600c54341015610d7057604051632c1d501360e11b815260040160405180910390fd5b610d78611646565b610d9557604051630626e30760e51b815260040160405180910390fd5b610d9e33611cf8565b50565b604080516001600160a01b03841660208083019190915282518083038201815282840184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006060840152607c80840182905284518085039091018152609c9093019093528151910120600091906000610e218286611d18565b600e546001600160a01b039182169116149695505050505050565b610e463382611d3c565b610e625760405162461bcd60e51b8152600401610bd590613111565b610d0b838383611e33565b6000610e7883611589565b8210610eda5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610bd5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600060128281548110610f1857610f18613162565b90600052602060002001549050919050565b60006001610f38838261318e565b610f62907f00000000000000000000000000000000000000000000000000000000000000006131a6565b610ac891906131c5565b610d0b838383604051806020016040528060008152506118e9565b600a546001600160a01b03163314610fb15760405162461bcd60e51b8152600401610bd5906131dc565b6013805460ff191660019081179091556040519081527fbb28b9fdb73d6fdb17e5242ec72ff13d3df29ac88f6143cc790fd3dcff6dffbe9060200160405180910390a1565b6000818152600260205260408120546001600160a01b03161515610ac8565b600061102060085490565b82106110835760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610bd5565b60088281548110610f1857610f18613162565b600a546001600160a01b031633146110c05760405162461bcd60e51b8152600401610bd5906131dc565b6110d36001600160a01b03821647611fde565b6040516001600160a01b03821681527f40ec257c70276a2df63ff5b3541d26c328e597d6d63bbddb5bf286ed2cd9104b906020015b60405180910390a150565b600a546001600160a01b031633148015906111395750600f546001600160a01b03163314155b156111575760405163ea8e4eb560e01b815260040160405180910390fd5b60135460ff161561117b5760405163cb72e14960e01b815260040160405180910390fd5b611187600b8383612c06565b507f228a3ac0675af69daeaaa5b8d369fe2faae665e7f340f0b78ccbb84e17b4f69482826040516111b9929190613211565b60405180910390a15050565b600a546001600160a01b031633146111ef5760405162461bcd60e51b8152600401610bd5906131dc565b601354610100900460ff16600281111561120b5761120b612ed2565b81600281111561121d5761121d612ed2565b141561123c57604051632e541fbd60e01b815260040160405180910390fd5b6013805482919061ff00191661010083600281111561125d5761125d612ed2565b02179055507f92a17b827ee9d42ea9454bb4ca941a1800870e6d01c0842d09ba23ccc0190ee1816040516111089190612ee8565b600a546001600160a01b031633146112bb5760405162461bcd60e51b8152600401610bd5906131dc565b816001600160a01b0316836001600160a01b031614156112ee5760405163530a10d160e11b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906001600160a01b038516906370a082319060240160206040518083038186803b15801561132f57600080fd5b505afa158015611343573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113679190613240565b101561138657604051631ea5376960e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114089190613259565b50505050565b6000818152600260205260408120546001600160a01b031680610ac85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610bd5565b600180601354610100900460ff1660028111156114a4576114a4612ed2565b146114c257604051630d6e554d60e11b815260040160405180910390fd5b600d543410156114e557604051632c1d501360e11b815260040160405180910390fd5b6114ed611646565b61150a57604051630626e30760e51b815260040160405180910390fd5b3360009081526011602052604090205460ff161561153b57604051637a5fbba360e01b815260040160405180910390fd5b6115453383610da1565b6115625760405163c73e16c160e01b815260040160405180910390fd5b336000818152601160205260409020805460ff1916600117905561158590611cf8565b5050565b60006001600160a01b0382166115f45760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610bd5565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b0316331461163a5760405162461bcd60e51b8152600401610bd5906131dc565b61164460006120f7565b565b60006116506116ce565b611658611699565b61166291906131c5565b905090565b600a546001600160a01b031633146116915760405162461bcd60e51b8152600401610bd5906131dc565b611644612149565b60006116a460085490565b611662907f00000000000000000000000000000000000000000000000000000000000000006131c5565b60006010547f000000000000000000000000000000000000000000000000000000000000000061166291906131c5565b600a546001600160a01b031633146117285760405162461bcd60e51b8152600401610bd5906131dc565b600d8190556040518181527ff24bd70115849c72fefc18b93d5ab835e248d43f5b66df3f24bdd7af5b8df67990602001611108565b606060018054610add906130d6565b600a546001600160a01b031633146117965760405162461bcd60e51b8152600401610bd5906131dc565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527fea9ac1e7ccb5a7f8d1d5b138218914611771f13e4bfe7635e33530d3c852433390602001611108565b6115853383836121cf565b6000806117fb83611c0e565b60125490915081106118105750600092915050565b50600192915050565b600080600061182784611c0e565b601254909150811061183f5750600093849350915050565b60006012828154811061185457611854613162565b6000918252602082200154915061188b7f00000000000000000000000000000000000000000000000000000000000000008361328c565b9050600061189884610f2a565b90506118a4828861318e565b9550808611156118db576118d87f0000000000000000000000000000000000000000000000000000000000000000876131c5565b95505b509395600195509350505050565b6118f33383611d3c565b61190f5760405162461bcd60e51b8152600401610bd590613111565b6114088484848461229e565b606060006119276122d1565b905060008061193585611819565b9150915080611968578260405160200161194f91906132a0565b6040516020818303038152906040529350505050919050565b82611972836122e0565b60405160200161194f9291906132e1565b600a546001600160a01b031633146119ad5760405162461bcd60e51b8152600401610bd5906131dc565b7f0000000000000000000000000000000000000000000000000000000000000000601054106119ef5760405163e54bf68360e01b815260040160405180910390fd5b600160106000828254611a02919061318e565b90915550610d9e905081611cf8565b600b8054611a1e906130d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4a906130d6565b8015611a975780601f10611a6c57610100808354040283529160200191611a97565b820191906000526020600020905b815481529060010190602001808311611a7a57829003601f168201915b505050505081565b600a546001600160a01b03163314611ac95760405162461bcd60e51b8152600401610bd5906131dc565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f7534626758889efe1509a1a3d7410b69c15c368d2cf1a9ed19b4a058baa97a4790602001611108565b600a546001600160a01b03163314611b415760405162461bcd60e51b8152600401610bd5906131dc565b6001600160a01b038116611ba65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bd5565b610d9e816120f7565b600a546001600160a01b03163314611bd95760405162461bcd60e51b8152600401610bd5906131dc565b600c8190556040518181527f25b1f9f6b6e61dfca5575239769e4450ed2e49176670837f5d1a82a9a2fc693f90602001611108565b6000610ac87f000000000000000000000000000000000000000000000000000000000000000083613310565b60006001600160e01b031982166380ac58cd60e01b1480611c6b57506001600160e01b03198216635b5e139f60e01b145b80610ac857506301ffc9a760e01b6001600160e01b0319831614610ac8565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611cbf8261140e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611d0360085490565b9050611d0e816123de565b611585828261241c565b6000806000611d27858561256a565b91509150611d34816125da565b509392505050565b6000818152600260205260408120546001600160a01b0316611db55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610bd5565b6000611dc08361140e565b9050806001600160a01b0316846001600160a01b03161480611dfb5750836001600160a01b0316611df084610b60565b6001600160a01b0316145b80611e2b57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611e468261140e565b6001600160a01b031614611eae5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610bd5565b6001600160a01b038216611f105760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610bd5565b611f1b838383612795565b611f26600082611c8a565b6001600160a01b0383166000908152600360205260408120805460019290611f4f9084906131c5565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f7d90849061318e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b8047101561202e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610bd5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461207b576040519150601f19603f3d011682016040523d82523d6000602084013e612080565b606091505b5050905080610d0b5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610bd5565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6012546040516bffffffffffffffffffffffff193360601b166020820152446034820152426054820152607481019190915260009060940160408051601f198184030181529190528051602090910120601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444015550565b816001600160a01b0316836001600160a01b031614156122315760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610bd5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6122a9848484611e33565b6122b58484848461284d565b6114085760405162461bcd60e51b8152600401610bd590613324565b6060600b8054610add906130d6565b6060816123045750506040805180820190915260018152600360fc1b602082015290565b8160005b811561232e578061231881613376565b91506123279050600a83613310565b9150612308565b60008167ffffffffffffffff81111561234957612349612d9e565b6040519080825280601f01601f191660200182016040528015612373576020820181803683370190505b5090505b8415611e2b576123886001836131c5565b9150612395600a8661328c565b6123a090603061318e565b60f81b8183815181106123b5576123b5613162565b60200101906001600160f81b031916908160001a9053506123d7600a86613310565b9450612377565b60006123e982611c0e565b6012549091508110156123fa575050565b600061240582610f2a565b90508281111561241457505050565b610d0b612149565b6001600160a01b0382166124725760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bd5565b6000818152600260205260409020546001600160a01b0316156124d75760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610bd5565b6124e360008383612795565b6001600160a01b038216600090815260036020526040812080546001929061250c90849061318e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000808251604114156125a15760208301516040840151606085015160001a6125958782858561295a565b945094505050506125d3565b8251604014156125cb57602083015160408401516125c0868383612a47565b9350935050506125d3565b506000905060025b9250929050565b60008160048111156125ee576125ee612ed2565b14156125f75750565b600181600481111561260b5761260b612ed2565b14156126595760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610bd5565b600281600481111561266d5761266d612ed2565b14156126bb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610bd5565b60038160048111156126cf576126cf612ed2565b14156127285760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610bd5565b600481600481111561273c5761273c612ed2565b1415610d9e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610bd5565b6001600160a01b0383166127f0576127eb81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612813565b816001600160a01b0316836001600160a01b031614612813576128138382612a76565b6001600160a01b03821661282a57610d0b81612b13565b826001600160a01b0316826001600160a01b031614610d0b57610d0b8282612bc2565b60006001600160a01b0384163b1561294f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612891903390899088908890600401613391565b602060405180830381600087803b1580156128ab57600080fd5b505af19250505080156128db575060408051601f3d908101601f191682019092526128d8918101906133ce565b60015b612935573d808015612909576040519150601f19603f3d011682016040523d82523d6000602084013e61290e565b606091505b50805161292d5760405162461bcd60e51b8152600401610bd590613324565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e2b565b506001949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156129915750600090506003612a3e565b8460ff16601b141580156129a957508460ff16601c14155b156129ba5750600090506004612a3e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612a0e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612a3757600060019250925050612a3e565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612a688782888561295a565b935093505050935093915050565b60006001612a8384611589565b612a8d91906131c5565b600083815260076020526040902054909150808214612ae0576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612b25906001906131c5565b60008381526009602052604081205460088054939450909284908110612b4d57612b4d613162565b906000526020600020015490508060088381548110612b6e57612b6e613162565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ba657612ba66133eb565b6001900381819060005260206000200160009055905550505050565b6000612bcd83611589565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b828054612c12906130d6565b90600052602060002090601f016020900481019282612c345760008555612c7a565b82601f10612c4d5782800160ff19823516178555612c7a565b82800160010185558215612c7a579182015b82811115612c7a578235825591602001919060010190612c5f565b50612c86929150612c8a565b5090565b5b80821115612c865760008155600101612c8b565b6001600160e01b031981168114610d9e57600080fd5b600060208284031215612cc757600080fd5b8135612cd281612c9f565b9392505050565b60005b83811015612cf4578181015183820152602001612cdc565b838111156114085750506000910152565b60008151808452612d1d816020860160208601612cd9565b601f01601f19169290920160200192915050565b602081526000612cd26020830184612d05565b600060208284031215612d5657600080fd5b5035919050565b6001600160a01b0381168114610d9e57600080fd5b60008060408385031215612d8557600080fd5b8235612d9081612d5d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612dc557600080fd5b813567ffffffffffffffff80821115612de057612de0612d9e565b604051601f8301601f19908116603f01168101908282118183101715612e0857612e08612d9e565b81604052838152866020858801011115612e2157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612e5457600080fd5b8235612e5f81612d5d565b9150602083013567ffffffffffffffff811115612e7b57600080fd5b612e8785828601612db4565b9150509250929050565b600080600060608486031215612ea657600080fd5b8335612eb181612d5d565b92506020840135612ec181612d5d565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612f0a57634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215612f2257600080fd5b8135612cd281612d5d565b60008060208385031215612f4057600080fd5b823567ffffffffffffffff80821115612f5857600080fd5b818501915085601f830112612f6c57600080fd5b813581811115612f7b57600080fd5b866020828501011115612f8d57600080fd5b60209290920196919550909350505050565b600060208284031215612fb157600080fd5b813560038110612cd257600080fd5b600060208284031215612fd257600080fd5b813567ffffffffffffffff811115612fe957600080fd5b611e2b84828501612db4565b8015158114610d9e57600080fd5b6000806040838503121561301657600080fd5b823561302181612d5d565b9150602083013561303181612ff5565b809150509250929050565b6000806000806080858703121561305257600080fd5b843561305d81612d5d565b9350602085013561306d81612d5d565b925060408501359150606085013567ffffffffffffffff81111561309057600080fd5b61309c87828801612db4565b91505092959194509250565b600080604083850312156130bb57600080fd5b82356130c681612d5d565b9150602083013561303181612d5d565b600181811c908216806130ea57607f821691505b6020821081141561310b57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156131a1576131a1613178565b500190565b60008160001904831182151516156131c0576131c0613178565b500290565b6000828210156131d7576131d7613178565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561325257600080fd5b5051919050565b60006020828403121561326b57600080fd5b8151612cd281612ff5565b634e487b7160e01b600052601260045260246000fd5b60008261329b5761329b613276565b500690565b600082516132b2818460208701612cd9565b7f74726176656c6c696e675f746f5f64657374696e6174696f6e00000000000000920191825250601901919050565b600083516132f3818460208801612cd9565b835190830190613307818360208801612cd9565b01949350505050565b60008261331f5761331f613276565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060001982141561338a5761338a613178565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133c490830184612d05565b9695505050505050565b6000602082840312156133e057600080fd5b8151612cd281612c9f565b634e487b7160e01b600052603160045260246000fdfea264697066735822122008802f8dd7c3a1ae4e400e4bc16e6d33f4c97ed85945edd847461b3f12533f4164736f6c6343000809003300000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000f04a636d10f42ec5a9d4885d30834a7000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000000354a6ba7a180000000000000000000000000008818b7d491ae4f69181fc62c28a67dde133b4232000000000000000000000000a4403c8388634b9b01b70763e2c5c44fec138250

Deployed Bytecode

0x60806040526004361061036a5760003560e01c8063715018a6116101c6578063afaea615116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610a0f578063f4a0a52814610a2f578063f4daaba114610a4f578063fdb2022214610a8357600080fd5b8063e985e9c514610990578063f08e414d146109d9578063f1c30d3a146109f957600080fd5b8063c87b56dd116100d1578063c87b56dd14610907578063cbfc4bce14610927578063d547cfb714610947578063e83157421461095c57600080fd5b8063afaea6151461087e578063b88d4fde146108b3578063c6ab67a3146108d357600080fd5b80638da5cb5b1161016457806395d89b411161013e57806395d89b41146108095780639b1a51731461081e578063a22cb4651461083e578063a69956eb1461085e57600080fd5b80638da5cb5b14610792578063911f5843146107b057806394023324146107d057600080fd5b80637ecc2b56116101a05780637ecc2b561461071f57806381b34aaf146107345780638adf990f146107495780638cb7719b1461075e57600080fd5b8063715018a6146106e057806374601c3c146106f5578063773a11541461070a57600080fd5b8063338850fb116102a057806355f804b31161023e5780636352211e116102185780636352211e1461067757806363eb90ba146106975780636817c76c146106aa57806370a08231146106c057600080fd5b806355f804b3146106175780635a67de07146106375780635f3e849f1461065757600080fd5b80634618a4501161027a5780634618a450146105a25780634f558e79146105b75780634f6ccce7146105d757806351cff8d9146105f757600080fd5b8063338850fb146105365780633a698b621461055657806342842e0e1461058257600080fd5b80631ea111791161030d5780632f745c59116102e75780632f745c59146104bc57806331b54a15146104dc5780633267b39b146104f6578063337ea9ad1461051657600080fd5b80631ea111791461045c5780631ff9342b1461047c57806323b872dd1461049c57600080fd5b8063081812fc11610349578063081812fc146103e5578063095ea7b31461041d5780631249c58b1461043f57806318160ddd1461044757600080fd5b80621c0b7d1461036f57806301ffc9a71461039357806306fdde03146103c3575b600080fd5b34801561037b57600080fd5b506012545b6040519081526020015b60405180910390f35b34801561039f57600080fd5b506103b36103ae366004612cb5565b610aa3565b604051901515815260200161038a565b3480156103cf57600080fd5b506103d8610ace565b60405161038a9190612d31565b3480156103f157600080fd5b50610405610400366004612d44565b610b60565b6040516001600160a01b03909116815260200161038a565b34801561042957600080fd5b5061043d610438366004612d72565b610bfa565b005b61043d610d10565b34801561045357600080fd5b50600854610380565b34801561046857600080fd5b50600e54610405906001600160a01b031681565b34801561048857600080fd5b506103b3610497366004612e41565b610da1565b3480156104a857600080fd5b5061043d6104b7366004612e91565b610e3c565b3480156104c857600080fd5b506103806104d7366004612d72565b610e6d565b3480156104e857600080fd5b506013546103b39060ff1681565b34801561050257600080fd5b50610380610511366004612d44565b610f03565b34801561052257600080fd5b50600f54610405906001600160a01b031681565b34801561054257600080fd5b50610380610551366004612d44565b610f2a565b34801561056257600080fd5b5060135461057590610100900460ff1681565b60405161038a9190612ee8565b34801561058e57600080fd5b5061043d61059d366004612e91565b610f6c565b3480156105ae57600080fd5b5061043d610f87565b3480156105c357600080fd5b506103b36105d2366004612d44565b610ff6565b3480156105e357600080fd5b506103806105f2366004612d44565b611015565b34801561060357600080fd5b5061043d610612366004612f10565b611096565b34801561062357600080fd5b5061043d610632366004612f2d565b611113565b34801561064357600080fd5b5061043d610652366004612f9f565b6111c5565b34801561066357600080fd5b5061043d610672366004612e91565b611291565b34801561068357600080fd5b50610405610692366004612d44565b61140e565b61043d6106a5366004612fc0565b611485565b3480156106b657600080fd5b50610380600c5481565b3480156106cc57600080fd5b506103806106db366004612f10565b611589565b3480156106ec57600080fd5b5061043d611610565b34801561070157600080fd5b50610380611646565b34801561071657600080fd5b5061043d611667565b34801561072b57600080fd5b50610380611699565b34801561074057600080fd5b50601054610380565b34801561075557600080fd5b506103806116ce565b34801561076a57600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000006481565b34801561079e57600080fd5b50600a546001600160a01b0316610405565b3480156107bc57600080fd5b5061043d6107cb366004612d44565b6116fe565b3480156107dc57600080fd5b506103b36107eb366004612f10565b6001600160a01b031660009081526011602052604090205460ff1690565b34801561081557600080fd5b506103d861175d565b34801561082a57600080fd5b5061043d610839366004612f10565b61176c565b34801561084a57600080fd5b5061043d610859366004613003565b6117e4565b34801561086a57600080fd5b506103b3610879366004612d44565b6117ef565b34801561088a57600080fd5b5061089e610899366004612d44565b611819565b6040805192835290151560208301520161038a565b3480156108bf57600080fd5b5061043d6108ce36600461303c565b6118e9565b3480156108df57600080fd5b506103807f00000000000000000000000000000000f04a636d10f42ec5a9d4885d30834a7081565b34801561091357600080fd5b506103d8610922366004612d44565b61191b565b34801561093357600080fd5b5061043d610942366004612f10565b611983565b34801561095357600080fd5b506103d8611a11565b34801561096857600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000271081565b34801561099c57600080fd5b506103b36109ab3660046130a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156109e557600080fd5b5061043d6109f4366004612f10565b611a9f565b348015610a0557600080fd5b50610380600d5481565b348015610a1b57600080fd5b5061043d610a2a366004612f10565b611b17565b348015610a3b57600080fd5b5061043d610a4a366004612d44565b611baf565b348015610a5b57600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000003281565b348015610a8f57600080fd5b50610380610a9e366004612d44565b611c0e565b60006001600160e01b0319821663780e9d6360e01b1480610ac85750610ac882611c3a565b92915050565b606060008054610add906130d6565b80601f0160208091040260200160405190810160405280929190818152602001828054610b09906130d6565b8015610b565780601f10610b2b57610100808354040283529160200191610b56565b820191906000526020600020905b815481529060010190602001808311610b3957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610bde5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610c058261140e565b9050806001600160a01b0316836001600160a01b03161415610c735760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610bd5565b336001600160a01b0382161480610c8f5750610c8f81336109ab565b610d015760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610bd5565b610d0b8383611c8a565b505050565b600280601354610100900460ff166002811115610d2f57610d2f612ed2565b14610d4d57604051630d6e554d60e11b815260040160405180910390fd5b600c54341015610d7057604051632c1d501360e11b815260040160405180910390fd5b610d78611646565b610d9557604051630626e30760e51b815260040160405180910390fd5b610d9e33611cf8565b50565b604080516001600160a01b03841660208083019190915282518083038201815282840184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006060840152607c80840182905284518085039091018152609c9093019093528151910120600091906000610e218286611d18565b600e546001600160a01b039182169116149695505050505050565b610e463382611d3c565b610e625760405162461bcd60e51b8152600401610bd590613111565b610d0b838383611e33565b6000610e7883611589565b8210610eda5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610bd5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600060128281548110610f1857610f18613162565b90600052602060002001549050919050565b60006001610f38838261318e565b610f62907f00000000000000000000000000000000000000000000000000000000000000326131a6565b610ac891906131c5565b610d0b838383604051806020016040528060008152506118e9565b600a546001600160a01b03163314610fb15760405162461bcd60e51b8152600401610bd5906131dc565b6013805460ff191660019081179091556040519081527fbb28b9fdb73d6fdb17e5242ec72ff13d3df29ac88f6143cc790fd3dcff6dffbe9060200160405180910390a1565b6000818152600260205260408120546001600160a01b03161515610ac8565b600061102060085490565b82106110835760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610bd5565b60088281548110610f1857610f18613162565b600a546001600160a01b031633146110c05760405162461bcd60e51b8152600401610bd5906131dc565b6110d36001600160a01b03821647611fde565b6040516001600160a01b03821681527f40ec257c70276a2df63ff5b3541d26c328e597d6d63bbddb5bf286ed2cd9104b906020015b60405180910390a150565b600a546001600160a01b031633148015906111395750600f546001600160a01b03163314155b156111575760405163ea8e4eb560e01b815260040160405180910390fd5b60135460ff161561117b5760405163cb72e14960e01b815260040160405180910390fd5b611187600b8383612c06565b507f228a3ac0675af69daeaaa5b8d369fe2faae665e7f340f0b78ccbb84e17b4f69482826040516111b9929190613211565b60405180910390a15050565b600a546001600160a01b031633146111ef5760405162461bcd60e51b8152600401610bd5906131dc565b601354610100900460ff16600281111561120b5761120b612ed2565b81600281111561121d5761121d612ed2565b141561123c57604051632e541fbd60e01b815260040160405180910390fd5b6013805482919061ff00191661010083600281111561125d5761125d612ed2565b02179055507f92a17b827ee9d42ea9454bb4ca941a1800870e6d01c0842d09ba23ccc0190ee1816040516111089190612ee8565b600a546001600160a01b031633146112bb5760405162461bcd60e51b8152600401610bd5906131dc565b816001600160a01b0316836001600160a01b031614156112ee5760405163530a10d160e11b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906001600160a01b038516906370a082319060240160206040518083038186803b15801561132f57600080fd5b505afa158015611343573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113679190613240565b101561138657604051631ea5376960e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114089190613259565b50505050565b6000818152600260205260408120546001600160a01b031680610ac85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610bd5565b600180601354610100900460ff1660028111156114a4576114a4612ed2565b146114c257604051630d6e554d60e11b815260040160405180910390fd5b600d543410156114e557604051632c1d501360e11b815260040160405180910390fd5b6114ed611646565b61150a57604051630626e30760e51b815260040160405180910390fd5b3360009081526011602052604090205460ff161561153b57604051637a5fbba360e01b815260040160405180910390fd5b6115453383610da1565b6115625760405163c73e16c160e01b815260040160405180910390fd5b336000818152601160205260409020805460ff1916600117905561158590611cf8565b5050565b60006001600160a01b0382166115f45760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610bd5565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b0316331461163a5760405162461bcd60e51b8152600401610bd5906131dc565b61164460006120f7565b565b60006116506116ce565b611658611699565b61166291906131c5565b905090565b600a546001600160a01b031633146116915760405162461bcd60e51b8152600401610bd5906131dc565b611644612149565b60006116a460085490565b611662907f00000000000000000000000000000000000000000000000000000000000027106131c5565b60006010547f000000000000000000000000000000000000000000000000000000000000006461166291906131c5565b600a546001600160a01b031633146117285760405162461bcd60e51b8152600401610bd5906131dc565b600d8190556040518181527ff24bd70115849c72fefc18b93d5ab835e248d43f5b66df3f24bdd7af5b8df67990602001611108565b606060018054610add906130d6565b600a546001600160a01b031633146117965760405162461bcd60e51b8152600401610bd5906131dc565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527fea9ac1e7ccb5a7f8d1d5b138218914611771f13e4bfe7635e33530d3c852433390602001611108565b6115853383836121cf565b6000806117fb83611c0e565b60125490915081106118105750600092915050565b50600192915050565b600080600061182784611c0e565b601254909150811061183f5750600093849350915050565b60006012828154811061185457611854613162565b6000918252602082200154915061188b7f00000000000000000000000000000000000000000000000000000000000000328361328c565b9050600061189884610f2a565b90506118a4828861318e565b9550808611156118db576118d87f0000000000000000000000000000000000000000000000000000000000000032876131c5565b95505b509395600195509350505050565b6118f33383611d3c565b61190f5760405162461bcd60e51b8152600401610bd590613111565b6114088484848461229e565b606060006119276122d1565b905060008061193585611819565b9150915080611968578260405160200161194f91906132a0565b6040516020818303038152906040529350505050919050565b82611972836122e0565b60405160200161194f9291906132e1565b600a546001600160a01b031633146119ad5760405162461bcd60e51b8152600401610bd5906131dc565b7f0000000000000000000000000000000000000000000000000000000000000064601054106119ef5760405163e54bf68360e01b815260040160405180910390fd5b600160106000828254611a02919061318e565b90915550610d9e905081611cf8565b600b8054611a1e906130d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4a906130d6565b8015611a975780601f10611a6c57610100808354040283529160200191611a97565b820191906000526020600020905b815481529060010190602001808311611a7a57829003601f168201915b505050505081565b600a546001600160a01b03163314611ac95760405162461bcd60e51b8152600401610bd5906131dc565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f7534626758889efe1509a1a3d7410b69c15c368d2cf1a9ed19b4a058baa97a4790602001611108565b600a546001600160a01b03163314611b415760405162461bcd60e51b8152600401610bd5906131dc565b6001600160a01b038116611ba65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bd5565b610d9e816120f7565b600a546001600160a01b03163314611bd95760405162461bcd60e51b8152600401610bd5906131dc565b600c8190556040518181527f25b1f9f6b6e61dfca5575239769e4450ed2e49176670837f5d1a82a9a2fc693f90602001611108565b6000610ac87f000000000000000000000000000000000000000000000000000000000000003283613310565b60006001600160e01b031982166380ac58cd60e01b1480611c6b57506001600160e01b03198216635b5e139f60e01b145b80610ac857506301ffc9a760e01b6001600160e01b0319831614610ac8565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611cbf8261140e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611d0360085490565b9050611d0e816123de565b611585828261241c565b6000806000611d27858561256a565b91509150611d34816125da565b509392505050565b6000818152600260205260408120546001600160a01b0316611db55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610bd5565b6000611dc08361140e565b9050806001600160a01b0316846001600160a01b03161480611dfb5750836001600160a01b0316611df084610b60565b6001600160a01b0316145b80611e2b57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611e468261140e565b6001600160a01b031614611eae5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610bd5565b6001600160a01b038216611f105760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610bd5565b611f1b838383612795565b611f26600082611c8a565b6001600160a01b0383166000908152600360205260408120805460019290611f4f9084906131c5565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f7d90849061318e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b8047101561202e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610bd5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461207b576040519150601f19603f3d011682016040523d82523d6000602084013e612080565b606091505b5050905080610d0b5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610bd5565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6012546040516bffffffffffffffffffffffff193360601b166020820152446034820152426054820152607481019190915260009060940160408051601f198184030181529190528051602090910120601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444015550565b816001600160a01b0316836001600160a01b031614156122315760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610bd5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6122a9848484611e33565b6122b58484848461284d565b6114085760405162461bcd60e51b8152600401610bd590613324565b6060600b8054610add906130d6565b6060816123045750506040805180820190915260018152600360fc1b602082015290565b8160005b811561232e578061231881613376565b91506123279050600a83613310565b9150612308565b60008167ffffffffffffffff81111561234957612349612d9e565b6040519080825280601f01601f191660200182016040528015612373576020820181803683370190505b5090505b8415611e2b576123886001836131c5565b9150612395600a8661328c565b6123a090603061318e565b60f81b8183815181106123b5576123b5613162565b60200101906001600160f81b031916908160001a9053506123d7600a86613310565b9450612377565b60006123e982611c0e565b6012549091508110156123fa575050565b600061240582610f2a565b90508281111561241457505050565b610d0b612149565b6001600160a01b0382166124725760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bd5565b6000818152600260205260409020546001600160a01b0316156124d75760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610bd5565b6124e360008383612795565b6001600160a01b038216600090815260036020526040812080546001929061250c90849061318e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000808251604114156125a15760208301516040840151606085015160001a6125958782858561295a565b945094505050506125d3565b8251604014156125cb57602083015160408401516125c0868383612a47565b9350935050506125d3565b506000905060025b9250929050565b60008160048111156125ee576125ee612ed2565b14156125f75750565b600181600481111561260b5761260b612ed2565b14156126595760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610bd5565b600281600481111561266d5761266d612ed2565b14156126bb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610bd5565b60038160048111156126cf576126cf612ed2565b14156127285760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610bd5565b600481600481111561273c5761273c612ed2565b1415610d9e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610bd5565b6001600160a01b0383166127f0576127eb81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612813565b816001600160a01b0316836001600160a01b031614612813576128138382612a76565b6001600160a01b03821661282a57610d0b81612b13565b826001600160a01b0316826001600160a01b031614610d0b57610d0b8282612bc2565b60006001600160a01b0384163b1561294f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612891903390899088908890600401613391565b602060405180830381600087803b1580156128ab57600080fd5b505af19250505080156128db575060408051601f3d908101601f191682019092526128d8918101906133ce565b60015b612935573d808015612909576040519150601f19603f3d011682016040523d82523d6000602084013e61290e565b606091505b50805161292d5760405162461bcd60e51b8152600401610bd590613324565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e2b565b506001949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156129915750600090506003612a3e565b8460ff16601b141580156129a957508460ff16601c14155b156129ba5750600090506004612a3e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612a0e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612a3757600060019250925050612a3e565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612a688782888561295a565b935093505050935093915050565b60006001612a8384611589565b612a8d91906131c5565b600083815260076020526040902054909150808214612ae0576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612b25906001906131c5565b60008381526009602052604081205460088054939450909284908110612b4d57612b4d613162565b906000526020600020015490508060088381548110612b6e57612b6e613162565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ba657612ba66133eb565b6001900381819060005260206000200160009055905550505050565b6000612bcd83611589565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b828054612c12906130d6565b90600052602060002090601f016020900481019282612c345760008555612c7a565b82601f10612c4d5782800160ff19823516178555612c7a565b82800160010185558215612c7a579182015b82811115612c7a578235825591602001919060010190612c5f565b50612c86929150612c8a565b5090565b5b80821115612c865760008155600101612c8b565b6001600160e01b031981168114610d9e57600080fd5b600060208284031215612cc757600080fd5b8135612cd281612c9f565b9392505050565b60005b83811015612cf4578181015183820152602001612cdc565b838111156114085750506000910152565b60008151808452612d1d816020860160208601612cd9565b601f01601f19169290920160200192915050565b602081526000612cd26020830184612d05565b600060208284031215612d5657600080fd5b5035919050565b6001600160a01b0381168114610d9e57600080fd5b60008060408385031215612d8557600080fd5b8235612d9081612d5d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612dc557600080fd5b813567ffffffffffffffff80821115612de057612de0612d9e565b604051601f8301601f19908116603f01168101908282118183101715612e0857612e08612d9e565b81604052838152866020858801011115612e2157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612e5457600080fd5b8235612e5f81612d5d565b9150602083013567ffffffffffffffff811115612e7b57600080fd5b612e8785828601612db4565b9150509250929050565b600080600060608486031215612ea657600080fd5b8335612eb181612d5d565b92506020840135612ec181612d5d565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612f0a57634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215612f2257600080fd5b8135612cd281612d5d565b60008060208385031215612f4057600080fd5b823567ffffffffffffffff80821115612f5857600080fd5b818501915085601f830112612f6c57600080fd5b813581811115612f7b57600080fd5b866020828501011115612f8d57600080fd5b60209290920196919550909350505050565b600060208284031215612fb157600080fd5b813560038110612cd257600080fd5b600060208284031215612fd257600080fd5b813567ffffffffffffffff811115612fe957600080fd5b611e2b84828501612db4565b8015158114610d9e57600080fd5b6000806040838503121561301657600080fd5b823561302181612d5d565b9150602083013561303181612ff5565b809150509250929050565b6000806000806080858703121561305257600080fd5b843561305d81612d5d565b9350602085013561306d81612d5d565b925060408501359150606085013567ffffffffffffffff81111561309057600080fd5b61309c87828801612db4565b91505092959194509250565b600080604083850312156130bb57600080fd5b82356130c681612d5d565b9150602083013561303181612d5d565b600181811c908216806130ea57607f821691505b6020821081141561310b57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156131a1576131a1613178565b500190565b60008160001904831182151516156131c0576131c0613178565b500290565b6000828210156131d7576131d7613178565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561325257600080fd5b5051919050565b60006020828403121561326b57600080fd5b8151612cd281612ff5565b634e487b7160e01b600052601260045260246000fd5b60008261329b5761329b613276565b500690565b600082516132b2818460208701612cd9565b7f74726176656c6c696e675f746f5f64657374696e6174696f6e00000000000000920191825250601901919050565b600083516132f3818460208801612cd9565b835190830190613307818360208801612cd9565b01949350505050565b60008261331f5761331f613276565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060001982141561338a5761338a613178565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133c490830184612d05565b9695505050505050565b6000602082840312156133e057600080fd5b8151612cd281612c9f565b634e487b7160e01b600052603160045260246000fdfea264697066735822122008802f8dd7c3a1ae4e400e4bc16e6d33f4c97ed85945edd847461b3f12533f4164736f6c63430008090033

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

00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000f04a636d10f42ec5a9d4885d30834a7000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000000354a6ba7a180000000000000000000000000008818b7d491ae4f69181fc62c28a67dde133b4232000000000000000000000000a4403c8388634b9b01b70763e2c5c44fec138250

-----Decoded View---------------
Arg [0] : definitiveMaxTokens (uint256): 10000
Arg [1] : definitiveMaxGiftableTokens (uint256): 100
Arg [2] : definitiveBatchSize (uint256): 50
Arg [3] : definitiveProvenanceHash (bytes32): 0x00000000000000000000000000000000f04a636d10f42ec5a9d4885d30834a70
Arg [4] : initialMintPrice (uint256): 200000000000000000
Arg [5] : initialEarlyMintPrice (uint256): 15000000000000000
Arg [6] : initialCouponSigner (address): 0x8818B7d491aE4F69181Fc62C28a67dDE133b4232
Arg [7] : initialUrlChanger (address): 0xA4403C8388634b9b01b70763e2C5C44FEC138250

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [3] : 00000000000000000000000000000000f04a636d10f42ec5a9d4885d30834a70
Arg [4] : 00000000000000000000000000000000000000000000000002c68af0bb140000
Arg [5] : 00000000000000000000000000000000000000000000000000354a6ba7a18000
Arg [6] : 0000000000000000000000008818b7d491ae4f69181fc62c28a67dde133b4232
Arg [7] : 000000000000000000000000a4403c8388634b9b01b70763e2c5c44fec138250


[ 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.