ETH Price: $3,254.69 (+5.15%)
 

Overview

TokenID

865

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

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

OVERVIEW

You’ve met Gus, but do you really know Gus? Allow us to reintroduce your favorite blue bean. Tough on the outside but with a heart of gold, Gus defies simple definition. This limited edition “Mind of Gus” vinyl is more than just a collectible — plumb the deepest recesses of the mind of Gus, enabled by PBT technology. Visit [azuki.com/pbt](https://azuki.com/pbt) to mint your Physical Backed Token (PBT). “Mind of Gus” vinyl owners can also equip their BEANZ at [azuki.com/collector](https://azuki.com/collector). PBTs are not transferable without the chip.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
MindOfGus

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 15 : MindOfGus.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./PBTTwoTiered.sol";

error MaxSupplyReached();
error MintNotOpen();
error CannotMakeChanges();
error CannotUpdateDeadline();

contract MindOfGus is PBTTwoTiered, Ownable {
    uint256 public immutable maxSupply;

    constructor(
        string memory name_,
        string memory symbol_,
        uint256 maxSupply_,
        uint256 maxRandomTokenId_
    ) PBTTwoTiered(name_, symbol_, maxRandomTokenId_) {
        maxSupply = maxSupply_;
    }

    uint256 public changeDeadline;
    uint256 public totalSupply;
    bool public canMint;

    string private _baseTokenURI;

    function seedChipAddresses(
        address[] calldata chipAddresses
    ) external onlyOwner {
        _seedChipAddresses(chipAddresses);
    }

    function updateChips(
        address[] calldata chipAddressesOld,
        address[] calldata chipAddressesNew
    ) external onlyOwner {
        if (changeDeadline != 0 && block.timestamp > changeDeadline) {
            revert CannotMakeChanges();
        }
        _updateChips(chipAddressesOld, chipAddressesNew);
    }

    function mintMOG(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig
    ) external {
        if (!canMint) {
            revert MintNotOpen();
        }
        if (totalSupply == maxSupply) {
            revert MaxSupplyReached();
        }
        _mintTokenWithChip(signatureFromChip, blockNumberUsedInSig);
        unchecked {
            ++totalSupply;
        }
    }

    function openMint() external onlyOwner {
        canMint = true;
    }

    function setChangeDeadline(uint256 timestamp) external onlyOwner {
        if (changeDeadline != 0) {
            revert CannotUpdateDeadline();
        }
        changeDeadline = timestamp;
    }

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

    function setBaseURI(string calldata baseURI) external onlyOwner {
        _baseTokenURI = baseURI;
    }

    function seedChipToTokenMappingForNonRandomSet(
        address[] calldata chipAddresses,
        uint256[] calldata tokenIds,
        bool throwIfInvalid
    ) external onlyOwner {
        _seedChipToTokenMappingForNonRandomSet(
            chipAddresses,
            tokenIds,
            throwIfInvalid
        );
    }
}

File 2 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 15 : PBTTwoTiered.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

import "@chiru-labs/pbt/IPBT.sol";
import "@chiru-labs/pbt/ERC721ReadOnly.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

error InvalidSignature();
error InvalidChipAddress();
error NoMintedTokenForChip();
error ArrayLengthMismatch();
error ChipAlreadyLinkedToMintedToken();
error UpdatingChipForUnsetChipMapping();
error NoMoreTokenIds();
error InvalidBlockNumber();
error BlockNumberTooOld();

error InvalidTokenIdRange();
error InvalidTokenIdForNonRandomSet();
error AlreadyAtMaxSupply();
error SeedingChipDataForExistingToken();

/**
 * Implementation of PBT where the tokenIds are split into two sets. The PBT's chip address determines which set it is in.
 * Set 1:
 *  - tokenId range: [0, RANDOM_TOKEN_ID_UPPER_BOUND)
 *  - tokenId pseudorandomly assigned onchain at mint time
 * Set 2:
 *  - tokenId range: [RANDOM_TOKEN_ID_UPPER_BOUND, ?)
 *  - tokenId assigned to chipAddress offchain (that mapping is still uploaded onchain)
 *
 * Example: suppose RANDOM_TOKEN_ID_UPPER_BOUND is 550.
 * If your PBT's chip is in the random set, it will have an id between 0 to 549, inclusive.
 * If your PBT's chip is in the nonrandom set, it will have an id >= 550.
 */
contract PBTTwoTiered is ERC721ReadOnly, IPBT {
    using ECDSA for bytes32;

    struct TokenData {
        uint256 tokenId;
        address chipAddress;
        bool set;
    }

    // Mapping from chipAddress to TokenData
    mapping(address => TokenData) _tokenDatas;

    // Data structure used for Fisher Yates shuffle for the random gen set
    uint256 private _numAvailableRemainingTokensInRandomGenSet;
    mapping(uint256 => uint256)
        internal _availableRemainingTokensInRandomGenSet;
    uint256 public immutable RANDOM_TOKEN_ID_UPPER_BOUND;

    // Data structure used to track non-random gen chip addresses
    // Mapping values are token ids (0 is an invalid token id for this set (falsy))
    mapping(address => uint256) public chipAddressesForNonRandomSet;

    constructor(
        string memory name_,
        string memory symbol_,
        uint256 randomTokenIdUpperBound
    ) ERC721ReadOnly(name_, symbol_) {
        _numAvailableRemainingTokensInRandomGenSet = randomTokenIdUpperBound;
        RANDOM_TOKEN_ID_UPPER_BOUND = randomTokenIdUpperBound;
    }

    function _seedChipAddresses(address[] memory chipAddresses) internal {
        for (uint256 i; i < chipAddresses.length; ++i) {
            address chipAddress = chipAddresses[i];
            _tokenDatas[chipAddress] = TokenData(0, chipAddress, false);
        }
    }

    function _seedChipToTokenMappingForNonRandomSet(
        address[] memory chipAddresses,
        uint256[] memory tokenIds,
        bool throwIfInvalid
    ) internal {
        uint256 tokenIdsLength = tokenIds.length;
        if (tokenIdsLength != chipAddresses.length) {
            revert ArrayLengthMismatch();
        }
        for (uint256 i; i < tokenIdsLength; ++i) {
            address chipAddress = chipAddresses[i];
            uint256 tokenId = tokenIds[i];
            if (throwIfInvalid) {
                if (_exists(tokenId)) revert SeedingChipDataForExistingToken();
                if (tokenId < RANDOM_TOKEN_ID_UPPER_BOUND || tokenId == 0)
                    revert InvalidTokenIdForNonRandomSet();
            }
            chipAddressesForNonRandomSet[chipAddress] = tokenId;
        }
    }

    function _updateChips(
        address[] calldata chipAddressesOld,
        address[] calldata chipAddressesNew
    ) internal {
        if (chipAddressesOld.length != chipAddressesNew.length) {
            revert ArrayLengthMismatch();
        }

        for (uint256 i = 0; i < chipAddressesOld.length; i++) {
            address oldChipAddress = chipAddressesOld[i];
            if (!_tokenDatas[oldChipAddress].set) {
                revert UpdatingChipForUnsetChipMapping();
            }
            address newChipAddress = chipAddressesNew[i];
            uint256 tokenId = _tokenDatas[oldChipAddress].tokenId;
            _tokenDatas[newChipAddress] = TokenData(
                tokenId,
                newChipAddress,
                true
            );
            emit PBTChipRemapping(tokenId, oldChipAddress, newChipAddress);
            delete _tokenDatas[oldChipAddress];
        }
    }

    function tokenIdFor(
        address chipAddress
    ) external view override returns (uint256) {
        if (!_tokenDatas[chipAddress].set) {
            revert NoMintedTokenForChip();
        }
        return _tokenDatas[chipAddress].tokenId;
    }

    // Returns true if the signer of the signature of the payload is the chip for the token id
    function isChipSignatureForToken(
        uint256 tokenId,
        bytes memory payload,
        bytes memory signature
    ) public view override returns (bool) {
        if (!_exists(tokenId)) {
            revert NoMintedTokenForChip();
        }
        bytes32 signedHash = keccak256(payload).toEthSignedMessageHash();
        address chipAddr = signedHash.recover(signature);
        return
            _tokenDatas[chipAddr].set &&
            _tokenDatas[chipAddr].tokenId == tokenId;
    }

    // Parameters:
    //    to: the address of the new owner
    //    signatureFromChip: signature(receivingAddress + recentBlockhash), signed by an approved chip
    //
    // Contract should check that (1) recentBlockhash is a recent blockhash, (2) receivingAddress === to, and (3) the signing chip is allowlisted.
    function _mintTokenWithChip(
        bytes memory signatureFromChip,
        uint256 blockNumberUsedInSig
    ) internal returns (uint256) {
        address chipAddr = _getChipAddrForChipSignature(
            signatureFromChip,
            blockNumberUsedInSig
        );

        if (_tokenDatas[chipAddr].set) {
            revert ChipAlreadyLinkedToMintedToken();
        } else if (_tokenDatas[chipAddr].chipAddress != chipAddr) {
            revert InvalidChipAddress();
        }

        uint256 tokenId = chipAddressesForNonRandomSet[chipAddr];
        if (tokenId == 0) {
            tokenId = _useRandomAvailableTokenId();
        }

        _mint(_msgSender(), tokenId);

        _tokenDatas[chipAddr] = TokenData(tokenId, chipAddr, true);

        emit PBTMint(tokenId, chipAddr);

        return tokenId;
    }

    // Generates a pseudorandom number between [0,RANDOM_TOKEN_ID_UPPER_BOUND) that has not yet been generated before, in O(1) time.
    //
    // Uses Durstenfeld's version of the Yates Shuffle https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
    // with a twist to avoid having to manually spend gas to preset an array's values to be values 0...n.
    // It does this by interpreting zero-values for an index X as meaning that index X itself is an available value
    // that is returnable.
    //
    // How it works:
    //  - zero-initialize a mapping (_availableRemainingTokensInRandomGenSet) and track its length (_numAvailableRemainingTokensInRandomGenSet). functionally similar to an array with dynamic sizing
    //    - this mapping will track all remaining valid values that haven't been generated yet, through a combination of its indices and values
    //      - if _availableRemainingTokensInRandomGenSet[x] == 0, that means x has not been generated yet
    //      - if _availableRemainingTokensInRandomGenSet[x] != 0, that means _availableRemainingTokensInRandomGenSet[x] has not been generated yet
    //  - when prompted for a random number between [0,RANDOM_TOKEN_ID_UPPER_BOUND) that hasn't already been used:
    //    - generate a random index randIndex between [0,_numAvailableRemainingTokensInRandomGenSet)
    //    - examine the value at _availableRemainingTokensInRandomGenSet[randIndex]
    //        - if the value is zero, it means randIndex has not been used, so we can return randIndex
    //        - if the value is non-zero, it means the value has not been used, so we can return _availableRemainingTokensInRandomGenSet[randIndex]
    //    - update the _availableRemainingTokensInRandomGenSet mapping state
    //        - set _availableRemainingTokensInRandomGenSet[randIndex] to either the index or the value of the last entry in the mapping (depends on the last entry's state)
    //        - decrement _numAvailableRemainingTokensInRandomGenSet to mimic the shrinking of an array
    function _useRandomAvailableTokenId() internal returns (uint256) {
        uint256 numAvailableRemainingTokens = _numAvailableRemainingTokensInRandomGenSet;
        if (numAvailableRemainingTokens == 0) {
            revert NoMoreTokenIds();
        }

        uint256 randomNum = _getRandomNum(numAvailableRemainingTokens);
        uint256 randomIndex = randomNum % numAvailableRemainingTokens;
        uint256 valAtIndex = _availableRemainingTokensInRandomGenSet[
            randomIndex
        ];

        uint256 result;
        if (valAtIndex == 0) {
            // This means the index itself is still an available token
            result = randomIndex;
        } else {
            // This means the index itself is not an available token, but the val at that index is.
            result = valAtIndex;
        }

        uint256 lastIndex = numAvailableRemainingTokens - 1;
        if (randomIndex != lastIndex) {
            // Replace the value at randomIndex, now that it's been used.
            // Replace it with the data from the last index in the array, since we are going to decrease the array size afterwards.
            uint256 lastValInArray = _availableRemainingTokensInRandomGenSet[
                lastIndex
            ];
            if (lastValInArray == 0) {
                // This means the index itself is still an available token
                _availableRemainingTokensInRandomGenSet[
                    randomIndex
                ] = lastIndex;
            } else {
                // This means the index itself is not an available token, but the val at that index is.
                _availableRemainingTokensInRandomGenSet[
                    randomIndex
                ] = lastValInArray;
                delete _availableRemainingTokensInRandomGenSet[lastIndex];
            }
        }

        _numAvailableRemainingTokensInRandomGenSet--;

        return result;
    }

    // Devs can swap this out for something less gameable like chainlink if it makes sense for their use case.
    function _getRandomNum(
        uint256 numAvailableRemainingTokens
    ) internal view virtual returns (uint256) {
        return
            uint256(
                keccak256(
                    abi.encode(
                        _msgSender(),
                        tx.gasprice,
                        block.number,
                        block.timestamp,
                        block.prevrandao,
                        blockhash(block.number - 1),
                        address(this),
                        numAvailableRemainingTokens
                    )
                )
            );
    }

    function transferTokenWithChip(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig
    ) public override {
        transferTokenWithChip(signatureFromChip, blockNumberUsedInSig, false);
    }

    function transferTokenWithChip(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig,
        bool useSafeTransferFrom
    ) public override {
        TokenData memory tokenData = _getTokenDataForChipSignature(
            signatureFromChip,
            blockNumberUsedInSig
        );
        uint256 tokenId = tokenData.tokenId;
        if (useSafeTransferFrom) {
            _safeTransfer(ownerOf(tokenId), _msgSender(), tokenId, "");
        } else {
            _transfer(ownerOf(tokenId), _msgSender(), tokenId);
        }
    }

    function _getTokenDataForChipSignature(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig
    ) internal view returns (TokenData memory) {
        address chipAddr = _getChipAddrForChipSignature(
            signatureFromChip,
            blockNumberUsedInSig
        );
        TokenData memory tokenData = _tokenDatas[chipAddr];
        if (tokenData.set) {
            return tokenData;
        }
        revert InvalidSignature();
    }

    function _getChipAddrForChipSignature(
        bytes memory signatureFromChip,
        uint256 blockNumberUsedInSig
    ) internal view returns (address) {
        // The blockNumberUsedInSig must be in a previous block because the blockhash of the current
        // block does not exist yet.
        if (block.number <= blockNumberUsedInSig) {
            revert InvalidBlockNumber();
        }

        if (block.number - blockNumberUsedInSig > getMaxBlockDelay()) {
            revert BlockNumberTooOld();
        }

        bytes32 blockHash = blockhash(blockNumberUsedInSig);
        bytes32 signedHash = keccak256(
            abi.encodePacked(_msgSender(), blockHash)
        ).toEthSignedMessageHash();
        return signedHash.recover(signatureFromChip);
    }

    function getMaxBlockDelay() public pure virtual returns (uint256) {
        return 100;
    }

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

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 5 of 15 : IPBT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @dev Contract for PBTs (Physical Backed Tokens).
 * NFTs that are backed by a physical asset, through a chip embedded in the physical asset.
 */

interface IPBT {
    /// @notice Returns the token id for a given chip address.
    /// @dev Throws if there is no existing token for the chip in the collection.
    /// @param chipAddress The address for the chip embedded in the physical item (computed from the chip's public key).
    /// @return The token id for the passed in chip address.
    function tokenIdFor(address chipAddress) external view returns (uint256);

    /// @notice Returns true if the chip for the specified token id is the signer of the signature of the payload.
    /// @dev Throws if tokenId does not exist in the collection.
    /// @param tokenId The token id.
    /// @param payload Arbitrary data that is signed by the chip to produce the signature param.
    /// @param signature Chip's signature of the passed-in payload.
    /// @return Whether the signature of the payload was signed by the chip linked to the token id.
    function isChipSignatureForToken(uint256 tokenId, bytes calldata payload, bytes calldata signature)
        external
        view
        returns (bool);

    /// @notice Transfers the token into the message sender's wallet.
    /// @param signatureFromChip An EIP-191 signature of (msgSender, blockhash), where blockhash is the block hash for blockNumberUsedInSig.
    /// @param blockNumberUsedInSig The block number linked to the blockhash signed in signatureFromChip. Should be a recent block number.
    /// @param useSafeTransferFrom Whether EIP-721's safeTransferFrom should be used in the implementation, instead of transferFrom.
    ///
    /// @dev The implementation should check that block number be reasonably recent to avoid replay attacks of stale signatures.
    /// The implementation should also verify that the address signed in the signature matches msgSender.
    /// If the address recovered from the signature matches a chip address that's bound to an existing token, the token should be transferred to msgSender.
    /// If there is no existing token linked to the chip, the function should error.
    function transferTokenWithChip(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig,
        bool useSafeTransferFrom
    ) external;

    /// @notice Calls transferTokenWithChip as defined above, with useSafeTransferFrom set to false.
    function transferTokenWithChip(bytes calldata signatureFromChip, uint256 blockNumberUsedInSig) external;

    /// @notice Emitted when a token is minted.
    event PBTMint(uint256 indexed tokenId, address indexed chipAddress);

    /// @notice Emitted when a token is mapped to a different chip.
    /// Chip replacements may be useful in certain scenarios (e.g. chip defect).
    event PBTChipRemapping(uint256 indexed tokenId, address indexed oldChipAddress, address indexed newChipAddress);
}

File 6 of 15 : ERC721ReadOnly.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

/**
 * An implementation of 721 that's publicly readonly (no approvals or transfers exposed).
 */

contract ERC721ReadOnly is ERC721 {
    constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {}

    function approve(address to, uint256 tokenId) public virtual override {
        revert("ERC721 public approve not allowed");
    }

    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: invalid token ID");
        return address(0);
    }

    function setApprovalForAll(address operator, bool approved) public virtual override {
        revert("ERC721 public setApprovalForAll not allowed");
    }

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

    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        revert("ERC721 public transferFrom not allowed");
    }

    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        revert("ERC721 public safeTransferFrom not allowed");
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
        revert("ERC721 public safeTransferFrom not allowed");
    }
}

File 7 of 15 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (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) {
        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.
            /// @solidity memory-safe-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 {
            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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 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 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

File 13 of 15 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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: address zero is not a valid owner");
        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: invalid token ID");
        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) {
        _requireMinted(tokenId);

        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 overridden 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 token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        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: caller is not token 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: caller is not token 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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

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

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

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

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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 {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "@chiru-labs/pbt/=lib/PBT/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"uint256","name":"maxRandomTokenId_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BlockNumberTooOld","type":"error"},{"inputs":[],"name":"CannotMakeChanges","type":"error"},{"inputs":[],"name":"CannotUpdateDeadline","type":"error"},{"inputs":[],"name":"ChipAlreadyLinkedToMintedToken","type":"error"},{"inputs":[],"name":"InvalidBlockNumber","type":"error"},{"inputs":[],"name":"InvalidChipAddress","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTokenIdForNonRandomSet","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MintNotOpen","type":"error"},{"inputs":[],"name":"NoMintedTokenForChip","type":"error"},{"inputs":[],"name":"NoMoreTokenIds","type":"error"},{"inputs":[],"name":"SeedingChipDataForExistingToken","type":"error"},{"inputs":[],"name":"UpdatingChipForUnsetChipMapping","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"oldChipAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newChipAddress","type":"address"}],"name":"PBTChipRemapping","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"chipAddress","type":"address"}],"name":"PBTMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"RANDOM_TOKEN_ID_UPPER_BOUND","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changeDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"chipAddressesForNonRandomSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxBlockDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"isChipSignatureForToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signatureFromChip","type":"bytes"},{"internalType":"uint256","name":"blockNumberUsedInSig","type":"uint256"}],"name":"mintMOG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openMint","outputs":[],"stateMutability":"nonpayable","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":"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":"chipAddresses","type":"address[]"}],"name":"seedChipAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"chipAddresses","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bool","name":"throwIfInvalid","type":"bool"}],"name":"seedChipToTokenMappingForNonRandomSet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setChangeDeadline","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":"address","name":"chipAddress","type":"address"}],"name":"tokenIdFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signatureFromChip","type":"bytes"},{"internalType":"uint256","name":"blockNumberUsedInSig","type":"uint256"}],"name":"transferTokenWithChip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signatureFromChip","type":"bytes"},{"internalType":"uint256","name":"blockNumberUsedInSig","type":"uint256"},{"internalType":"bool","name":"useSafeTransferFrom","type":"bool"}],"name":"transferTokenWithChip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"chipAddressesOld","type":"address[]"},{"internalType":"address[]","name":"chipAddressesNew","type":"address[]"}],"name":"updateChips","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b5060405162002abd38038062002abd83398101604081905262000034916200019a565b838382828281816000620000498382620002a5565b506001620000588282620002a5565b50505060078390555050608052506200007390503362000080565b5060a05250620003719050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000fa57600080fd5b81516001600160401b0380821115620001175762000117620000d2565b604051601f8301601f19908116603f01168101908282118183101715620001425762000142620000d2565b81604052838152602092508660208588010111156200016057600080fd5b600091505b8382101562000184578582018301518183018401529082019062000165565b6000602085830101528094505050505092915050565b60008060008060808587031215620001b157600080fd5b84516001600160401b0380821115620001c957600080fd5b620001d788838901620000e8565b95506020870151915080821115620001ee57600080fd5b50620001fd87828801620000e8565b604087015160609097015195989097509350505050565b600181811c908216806200022957607f821691505b6020821081036200024a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a0576000816000526020600020601f850160051c810160208610156200027b5750805b601f850160051c820191505b818110156200029c5782815560010162000287565b5050505b505050565b81516001600160401b03811115620002c157620002c1620000d2565b620002d981620002d2845462000214565b8462000250565b602080601f831160018114620003115760008415620002f85750858301515b600019600386901b1c1916600185901b1785556200029c565b600085815260208120601f198616915b82811015620003425788860151825594840194600190910190840162000321565b5085821015620003615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a051612718620003a5600039600081816104290152610a390152600081816103ef0152610dbf01526127186000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80637fd5e8311161011a578063c87b56dd116100ad578063d67d13ad1161007c578063d67d13ad1461044b578063dcf960ee1461045e578063e985e9c514610471578063f086560814610487578063f2fde38b146104a757600080fd5b8063c87b56dd146103d7578063cc2ada4c146103ea578063d30d520c14610411578063d5abeb011461042457600080fd5b8063a5616b81116100e9578063a5616b81146103a1578063b88d4fde146103b4578063bce6d672146103c2578063beb9716d146103ca57600080fd5b80637fd5e8311461036c5780638da5cb5b1461037557806395d89b4114610386578063a22cb4651461038e57600080fd5b806329760b401161019d578063608df52a1161016c578063608df52a146103245780636352211e1461032b57806370a082311461033e578063715018a614610351578063797f6f621461035957600080fd5b806329760b40146102d857806342842e0e146102eb5780634b5f42ea146102fe57806355f804b31461031157600080fd5b8063095ea7b3116101d9578063095ea7b31461029457806313f23374146102a957806318160ddd146102bc57806323b872dd146102c557600080fd5b806301ffc9a71461020b57806306fdde0314610233578063081812fc1461024857806308daee3614610273575b600080fd5b61021e610219366004611e14565b6104ba565b60405190151581526020015b60405180910390f35b61023b6104e5565b60405161022a9190611e81565b61025b610256366004611e94565b610577565b6040516001600160a01b03909116815260200161022a565b610286610281366004611ec9565b6105bc565b60405190815260200161022a565b6102a76102a2366004611ee4565b61061b565b005b6102a76102b7366004611f62565b61066d565b610286600c5481565b6102a76102d3366004611fe2565b6106eb565b6102a76102e6366004611e94565b610742565b6102a76102f9366004611fe2565b610770565b61021e61030c3660046120c0565b6107cb565b6102a761031f36600461216d565b610878565b6064610286565b61025b610339366004611e94565b610892565b61028661034c366004611ec9565b6108c7565b6102a761094d565b6102a76103673660046121ae565b610961565b610286600b5481565b600a546001600160a01b031661025b565b61023b6109a9565b6102a761039c3660046121e3565b6109b8565b6102a76103af366004612216565b610a14565b6102a76102f9366004612261565b6102a7610ac9565b600d5461021e9060ff1681565b61023b6103e5366004611e94565b610ae0565b6102867f000000000000000000000000000000000000000000000000000000000000000081565b6102a761041f3660046122c8565b610b46565b6102867f000000000000000000000000000000000000000000000000000000000000000081565b6102a7610459366004612216565b610b90565b6102a761046c366004612333565b610b99565b61021e61047f36600461238f565b600092915050565b610286610495366004611ec9565b60096020526000908152604090205481565b6102a76104b5366004611ec9565b610bf4565b60006001600160e01b03198216634901df9f60e01b14806104df57506104df82610c6d565b92915050565b6060600080546104f4906123b9565b80601f0160208091040260200160405190810160405280929190818152602001828054610520906123b9565b801561056d5780601f106105425761010080835404028352916020019161056d565b820191906000526020600020905b81548152906001019060200180831161055057829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105b45760405162461bcd60e51b81526004016105ab906123f3565b60405180910390fd5b506000919050565b6001600160a01b038116600090815260066020526040812060010154600160a01b900460ff166105ff57604051631d240ff960e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205490565b60405162461bcd60e51b815260206004820152602160248201527f455243373231207075626c696320617070726f7665206e6f7420616c6c6f77656044820152601960fa1b60648201526084016105ab565b610675610cbd565b6106e485858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250869250610d17915050565b5050505050565b60405162461bcd60e51b815260206004820152602660248201527f455243373231207075626c6963207472616e7366657246726f6d206e6f7420616044820152651b1b1bddd95960d21b60648201526084016105ab565b61074a610cbd565b600b541561076b57604051636eade3f360e11b815260040160405180910390fd5b600b55565b60405162461bcd60e51b815260206004820152602a60248201527f455243373231207075626c696320736166655472616e7366657246726f6d206e6044820152691bdd08185b1b1bddd95960b21b60648201526084016105ab565b6000838152600260205260408120546001600160a01b031661080057604051631d240ff960e21b815260040160405180910390fd5b60006108128480519060200120610e29565b905060006108208285610e7c565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff16801561086c57506001600160a01b03811660009081526006602052604090205486145b925050505b9392505050565b610880610cbd565b600e61088d828483612472565b505050565b6000818152600260205260408120546001600160a01b0316806104df5760405162461bcd60e51b81526004016105ab906123f3565b60006001600160a01b0382166109315760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105ab565b506001600160a01b031660009081526003602052604090205490565b610955610cbd565b61095f6000610ea0565b565b610969610cbd565b6109a5828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610ef292505050565b5050565b6060600180546104f4906123b9565b60405162461bcd60e51b815260206004820152602b60248201527f455243373231207075626c696320736574417070726f76616c466f72416c6c2060448201526a1b9bdd08185b1b1bddd95960aa1b60648201526084016105ab565b600d5460ff16610a375760405163951b974f60e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000600c5403610a795760405163d05cb60960e01b815260040160405180910390fd5b610aba83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250610f85915050565b5050600c805460010190555050565b610ad1610cbd565b600d805460ff19166001179055565b6060610aeb826110e0565b6000610af5611114565b90506000815111610b155760405180602001604052806000815250610871565b80610b1f84611123565b604051602001610b30929190612531565b6040516020818303038152906040529392505050565b610b4e610cbd565b600b5415801590610b605750600b5442115b15610b7e5760405163624b779560e01b815260040160405180910390fd5b610b8a8484848461122b565b50505050565b61088d83838360005b6000610ba68585856113be565b80519091508215610bd957610bd4610bbd82610892565b338360405180602001604052806000815250611496565b610bec565b610bec610be582610892565b33836114c9565b505050505050565b610bfc610cbd565b6001600160a01b038116610c615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ab565b610c6a81610ea0565b50565b60006001600160e01b031982166380ac58cd60e01b1480610c9e57506001600160e01b03198216635b5e139f60e01b145b806104df57506301ffc9a760e01b6001600160e01b03198316146104df565b600a546001600160a01b0316331461095f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ab565b815183518114610d3a5760405163512509d360e11b815260040160405180910390fd5b60005b818110156106e4576000858281518110610d5957610d59612560565b602002602001015190506000858381518110610d7757610d77612560565b602002602001015190508415610e07576000818152600260205260409020546001600160a01b031615610dbd57604051633fc613e760e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000811080610de9575080155b15610e075760405163991b1d5960e01b815260040160405180910390fd5b6001600160a01b03909116600090815260096020526040902055600101610d3d565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000610e8b8585611665565b91509150610e98816116aa565b509392505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b81518110156109a5576000828281518110610f1257610f12612560565b6020908102919091018101516040805160608101825260008082526001600160a01b0393841682860181815283850183815291835260069096529290209051815592516001938401805492511515600160a01b026001600160a81b03199093169190931617179055919091019050610ef5565b600080610f928484611860565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1615610fd957604051630396ad9960e31b815260040160405180910390fd5b6001600160a01b0380821660008181526006602052604090206001015490911614611017576040516322c6337560e11b815260040160405180910390fd5b6001600160a01b038116600090815260096020526040812054908190036110435761104061190c565b90505b61104d33826119ec565b604080516060810182528281526001600160a01b0380851660208084018281526001858701818152600085815260069094528784209651875591519501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915183917f1e98ed4919fa421d4b871082794f2c63228dd0b5efb584e1a6131de3a7d26cb291a3949350505050565b6000818152600260205260409020546001600160a01b0316610c6a5760405162461bcd60e51b81526004016105ab906123f3565b6060600e80546104f4906123b9565b60608160000361114a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611174578061115e8161258c565b915061116d9050600a836125bb565b915061114e565b6000816001600160401b0381111561118e5761118e61201e565b6040519080825280601f01601f1916602001820160405280156111b8576020820181803683370190505b5090505b8415611223576111cd6001836125cf565b91506111da600a866125e2565b6111e59060306125f6565b60f81b8183815181106111fa576111fa612560565b60200101906001600160f81b031916908160001a90535061121c600a866125bb565b94506111bc565b949350505050565b82811461124b5760405163512509d360e11b815260040160405180910390fd5b60005b838110156106e457600085858381811061126a5761126a612560565b905060200201602081019061127f9190611ec9565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff166112c55760405163794ea60960e01b815260040160405180910390fd5b60008484848181106112d9576112d9612560565b90506020020160208101906112ee9190611ec9565b6001600160a01b0380841660008181526006602081815260408084205481516060810183528181528789168185018181526001838601818152838a5297909652848820925183555191909401805495511515600160a01b026001600160a81b031990961691909816179390931790955593519495509384917fcd66beec785ca42d0623b531cba30cb24eacae50d76d9301b6945341cbd5856591a450506001600160a01b03166000908152600660205260408120908155600190810180546001600160a81b03191690550161124e565b6040805160608101825260008082526020820181905291810191909152600061141e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250611860915050565b6001600160a01b0381811660009081526006602090815260409182902082516060810184528154815260019091015493841691810191909152600160a01b90920460ff16158015918301919091529192509061147d5791506108719050565b604051638baa579f60e01b815260040160405180910390fd5b6114a18484846114c9565b6114ad84848484611b2e565b610b8a5760405162461bcd60e51b81526004016105ab90612609565b826001600160a01b03166114dc82610892565b6001600160a01b0316146115405760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105ab565b6001600160a01b0382166115a25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ab565b6115ad600082611c2f565b6001600160a01b03831660009081526003602052604081208054600192906115d69084906125cf565b90915550506001600160a01b03821660009081526003602052604081208054600192906116049084906125f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600080825160410361169b5760208301516040840151606085015160001a61168f87828585611c9d565b945094505050506116a3565b506000905060025b9250929050565b60008160048111156116be576116be61265b565b036116c65750565b60018160048111156116da576116da61265b565b036117275760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ab565b600281600481111561173b5761173b61265b565b036117885760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ab565b600381600481111561179c5761179c61265b565b036117f45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ab565b60048160048111156118085761180861265b565b03610c6a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ab565b600081431161188257604051631391e11b60e21b815260040160405180910390fd5b606461188e83436125cf565b11156118ad576040516351cc51c760e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152824060348201819052906000906118f79060540160405160208183030381529060405280519060200120610e29565b90506119038186610e7c565b95945050505050565b6007546000908082036119325760405163aeb0cc9b60e01b815260040160405180910390fd5b600061193d82611d8a565b9050600061194b83836125e2565b60008181526008602052604081205491925081810361196b57508161196e565b50805b600061197b6001876125cf565b90508084146119cc57600081815260086020526040812054908190036119b15760008581526008602052604090208290556119ca565b6000858152600860205260408082208390558382528120555b505b600780549060006119dc83612671565b9091555091979650505050505050565b6001600160a01b038216611a425760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ab565b6000818152600260205260409020546001600160a01b031615611aa75760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ab565b6001600160a01b0382166000908152600360205260408120805460019290611ad09084906125f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b15611c2457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611b72903390899088908890600401612688565b6020604051808303816000875af1925050508015611bad575060408051601f3d908101601f19168201909252611baa918101906126c5565b60015b611c0a573d808015611bdb576040519150601f19603f3d011682016040523d82523d6000602084013e611be0565b606091505b508051600003611c025760405162461bcd60e51b81526004016105ab90612609565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611223565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c6482610892565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611cd45750600090506003611d81565b8460ff16601b14158015611cec57508460ff16601c14155b15611cfd5750600090506004611d81565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d51573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7a57600060019250925050611d81565b9150600090505b94509492505050565b6000333a434244611d9c6001846125cf565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018390526101200160408051601f19818403018152919052805160209091012092915050565b6001600160e01b031981168114610c6a57600080fd5b600060208284031215611e2657600080fd5b813561087181611dfe565b60005b83811015611e4c578181015183820152602001611e34565b50506000910152565b60008151808452611e6d816020860160208601611e31565b601f01601f19169290920160200192915050565b6020815260006108716020830184611e55565b600060208284031215611ea657600080fd5b5035919050565b80356001600160a01b0381168114611ec457600080fd5b919050565b600060208284031215611edb57600080fd5b61087182611ead565b60008060408385031215611ef757600080fd5b611f0083611ead565b946020939093013593505050565b60008083601f840112611f2057600080fd5b5081356001600160401b03811115611f3757600080fd5b6020830191508360208260051b85010111156116a357600080fd5b80358015158114611ec457600080fd5b600080600080600060608688031215611f7a57600080fd5b85356001600160401b0380821115611f9157600080fd5b611f9d89838a01611f0e565b90975095506020880135915080821115611fb657600080fd5b50611fc388828901611f0e565b9094509250611fd6905060408701611f52565b90509295509295909350565b600080600060608486031215611ff757600080fd5b61200084611ead565b925061200e60208501611ead565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261204557600080fd5b81356001600160401b038082111561205f5761205f61201e565b604051601f8301601f19908116603f011681019082821181831017156120875761208761201e565b816040528381528660208588010111156120a057600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156120d557600080fd5b8335925060208401356001600160401b03808211156120f357600080fd5b6120ff87838801612034565b9350604086013591508082111561211557600080fd5b5061212286828701612034565b9150509250925092565b60008083601f84011261213e57600080fd5b5081356001600160401b0381111561215557600080fd5b6020830191508360208285010111156116a357600080fd5b6000806020838503121561218057600080fd5b82356001600160401b0381111561219657600080fd5b6121a28582860161212c565b90969095509350505050565b600080602083850312156121c157600080fd5b82356001600160401b038111156121d757600080fd5b6121a285828601611f0e565b600080604083850312156121f657600080fd5b6121ff83611ead565b915061220d60208401611f52565b90509250929050565b60008060006040848603121561222b57600080fd5b83356001600160401b0381111561224157600080fd5b61224d8682870161212c565b909790965060209590950135949350505050565b6000806000806080858703121561227757600080fd5b61228085611ead565b935061228e60208601611ead565b92506040850135915060608501356001600160401b038111156122b057600080fd5b6122bc87828801612034565b91505092959194509250565b600080600080604085870312156122de57600080fd5b84356001600160401b03808211156122f557600080fd5b61230188838901611f0e565b9096509450602087013591508082111561231a57600080fd5b5061232787828801611f0e565b95989497509550505050565b6000806000806060858703121561234957600080fd5b84356001600160401b0381111561235f57600080fd5b61236b8782880161212c565b9095509350506020850135915061238460408601611f52565b905092959194509250565b600080604083850312156123a257600080fd5b6123ab83611ead565b915061220d60208401611ead565b600181811c908216806123cd57607f821691505b6020821081036123ed57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526018908201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604082015260600190565b601f82111561088d576000816000526020600020601f850160051c810160208610156124535750805b601f850160051c820191505b81811015610bec5782815560010161245f565b6001600160401b038311156124895761248961201e565b61249d8361249783546123b9565b8361242a565b6000601f8411600181146124d157600085156124b95750838201355b600019600387901b1c1916600186901b1783556106e4565b600083815260209020601f19861690835b8281101561250257868501358255602094850194600190920191016124e2565b508682101561251f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351612543818460208801611e31565b835190830190612557818360208801611e31565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161259e5761259e612576565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826125ca576125ca6125a5565b500490565b818103818111156104df576104df612576565b6000826125f1576125f16125a5565b500690565b808201808211156104df576104df612576565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60008161268057612680612576565b506000190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126bb90830184611e55565b9695505050505050565b6000602082840312156126d757600080fd5b815161087181611dfe56fea2646970667358221220a3067a7ca815476a7c3cfe04ce3d1b2ca8772b031572eca900d0f4fde866b7be64736f6c63430008160033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000094d696e644f66477573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d4f470000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c80637fd5e8311161011a578063c87b56dd116100ad578063d67d13ad1161007c578063d67d13ad1461044b578063dcf960ee1461045e578063e985e9c514610471578063f086560814610487578063f2fde38b146104a757600080fd5b8063c87b56dd146103d7578063cc2ada4c146103ea578063d30d520c14610411578063d5abeb011461042457600080fd5b8063a5616b81116100e9578063a5616b81146103a1578063b88d4fde146103b4578063bce6d672146103c2578063beb9716d146103ca57600080fd5b80637fd5e8311461036c5780638da5cb5b1461037557806395d89b4114610386578063a22cb4651461038e57600080fd5b806329760b401161019d578063608df52a1161016c578063608df52a146103245780636352211e1461032b57806370a082311461033e578063715018a614610351578063797f6f621461035957600080fd5b806329760b40146102d857806342842e0e146102eb5780634b5f42ea146102fe57806355f804b31461031157600080fd5b8063095ea7b3116101d9578063095ea7b31461029457806313f23374146102a957806318160ddd146102bc57806323b872dd146102c557600080fd5b806301ffc9a71461020b57806306fdde0314610233578063081812fc1461024857806308daee3614610273575b600080fd5b61021e610219366004611e14565b6104ba565b60405190151581526020015b60405180910390f35b61023b6104e5565b60405161022a9190611e81565b61025b610256366004611e94565b610577565b6040516001600160a01b03909116815260200161022a565b610286610281366004611ec9565b6105bc565b60405190815260200161022a565b6102a76102a2366004611ee4565b61061b565b005b6102a76102b7366004611f62565b61066d565b610286600c5481565b6102a76102d3366004611fe2565b6106eb565b6102a76102e6366004611e94565b610742565b6102a76102f9366004611fe2565b610770565b61021e61030c3660046120c0565b6107cb565b6102a761031f36600461216d565b610878565b6064610286565b61025b610339366004611e94565b610892565b61028661034c366004611ec9565b6108c7565b6102a761094d565b6102a76103673660046121ae565b610961565b610286600b5481565b600a546001600160a01b031661025b565b61023b6109a9565b6102a761039c3660046121e3565b6109b8565b6102a76103af366004612216565b610a14565b6102a76102f9366004612261565b6102a7610ac9565b600d5461021e9060ff1681565b61023b6103e5366004611e94565b610ae0565b6102867f00000000000000000000000000000000000000000000000000000000000003e881565b6102a761041f3660046122c8565b610b46565b6102867f00000000000000000000000000000000000000000000000000000000000003e881565b6102a7610459366004612216565b610b90565b6102a761046c366004612333565b610b99565b61021e61047f36600461238f565b600092915050565b610286610495366004611ec9565b60096020526000908152604090205481565b6102a76104b5366004611ec9565b610bf4565b60006001600160e01b03198216634901df9f60e01b14806104df57506104df82610c6d565b92915050565b6060600080546104f4906123b9565b80601f0160208091040260200160405190810160405280929190818152602001828054610520906123b9565b801561056d5780601f106105425761010080835404028352916020019161056d565b820191906000526020600020905b81548152906001019060200180831161055057829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105b45760405162461bcd60e51b81526004016105ab906123f3565b60405180910390fd5b506000919050565b6001600160a01b038116600090815260066020526040812060010154600160a01b900460ff166105ff57604051631d240ff960e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205490565b60405162461bcd60e51b815260206004820152602160248201527f455243373231207075626c696320617070726f7665206e6f7420616c6c6f77656044820152601960fa1b60648201526084016105ab565b610675610cbd565b6106e485858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250869250610d17915050565b5050505050565b60405162461bcd60e51b815260206004820152602660248201527f455243373231207075626c6963207472616e7366657246726f6d206e6f7420616044820152651b1b1bddd95960d21b60648201526084016105ab565b61074a610cbd565b600b541561076b57604051636eade3f360e11b815260040160405180910390fd5b600b55565b60405162461bcd60e51b815260206004820152602a60248201527f455243373231207075626c696320736166655472616e7366657246726f6d206e6044820152691bdd08185b1b1bddd95960b21b60648201526084016105ab565b6000838152600260205260408120546001600160a01b031661080057604051631d240ff960e21b815260040160405180910390fd5b60006108128480519060200120610e29565b905060006108208285610e7c565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff16801561086c57506001600160a01b03811660009081526006602052604090205486145b925050505b9392505050565b610880610cbd565b600e61088d828483612472565b505050565b6000818152600260205260408120546001600160a01b0316806104df5760405162461bcd60e51b81526004016105ab906123f3565b60006001600160a01b0382166109315760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105ab565b506001600160a01b031660009081526003602052604090205490565b610955610cbd565b61095f6000610ea0565b565b610969610cbd565b6109a5828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610ef292505050565b5050565b6060600180546104f4906123b9565b60405162461bcd60e51b815260206004820152602b60248201527f455243373231207075626c696320736574417070726f76616c466f72416c6c2060448201526a1b9bdd08185b1b1bddd95960aa1b60648201526084016105ab565b600d5460ff16610a375760405163951b974f60e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000003e8600c5403610a795760405163d05cb60960e01b815260040160405180910390fd5b610aba83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250610f85915050565b5050600c805460010190555050565b610ad1610cbd565b600d805460ff19166001179055565b6060610aeb826110e0565b6000610af5611114565b90506000815111610b155760405180602001604052806000815250610871565b80610b1f84611123565b604051602001610b30929190612531565b6040516020818303038152906040529392505050565b610b4e610cbd565b600b5415801590610b605750600b5442115b15610b7e5760405163624b779560e01b815260040160405180910390fd5b610b8a8484848461122b565b50505050565b61088d83838360005b6000610ba68585856113be565b80519091508215610bd957610bd4610bbd82610892565b338360405180602001604052806000815250611496565b610bec565b610bec610be582610892565b33836114c9565b505050505050565b610bfc610cbd565b6001600160a01b038116610c615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ab565b610c6a81610ea0565b50565b60006001600160e01b031982166380ac58cd60e01b1480610c9e57506001600160e01b03198216635b5e139f60e01b145b806104df57506301ffc9a760e01b6001600160e01b03198316146104df565b600a546001600160a01b0316331461095f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ab565b815183518114610d3a5760405163512509d360e11b815260040160405180910390fd5b60005b818110156106e4576000858281518110610d5957610d59612560565b602002602001015190506000858381518110610d7757610d77612560565b602002602001015190508415610e07576000818152600260205260409020546001600160a01b031615610dbd57604051633fc613e760e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000003e8811080610de9575080155b15610e075760405163991b1d5960e01b815260040160405180910390fd5b6001600160a01b03909116600090815260096020526040902055600101610d3d565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000610e8b8585611665565b91509150610e98816116aa565b509392505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b81518110156109a5576000828281518110610f1257610f12612560565b6020908102919091018101516040805160608101825260008082526001600160a01b0393841682860181815283850183815291835260069096529290209051815592516001938401805492511515600160a01b026001600160a81b03199093169190931617179055919091019050610ef5565b600080610f928484611860565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1615610fd957604051630396ad9960e31b815260040160405180910390fd5b6001600160a01b0380821660008181526006602052604090206001015490911614611017576040516322c6337560e11b815260040160405180910390fd5b6001600160a01b038116600090815260096020526040812054908190036110435761104061190c565b90505b61104d33826119ec565b604080516060810182528281526001600160a01b0380851660208084018281526001858701818152600085815260069094528784209651875591519501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915183917f1e98ed4919fa421d4b871082794f2c63228dd0b5efb584e1a6131de3a7d26cb291a3949350505050565b6000818152600260205260409020546001600160a01b0316610c6a5760405162461bcd60e51b81526004016105ab906123f3565b6060600e80546104f4906123b9565b60608160000361114a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611174578061115e8161258c565b915061116d9050600a836125bb565b915061114e565b6000816001600160401b0381111561118e5761118e61201e565b6040519080825280601f01601f1916602001820160405280156111b8576020820181803683370190505b5090505b8415611223576111cd6001836125cf565b91506111da600a866125e2565b6111e59060306125f6565b60f81b8183815181106111fa576111fa612560565b60200101906001600160f81b031916908160001a90535061121c600a866125bb565b94506111bc565b949350505050565b82811461124b5760405163512509d360e11b815260040160405180910390fd5b60005b838110156106e457600085858381811061126a5761126a612560565b905060200201602081019061127f9190611ec9565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff166112c55760405163794ea60960e01b815260040160405180910390fd5b60008484848181106112d9576112d9612560565b90506020020160208101906112ee9190611ec9565b6001600160a01b0380841660008181526006602081815260408084205481516060810183528181528789168185018181526001838601818152838a5297909652848820925183555191909401805495511515600160a01b026001600160a81b031990961691909816179390931790955593519495509384917fcd66beec785ca42d0623b531cba30cb24eacae50d76d9301b6945341cbd5856591a450506001600160a01b03166000908152600660205260408120908155600190810180546001600160a81b03191690550161124e565b6040805160608101825260008082526020820181905291810191909152600061141e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250611860915050565b6001600160a01b0381811660009081526006602090815260409182902082516060810184528154815260019091015493841691810191909152600160a01b90920460ff16158015918301919091529192509061147d5791506108719050565b604051638baa579f60e01b815260040160405180910390fd5b6114a18484846114c9565b6114ad84848484611b2e565b610b8a5760405162461bcd60e51b81526004016105ab90612609565b826001600160a01b03166114dc82610892565b6001600160a01b0316146115405760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105ab565b6001600160a01b0382166115a25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ab565b6115ad600082611c2f565b6001600160a01b03831660009081526003602052604081208054600192906115d69084906125cf565b90915550506001600160a01b03821660009081526003602052604081208054600192906116049084906125f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600080825160410361169b5760208301516040840151606085015160001a61168f87828585611c9d565b945094505050506116a3565b506000905060025b9250929050565b60008160048111156116be576116be61265b565b036116c65750565b60018160048111156116da576116da61265b565b036117275760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ab565b600281600481111561173b5761173b61265b565b036117885760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ab565b600381600481111561179c5761179c61265b565b036117f45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ab565b60048160048111156118085761180861265b565b03610c6a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ab565b600081431161188257604051631391e11b60e21b815260040160405180910390fd5b606461188e83436125cf565b11156118ad576040516351cc51c760e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152824060348201819052906000906118f79060540160405160208183030381529060405280519060200120610e29565b90506119038186610e7c565b95945050505050565b6007546000908082036119325760405163aeb0cc9b60e01b815260040160405180910390fd5b600061193d82611d8a565b9050600061194b83836125e2565b60008181526008602052604081205491925081810361196b57508161196e565b50805b600061197b6001876125cf565b90508084146119cc57600081815260086020526040812054908190036119b15760008581526008602052604090208290556119ca565b6000858152600860205260408082208390558382528120555b505b600780549060006119dc83612671565b9091555091979650505050505050565b6001600160a01b038216611a425760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ab565b6000818152600260205260409020546001600160a01b031615611aa75760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ab565b6001600160a01b0382166000908152600360205260408120805460019290611ad09084906125f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b15611c2457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611b72903390899088908890600401612688565b6020604051808303816000875af1925050508015611bad575060408051601f3d908101601f19168201909252611baa918101906126c5565b60015b611c0a573d808015611bdb576040519150601f19603f3d011682016040523d82523d6000602084013e611be0565b606091505b508051600003611c025760405162461bcd60e51b81526004016105ab90612609565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611223565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c6482610892565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611cd45750600090506003611d81565b8460ff16601b14158015611cec57508460ff16601c14155b15611cfd5750600090506004611d81565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d51573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7a57600060019250925050611d81565b9150600090505b94509492505050565b6000333a434244611d9c6001846125cf565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018390526101200160408051601f19818403018152919052805160209091012092915050565b6001600160e01b031981168114610c6a57600080fd5b600060208284031215611e2657600080fd5b813561087181611dfe565b60005b83811015611e4c578181015183820152602001611e34565b50506000910152565b60008151808452611e6d816020860160208601611e31565b601f01601f19169290920160200192915050565b6020815260006108716020830184611e55565b600060208284031215611ea657600080fd5b5035919050565b80356001600160a01b0381168114611ec457600080fd5b919050565b600060208284031215611edb57600080fd5b61087182611ead565b60008060408385031215611ef757600080fd5b611f0083611ead565b946020939093013593505050565b60008083601f840112611f2057600080fd5b5081356001600160401b03811115611f3757600080fd5b6020830191508360208260051b85010111156116a357600080fd5b80358015158114611ec457600080fd5b600080600080600060608688031215611f7a57600080fd5b85356001600160401b0380821115611f9157600080fd5b611f9d89838a01611f0e565b90975095506020880135915080821115611fb657600080fd5b50611fc388828901611f0e565b9094509250611fd6905060408701611f52565b90509295509295909350565b600080600060608486031215611ff757600080fd5b61200084611ead565b925061200e60208501611ead565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261204557600080fd5b81356001600160401b038082111561205f5761205f61201e565b604051601f8301601f19908116603f011681019082821181831017156120875761208761201e565b816040528381528660208588010111156120a057600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156120d557600080fd5b8335925060208401356001600160401b03808211156120f357600080fd5b6120ff87838801612034565b9350604086013591508082111561211557600080fd5b5061212286828701612034565b9150509250925092565b60008083601f84011261213e57600080fd5b5081356001600160401b0381111561215557600080fd5b6020830191508360208285010111156116a357600080fd5b6000806020838503121561218057600080fd5b82356001600160401b0381111561219657600080fd5b6121a28582860161212c565b90969095509350505050565b600080602083850312156121c157600080fd5b82356001600160401b038111156121d757600080fd5b6121a285828601611f0e565b600080604083850312156121f657600080fd5b6121ff83611ead565b915061220d60208401611f52565b90509250929050565b60008060006040848603121561222b57600080fd5b83356001600160401b0381111561224157600080fd5b61224d8682870161212c565b909790965060209590950135949350505050565b6000806000806080858703121561227757600080fd5b61228085611ead565b935061228e60208601611ead565b92506040850135915060608501356001600160401b038111156122b057600080fd5b6122bc87828801612034565b91505092959194509250565b600080600080604085870312156122de57600080fd5b84356001600160401b03808211156122f557600080fd5b61230188838901611f0e565b9096509450602087013591508082111561231a57600080fd5b5061232787828801611f0e565b95989497509550505050565b6000806000806060858703121561234957600080fd5b84356001600160401b0381111561235f57600080fd5b61236b8782880161212c565b9095509350506020850135915061238460408601611f52565b905092959194509250565b600080604083850312156123a257600080fd5b6123ab83611ead565b915061220d60208401611ead565b600181811c908216806123cd57607f821691505b6020821081036123ed57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526018908201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604082015260600190565b601f82111561088d576000816000526020600020601f850160051c810160208610156124535750805b601f850160051c820191505b81811015610bec5782815560010161245f565b6001600160401b038311156124895761248961201e565b61249d8361249783546123b9565b8361242a565b6000601f8411600181146124d157600085156124b95750838201355b600019600387901b1c1916600186901b1783556106e4565b600083815260209020601f19861690835b8281101561250257868501358255602094850194600190920191016124e2565b508682101561251f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351612543818460208801611e31565b835190830190612557818360208801611e31565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161259e5761259e612576565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826125ca576125ca6125a5565b500490565b818103818111156104df576104df612576565b6000826125f1576125f16125a5565b500690565b808201808211156104df576104df612576565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60008161268057612680612576565b506000190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126bb90830184611e55565b9695505050505050565b6000602082840312156126d757600080fd5b815161087181611dfe56fea2646970667358221220a3067a7ca815476a7c3cfe04ce3d1b2ca8772b031572eca900d0f4fde866b7be64736f6c63430008160033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000094d696e644f66477573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d4f470000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): MindOfGus
Arg [1] : symbol_ (string): MOG
Arg [2] : maxSupply_ (uint256): 1000
Arg [3] : maxRandomTokenId_ (uint256): 1000

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [3] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [5] : 4d696e644f664775730000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 4d4f470000000000000000000000000000000000000000000000000000000000


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

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