ETH Price: $3,400.91 (+2.37%)

Contract

0xc20AE005e1340DaB2449304158f999bfDD1aaC1c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Token W...214469882024-12-20 23:22:353 days ago1734736955IN
0xc20AE005...fDD1aaC1c
0 ETH0.000482129.60000657
Mint Hoodie208481472024-09-28 9:10:2386 days ago1727514623IN
0xc20AE005...fDD1aaC1c
0 ETH0.0020119116.16424972
Transfer Token W...208245132024-09-25 2:02:3590 days ago1727229755IN
0xc20AE005...fDD1aaC1c
0 ETH0.0015366630.61020359
Transfer Token W...206816082024-09-05 3:10:11110 days ago1725505811IN
0xc20AE005...fDD1aaC1c
0 ETH0.0011405215.81844613
Transfer Token W...204746162024-08-07 5:30:59138 days ago1723008659IN
0xc20AE005...fDD1aaC1c
0 ETH0.000104992.09139416
Transfer Token W...204746082024-08-07 5:29:23138 days ago1723008563IN
0xc20AE005...fDD1aaC1c
0 ETH0.000151992.1084719
Transfer Token W...201734182024-06-26 4:17:23181 days ago1719375443IN
0xc20AE005...fDD1aaC1c
0 ETH0.000208213.09287435
Transfer Token W...201234222024-06-19 4:31:11188 days ago1718771471IN
0xc20AE005...fDD1aaC1c
0 ETH0.00019624.39920272
Transfer Token W...201180312024-06-18 10:24:35188 days ago1718706275IN
0xc20AE005...fDD1aaC1c
0 ETH0.000303444.50748723
Mint Hoodie198691652024-05-14 15:36:35223 days ago1715700995IN
0xc20AE005...fDD1aaC1c
0 ETH0.0010808910.06725972
Set Approval For...198170272024-05-07 8:34:47230 days ago1715070887IN
0xc20AE005...fDD1aaC1c
0 ETH0.000164817.44769613
Transfer Token W...197541122024-04-28 13:27:47239 days ago1714310867IN
0xc20AE005...fDD1aaC1c
0 ETH0.000455466.76756659
Transfer Token W...196367022024-04-12 2:59:35256 days ago1712890775IN
0xc20AE005...fDD1aaC1c
0 ETH0.0008140412.09205844
Transfer Token W...196360312024-04-12 0:44:35256 days ago1712882675IN
0xc20AE005...fDD1aaC1c
0 ETH0.0007259810.78714087
Mint Hoodie195900362024-04-05 14:08:35262 days ago1712326115IN
0xc20AE005...fDD1aaC1c
0 ETH0.0059843948.8195355
Mint Hoodie195355632024-03-28 22:41:59270 days ago1711665719IN
0xc20AE005...fDD1aaC1c
0 ETH0.0040842832.81997646
Transfer Token W...195130822024-03-25 17:51:47273 days ago1711389107IN
0xc20AE005...fDD1aaC1c
0 ETH0.0024718336.71718214
Mint Hoodie195075062024-03-24 22:57:59274 days ago1711321079IN
0xc20AE005...fDD1aaC1c
0 ETH0.0021182217.27835943
Mint Hoodie194929342024-03-22 21:47:47276 days ago1711144067IN
0xc20AE005...fDD1aaC1c
0 ETH0.0024835820.25530931
Transfer Token W...194923812024-03-22 19:55:35276 days ago1711137335IN
0xc20AE005...fDD1aaC1c
0 ETH0.0015453621.43331139
Transfer Token W...194474442024-03-16 12:25:59282 days ago1710591959IN
0xc20AE005...fDD1aaC1c
0 ETH0.0020328430.19635173
Mint Hoodie194367062024-03-15 0:12:23284 days ago1710461543IN
0xc20AE005...fDD1aaC1c
0 ETH0.0056320145.94034679
Transfer Token W...194218592024-03-12 22:03:11286 days ago1710280991IN
0xc20AE005...fDD1aaC1c
0 ETH0.0038084256.57114733
Transfer Token W...193887552024-03-08 6:47:23290 days ago1709880443IN
0xc20AE005...fDD1aaC1c
0 ETH0.0029385343.64966269
Transfer Token W...190875662024-01-26 1:40:35333 days ago1706233235IN
0xc20AE005...fDD1aaC1c
0 ETH0.0013018119.3431028
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AAHoodie

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 500 runs

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

import "@openzeppelin/contracts/access/Ownable.sol";
import "@chiru-labs/pbt/src/PBTRandom.sol";

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

contract AAHoodie is PBTRandom, Ownable {
    constructor(
        string memory name_,
        string memory symbol_,
        uint256 maxSupply_
    ) PBTRandom(name_, symbol_, 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 mintHoodie(
        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 virtual override returns (string memory) {
        return _baseTokenURI;
    }

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

import "./IPBT.sol";
import "./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();

/**
 * Implementation of PBT where all tokenIds are randomly chosen at mint time.
 */
contract PBTRandom is ERC721ReadOnly, IPBT {
    using ECDSA for bytes32;

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

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

    // Max token supply
    uint256 public immutable maxSupply;
    uint256 private _numAvailableRemainingTokens;

    // Data structure used for Fisher Yates shuffle
    mapping(uint256 => uint256) internal _availableRemainingTokens;

    constructor(string memory name_, string memory symbol_, uint256 maxSupply_) ERC721ReadOnly(name_, symbol_) {
        maxSupply = maxSupply_;
        _numAvailableRemainingTokens = maxSupply_;
    }

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

    // TODO: consider preventing multiple chip addresses mapping to the same tokenId (store a tokenId->chip mapping)
    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 = _useRandomAvailableTokenId();
        _mint(_msgSender(), tokenId);
        _tokenDatas[chipAddr] = TokenData(tokenId, chipAddr, true);

        emit PBTMint(tokenId, chipAddr);

        return tokenId;
    }

    // Generates a pseudorandom number between [0,maxSupply) 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 (_availableRemainingTokens) and track its length (_numAvailableRemainingTokens). 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 _availableRemainingTokens[x] == 0, that means x has not been generated yet
    //      - if _availableRemainingTokens[x] != 0, that means _availableRemainingTokens[x] has not been generated yet
    //  - when prompted for a random number between [0,maxSupply) that hasn't already been used:
    //    - generate a random index randIndex between [0,_numAvailableRemainingTokens)
    //    - examine the value at _availableRemainingTokens[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 _availableRemainingTokens[randIndex]
    //    - update the _availableRemainingTokens mapping state
    //        - set _availableRemainingTokens[randIndex] to either the index or the value of the last entry in the mapping (depends on the last entry's state)
    //        - decrement _numAvailableRemainingTokens to mimic the shrinking of an array
    function _useRandomAvailableTokenId() internal returns (uint256) {
        uint256 numAvailableRemainingTokens = _numAvailableRemainingTokens;
        if (numAvailableRemainingTokens == 0) {
            revert NoMoreTokenIds();
        }

        uint256 randomNum = _getRandomNum(numAvailableRemainingTokens);
        uint256 randomIndex = randomNum % numAvailableRemainingTokens;
        uint256 valAtIndex = _availableRemainingTokens[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 = _availableRemainingTokens[lastIndex];
            if (lastValInArray == 0) {
                // This means the index itself is still an available token
                _availableRemainingTokens[randomIndex] = lastIndex;
            } else {
                // This means the index itself is not an available token, but the val at that index is.
                _availableRemainingTokens[randomIndex] = lastValInArray;
                delete _availableRemainingTokens[lastIndex];
            }
        }

        _numAvailableRemainingTokens--;

        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.difficulty,
                    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 {
        _transferTokenWithChip(signatureFromChip, blockNumberUsedInSig, useSafeTransferFrom);
    }

    function _transferTokenWithChip(
        bytes calldata signatureFromChip,
        uint256 blockNumberUsedInSig,
        bool useSafeTransferFrom
    ) internal virtual {
        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 > getMaxBlockhashValidWindow()) {
            revert BlockNumberTooOld();
        }

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

    function getMaxBlockhashValidWindow() 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.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = 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 v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 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.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 13 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 14 of 15 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

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

File 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
{
  "optimizer": {
    "enabled": true,
    "runs": 500
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "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"}],"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":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MintNotOpen","type":"error"},{"inputs":[],"name":"NoMintedTokenForChip","type":"error"},{"inputs":[],"name":"NoMoreTokenIds","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":[{"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":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxBlockhashValidWindow","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":"mintHoodie","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":"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"}]

60a06040523480156200001157600080fd5b5060405162002b3638038062002b36833981016040819052620000349162000193565b82828282828181600062000049838262000295565b50600162000058828262000295565b5050506080839052505060075550620000739050336200007c565b50505062000361565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000f657600080fd5b81516001600160401b0380821115620001135762000113620000ce565b604051601f8301601f19908116603f011681019082821181831017156200013e576200013e620000ce565b816040528381526020925086838588010111156200015b57600080fd5b600091505b838210156200017f578582018301518183018401529082019062000160565b600093810190920192909252949350505050565b600080600060608486031215620001a957600080fd5b83516001600160401b0380821115620001c157600080fd5b620001cf87838801620000e4565b94506020860151915080821115620001e657600080fd5b50620001f586828701620000e4565b925050604084015190509250925092565b600181811c908216806200021b57607f821691505b6020821081036200023c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200029057600081815260208120601f850160051c810160208610156200026b5750805b601f850160051c820191505b818110156200028c5782815560010162000277565b5050505b505050565b81516001600160401b03811115620002b157620002b1620000ce565b620002c981620002c2845462000206565b8462000242565b602080601f831160018114620003015760008415620002e85750858301515b600019600386901b1c1916600185901b1785556200028c565b600085815260208120601f198616915b82811015620003325788860151825594840194600190910190840162000311565b5085821015620003515787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516127b262000384600039600081816103ce015261052101526127b26000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c8063797f6f621161010f578063beb9716d116100a2578063d67d13ad11610071578063d67d13ad146103f0578063dcf960ee14610403578063e985e9c514610416578063f2fde38b1461042c57600080fd5b8063beb9716d14610396578063c87b56dd146103a3578063d30d520c146103b6578063d5abeb01146103c957600080fd5b8063a22cb465116100de578063a22cb46514610366578063b88d4fde14610379578063ba70316f14610387578063bce6d6721461038e57600080fd5b8063797f6f62146103315780637fd5e831146103445780638da5cb5b1461034d57806395d89b411461035e57600080fd5b806323b872dd1161018757806355f804b31161015657806355f804b3146102f05780636352211e1461030357806370a0823114610316578063715018a61461032957600080fd5b806323b872dd146102a457806329760b40146102b757806342842e0e146102ca5780634b5f42ea146102dd57600080fd5b8063081812fc116101c3578063081812fc1461023c57806308daee3614610267578063095ea7b31461028857806318160ddd1461029b57600080fd5b806301ffc9a7146101ea57806306fdde031461021257806307fbbc7d14610227575b600080fd5b6101fd6101f8366004611f8f565b61043f565b60405190151581526020015b60405180910390f35b61021a61046a565b6040516102099190611ffc565b61023a610235366004612051565b6104fc565b005b61024f61024a36600461209d565b6105b1565b6040516001600160a01b039091168152602001610209565b61027a6102753660046120d2565b610622565b604051908152602001610209565b61023a6102963660046120ed565b610681565b61027a600b5481565b61023a6102b2366004612117565b6106d3565b61023a6102c536600461209d565b61072a565b61023a6102d8366004612117565b610798565b6101fd6102eb3660046121f6565b6107f3565b61023a6102fe366004612263565b6108dd565b61024f61031136600461209d565b610937565b61027a6103243660046120d2565b6109ae565b61023a610a35565b61023a61033f3660046122ea565b610a89565b61027a600a5481565b6009546001600160a01b031661024f565b61021a610b11565b61023a610374366004612330565b610b20565b61023a6102d8366004612363565b606461027a565b61023a610b7c565b600c546101fd9060ff1681565b61021a6103b136600461209d565b610bd3565b61023a6103c43660046123cb565b610cbb565b61027a7f000000000000000000000000000000000000000000000000000000000000000081565b61023a6103fe366004612051565b610d45565b61023a610411366004612437565b610d4e565b6101fd610424366004612494565b600092915050565b61023a61043a3660046120d2565b610d5a565b60006001600160e01b03198216634901df9f60e01b1480610464575061046482610e13565b92915050565b606060008054610479906124be565b80601f01602080910402602001604051908101604052809291908181526020018280546104a5906124be565b80156104f25780601f106104c7576101008083540402835291602001916104f2565b820191906000526020600020905b8154815290600101906020018083116104d557829003601f168201915b5050505050905090565b600c5460ff1661051f5760405163951b974f60e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000600b54036105615760405163d05cb60960e01b815260040160405180910390fd5b6105a283838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250610e63915050565b5050600b805460010190555050565b6000818152600260205260408120546001600160a01b031661061a5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064015b60405180910390fd5b506000919050565b6001600160a01b038116600090815260066020526040812060010154600160a01b900460ff1661066557604051631d240ff960e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205490565b60405162461bcd60e51b815260206004820152602160248201527f455243373231207075626c696320617070726f7665206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610611565b60405162461bcd60e51b815260206004820152602660248201527f455243373231207075626c6963207472616e7366657246726f6d206e6f7420616044820152651b1b1bddd95960d21b6064820152608401610611565b6009546001600160a01b031633146107725760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600a541561079357604051636eade3f360e11b815260040160405180910390fd5b600a55565b60405162461bcd60e51b815260206004820152602a60248201527f455243373231207075626c696320736166655472616e7366657246726f6d206e6044820152691bdd08185b1b1bddd95960b21b6064820152608401610611565b6000838152600260205260408120546001600160a01b031661082857604051631d240ff960e21b815260040160405180910390fd5b8251602080850191909120604080517f19457468657265756d205369676e6564204d6573736167653a0a33320000000081850152603c8082019390935281518082039093018352605c019052805191012060006108858285610f9e565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1680156108d157506001600160a01b03811660009081526006602052604090205486145b925050505b9392505050565b6009546001600160a01b031633146109255760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600d61093282848361253e565b505050565b6000818152600260205260408120546001600160a01b0316806104645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610611565b60006001600160a01b038216610a195760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610611565b506001600160a01b031660009081526003602052604090205490565b6009546001600160a01b03163314610a7d5760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b610a876000610fc2565b565b6009546001600160a01b03163314610ad15760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b610b0d82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061101492505050565b5050565b606060018054610479906124be565b60405162461bcd60e51b815260206004820152602b60248201527f455243373231207075626c696320736574417070726f76616c466f72416c6c2060448201526a1b9bdd08185b1b1bddd95960aa1b6064820152608401610611565b6009546001600160a01b03163314610bc45760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600c805460ff19166001179055565b6000818152600260205260409020546060906001600160a01b0316610c605760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610611565b6000610c6a6110b4565b90506000815111610c8a57604051806020016040528060008152506108d6565b80610c94846110c3565b604051602001610ca59291906125fe565b6040516020818303038152906040529392505050565b6009546001600160a01b03163314610d035760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600a5415801590610d155750600a5442115b15610d335760405163624b779560e01b815260040160405180910390fd5b610d3f848484846111e4565b50505050565b61093283838360005b610d3f84848484611388565b6009546001600160a01b03163314610da25760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b6001600160a01b038116610e075760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b610e1081610fc2565b50565b60006001600160e01b031982166380ac58cd60e01b1480610e4457506001600160e01b03198216635b5e139f60e01b145b8061046457506301ffc9a760e01b6001600160e01b0319831614610464565b600080610e7084846113e3565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1615610eb757604051630396ad9960e31b815260040160405180910390fd5b6001600160a01b0380821660008181526006602052604090206001015490911614610ef5576040516322c6337560e11b815260040160405180910390fd5b6000610eff6114d4565b9050610f0b33826115b4565b604080516060810182528281526001600160a01b0380851660208084018281526001858701818152600085815260069094528784209651875591519501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915183917f1e98ed4919fa421d4b871082794f2c63228dd0b5efb584e1a6131de3a7d26cb291a3949350505050565b6000806000610fad85856116f6565b91509150610fba81611764565b509392505050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b8151811015610b0d5760008282815181106110345761103461262d565b6020908102919091018101516040805160608101825260008082526001600160a01b039384168286018181528385018381529183526006909652929020905181559251600193909301805491511515600160a01b026001600160a81b03199092169390921692909217919091179055506110ad81612659565b9050611017565b6060600d8054610479906124be565b6060816000036110ea5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561111457806110fe81612659565b915061110d9050600a83612688565b91506110ee565b60008167ffffffffffffffff81111561112f5761112f612153565b6040519080825280601f01601f191660200182016040528015611159576020820181803683370190505b5090505b84156111dc5761116e60018361269c565b915061117b600a866126af565b6111869060306126c3565b60f81b81838151811061119b5761119b61262d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506111d5600a86612688565b945061115d565b949350505050565b8281146112045760405163512509d360e11b815260040160405180910390fd5b60005b838110156113815760008585838181106112235761122361262d565b905060200201602081019061123891906120d2565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1661127e5760405163794ea60960e01b815260040160405180910390fd5b60008484848181106112925761129261262d565b90506020020160208101906112a791906120d2565b6001600160a01b0380841660008181526006602081815260408084205481516060810183528181528789168185018181526001838601818152838a5297909652848820925183555191909401805495511515600160a01b026001600160a81b031990961691909816179390931790955593519495509384917fcd66beec785ca42d0623b531cba30cb24eacae50d76d9301b6945341cbd5856591a450506001600160a01b0316600090815260066020526040812090815560010180546001600160a81b03191690558061137981612659565b915050611207565b5050505050565b600061139585858561191a565b805190915082156113c8576113c36113ac82610937565b3383604051806020016040528060008152506119f2565b6113db565b6113db6113d482610937565b3383611a70565b505050505050565b600081431161140557604051631391e11b60e21b815260040160405180910390fd5b6064611411834361269c565b1115611430576040516351cc51c760e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152824060348201819052906000906114bf9060540160408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b90506114cb8186610f9e565b95945050505050565b6007546000908082036114fa5760405163aeb0cc9b60e01b815260040160405180910390fd5b600061150582611c0c565b9050600061151383836126af565b600081815260086020526040812054919250818103611533575081611536565b50805b600061154360018761269c565b90508084146115945760008181526008602052604081205490819003611579576000858152600860205260409020829055611592565b6000858152600860205260408082208390558382528120555b505b600780549060006115a4836126d6565b9091555091979650505050505050565b6001600160a01b03821661160a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610611565b6000818152600260205260409020546001600160a01b03161561166f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610611565b6001600160a01b03821660009081526003602052604081208054600192906116989084906126c3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600080825160410361172c5760208301516040840151606085015160001a61172087828585611c80565b9450945050505061175d565b8251604003611755576020830151604084015161174a868383611d6d565b93509350505061175d565b506000905060025b9250929050565b6000816004811115611778576117786126ed565b036117805750565b6001816004811115611794576117946126ed565b036117e15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610611565b60028160048111156117f5576117f56126ed565b036118425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610611565b6003816004811115611856576118566126ed565b036118ae5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610611565b60048160048111156118c2576118c26126ed565b03610e105760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610611565b6040805160608101825260008082526020820181905291810191909152600061197a85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508792506113e3915050565b6001600160a01b0381811660009081526006602090815260409182902082516060810184528154815260019091015493841691810191909152600160a01b90920460ff1615801591830191909152919250906119d95791506108d69050565b604051638baa579f60e01b815260040160405180910390fd5b6119fd848484611a70565b611a0984848484611dbf565b610d3f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610611565b826001600160a01b0316611a8382610937565b6001600160a01b031614611ae75760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610611565b6001600160a01b038216611b495760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b611b54600082611f0b565b6001600160a01b0383166000908152600360205260408120805460019290611b7d90849061269c565b90915550506001600160a01b0382166000908152600360205260408120805460019290611bab9084906126c3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000333a434244611c1e60018461269c565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018390526101200160408051601f19818403018152919052805160209091012092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611cb75750600090506003611d64565b8460ff16601b14158015611ccf57508460ff16601c14155b15611ce05750600090506004611d64565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d34573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d5d57600060019250925050611d64565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681611da360ff86901c601b6126c3565b9050611db187828885611c80565b935093505050935093915050565b60006001600160a01b0384163b15611f0057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611e03903390899088908890600401612703565b6020604051808303816000875af1925050508015611e3e575060408051601f3d908101601f19168201909252611e3b9181019061273f565b60015b611ee6573d808015611e6c576040519150601f19603f3d011682016040523d82523d6000602084013e611e71565b606091505b508051600003611ede5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610611565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506111dc565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611f4082610937565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160e01b031981168114610e1057600080fd5b600060208284031215611fa157600080fd5b81356108d681611f79565b60005b83811015611fc7578181015183820152602001611faf565b50506000910152565b60008151808452611fe8816020860160208601611fac565b601f01601f19169290920160200192915050565b6020815260006108d66020830184611fd0565b60008083601f84011261202157600080fd5b50813567ffffffffffffffff81111561203957600080fd5b60208301915083602082850101111561175d57600080fd5b60008060006040848603121561206657600080fd5b833567ffffffffffffffff81111561207d57600080fd5b6120898682870161200f565b909790965060209590950135949350505050565b6000602082840312156120af57600080fd5b5035919050565b80356001600160a01b03811681146120cd57600080fd5b919050565b6000602082840312156120e457600080fd5b6108d6826120b6565b6000806040838503121561210057600080fd5b612109836120b6565b946020939093013593505050565b60008060006060848603121561212c57600080fd5b612135846120b6565b9250612143602085016120b6565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261217a57600080fd5b813567ffffffffffffffff8082111561219557612195612153565b604051601f8301601f19908116603f011681019082821181831017156121bd576121bd612153565b816040528381528660208588010111156121d657600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561220b57600080fd5b83359250602084013567ffffffffffffffff8082111561222a57600080fd5b61223687838801612169565b9350604086013591508082111561224c57600080fd5b5061225986828701612169565b9150509250925092565b6000806020838503121561227657600080fd5b823567ffffffffffffffff81111561228d57600080fd5b6122998582860161200f565b90969095509350505050565b60008083601f8401126122b757600080fd5b50813567ffffffffffffffff8111156122cf57600080fd5b6020830191508360208260051b850101111561175d57600080fd5b600080602083850312156122fd57600080fd5b823567ffffffffffffffff81111561231457600080fd5b612299858286016122a5565b803580151581146120cd57600080fd5b6000806040838503121561234357600080fd5b61234c836120b6565b915061235a60208401612320565b90509250929050565b6000806000806080858703121561237957600080fd5b612382856120b6565b9350612390602086016120b6565b925060408501359150606085013567ffffffffffffffff8111156123b357600080fd5b6123bf87828801612169565b91505092959194509250565b600080600080604085870312156123e157600080fd5b843567ffffffffffffffff808211156123f957600080fd5b612405888389016122a5565b9096509450602087013591508082111561241e57600080fd5b5061242b878288016122a5565b95989497509550505050565b6000806000806060858703121561244d57600080fd5b843567ffffffffffffffff81111561246457600080fd5b6124708782880161200f565b9095509350506020850135915061248960408601612320565b905092959194509250565b600080604083850312156124a757600080fd5b6124b0836120b6565b915061235a602084016120b6565b600181811c908216806124d257607f821691505b6020821081036124f257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561093257600081815260208120601f850160051c8101602086101561251f5750805b601f850160051c820191505b818110156113db5782815560010161252b565b67ffffffffffffffff83111561255657612556612153565b61256a8361256483546124be565b836124f8565b6000601f84116001811461259e57600085156125865750838201355b600019600387901b1c1916600186901b178355611381565b600083815260209020601f19861690835b828110156125cf57868501358255602094850194600190920191016125af565b50868210156125ec5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351612610818460208801611fac565b835190830190612624818360208801611fac565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161266b5761266b612643565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261269757612697612672565b500490565b8181038181111561046457610464612643565b6000826126be576126be612672565b500690565b8082018082111561046457610464612643565b6000816126e5576126e5612643565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60006001600160a01b038087168352808616602084015250836040830152608060608301526127356080830184611fd0565b9695505050505050565b60006020828403121561275157600080fd5b81516108d681611f7956fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220e699e90b554d719c36ef6311953c986bbac64f99bee10b05e2a94baff0bd1f7464736f6c63430008100033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000000084141486f6f64696500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084141484f4f444945000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063797f6f621161010f578063beb9716d116100a2578063d67d13ad11610071578063d67d13ad146103f0578063dcf960ee14610403578063e985e9c514610416578063f2fde38b1461042c57600080fd5b8063beb9716d14610396578063c87b56dd146103a3578063d30d520c146103b6578063d5abeb01146103c957600080fd5b8063a22cb465116100de578063a22cb46514610366578063b88d4fde14610379578063ba70316f14610387578063bce6d6721461038e57600080fd5b8063797f6f62146103315780637fd5e831146103445780638da5cb5b1461034d57806395d89b411461035e57600080fd5b806323b872dd1161018757806355f804b31161015657806355f804b3146102f05780636352211e1461030357806370a0823114610316578063715018a61461032957600080fd5b806323b872dd146102a457806329760b40146102b757806342842e0e146102ca5780634b5f42ea146102dd57600080fd5b8063081812fc116101c3578063081812fc1461023c57806308daee3614610267578063095ea7b31461028857806318160ddd1461029b57600080fd5b806301ffc9a7146101ea57806306fdde031461021257806307fbbc7d14610227575b600080fd5b6101fd6101f8366004611f8f565b61043f565b60405190151581526020015b60405180910390f35b61021a61046a565b6040516102099190611ffc565b61023a610235366004612051565b6104fc565b005b61024f61024a36600461209d565b6105b1565b6040516001600160a01b039091168152602001610209565b61027a6102753660046120d2565b610622565b604051908152602001610209565b61023a6102963660046120ed565b610681565b61027a600b5481565b61023a6102b2366004612117565b6106d3565b61023a6102c536600461209d565b61072a565b61023a6102d8366004612117565b610798565b6101fd6102eb3660046121f6565b6107f3565b61023a6102fe366004612263565b6108dd565b61024f61031136600461209d565b610937565b61027a6103243660046120d2565b6109ae565b61023a610a35565b61023a61033f3660046122ea565b610a89565b61027a600a5481565b6009546001600160a01b031661024f565b61021a610b11565b61023a610374366004612330565b610b20565b61023a6102d8366004612363565b606461027a565b61023a610b7c565b600c546101fd9060ff1681565b61021a6103b136600461209d565b610bd3565b61023a6103c43660046123cb565b610cbb565b61027a7f00000000000000000000000000000000000000000000000000000000000004b081565b61023a6103fe366004612051565b610d45565b61023a610411366004612437565b610d4e565b6101fd610424366004612494565b600092915050565b61023a61043a3660046120d2565b610d5a565b60006001600160e01b03198216634901df9f60e01b1480610464575061046482610e13565b92915050565b606060008054610479906124be565b80601f01602080910402602001604051908101604052809291908181526020018280546104a5906124be565b80156104f25780601f106104c7576101008083540402835291602001916104f2565b820191906000526020600020905b8154815290600101906020018083116104d557829003601f168201915b5050505050905090565b600c5460ff1661051f5760405163951b974f60e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000004b0600b54036105615760405163d05cb60960e01b815260040160405180910390fd5b6105a283838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250610e63915050565b5050600b805460010190555050565b6000818152600260205260408120546001600160a01b031661061a5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064015b60405180910390fd5b506000919050565b6001600160a01b038116600090815260066020526040812060010154600160a01b900460ff1661066557604051631d240ff960e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205490565b60405162461bcd60e51b815260206004820152602160248201527f455243373231207075626c696320617070726f7665206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610611565b60405162461bcd60e51b815260206004820152602660248201527f455243373231207075626c6963207472616e7366657246726f6d206e6f7420616044820152651b1b1bddd95960d21b6064820152608401610611565b6009546001600160a01b031633146107725760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600a541561079357604051636eade3f360e11b815260040160405180910390fd5b600a55565b60405162461bcd60e51b815260206004820152602a60248201527f455243373231207075626c696320736166655472616e7366657246726f6d206e6044820152691bdd08185b1b1bddd95960b21b6064820152608401610611565b6000838152600260205260408120546001600160a01b031661082857604051631d240ff960e21b815260040160405180910390fd5b8251602080850191909120604080517f19457468657265756d205369676e6564204d6573736167653a0a33320000000081850152603c8082019390935281518082039093018352605c019052805191012060006108858285610f9e565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1680156108d157506001600160a01b03811660009081526006602052604090205486145b925050505b9392505050565b6009546001600160a01b031633146109255760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600d61093282848361253e565b505050565b6000818152600260205260408120546001600160a01b0316806104645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610611565b60006001600160a01b038216610a195760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610611565b506001600160a01b031660009081526003602052604090205490565b6009546001600160a01b03163314610a7d5760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b610a876000610fc2565b565b6009546001600160a01b03163314610ad15760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b610b0d82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061101492505050565b5050565b606060018054610479906124be565b60405162461bcd60e51b815260206004820152602b60248201527f455243373231207075626c696320736574417070726f76616c466f72416c6c2060448201526a1b9bdd08185b1b1bddd95960aa1b6064820152608401610611565b6009546001600160a01b03163314610bc45760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600c805460ff19166001179055565b6000818152600260205260409020546060906001600160a01b0316610c605760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610611565b6000610c6a6110b4565b90506000815111610c8a57604051806020016040528060008152506108d6565b80610c94846110c3565b604051602001610ca59291906125fe565b6040516020818303038152906040529392505050565b6009546001600160a01b03163314610d035760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b600a5415801590610d155750600a5442115b15610d335760405163624b779560e01b815260040160405180910390fd5b610d3f848484846111e4565b50505050565b61093283838360005b610d3f84848484611388565b6009546001600160a01b03163314610da25760405162461bcd60e51b8152602060048201819052602482015260008051602061275d8339815191526044820152606401610611565b6001600160a01b038116610e075760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b610e1081610fc2565b50565b60006001600160e01b031982166380ac58cd60e01b1480610e4457506001600160e01b03198216635b5e139f60e01b145b8061046457506301ffc9a760e01b6001600160e01b0319831614610464565b600080610e7084846113e3565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1615610eb757604051630396ad9960e31b815260040160405180910390fd5b6001600160a01b0380821660008181526006602052604090206001015490911614610ef5576040516322c6337560e11b815260040160405180910390fd5b6000610eff6114d4565b9050610f0b33826115b4565b604080516060810182528281526001600160a01b0380851660208084018281526001858701818152600085815260069094528784209651875591519501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915183917f1e98ed4919fa421d4b871082794f2c63228dd0b5efb584e1a6131de3a7d26cb291a3949350505050565b6000806000610fad85856116f6565b91509150610fba81611764565b509392505050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b8151811015610b0d5760008282815181106110345761103461262d565b6020908102919091018101516040805160608101825260008082526001600160a01b039384168286018181528385018381529183526006909652929020905181559251600193909301805491511515600160a01b026001600160a81b03199092169390921692909217919091179055506110ad81612659565b9050611017565b6060600d8054610479906124be565b6060816000036110ea5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561111457806110fe81612659565b915061110d9050600a83612688565b91506110ee565b60008167ffffffffffffffff81111561112f5761112f612153565b6040519080825280601f01601f191660200182016040528015611159576020820181803683370190505b5090505b84156111dc5761116e60018361269c565b915061117b600a866126af565b6111869060306126c3565b60f81b81838151811061119b5761119b61262d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506111d5600a86612688565b945061115d565b949350505050565b8281146112045760405163512509d360e11b815260040160405180910390fd5b60005b838110156113815760008585838181106112235761122361262d565b905060200201602081019061123891906120d2565b6001600160a01b038116600090815260066020526040902060010154909150600160a01b900460ff1661127e5760405163794ea60960e01b815260040160405180910390fd5b60008484848181106112925761129261262d565b90506020020160208101906112a791906120d2565b6001600160a01b0380841660008181526006602081815260408084205481516060810183528181528789168185018181526001838601818152838a5297909652848820925183555191909401805495511515600160a01b026001600160a81b031990961691909816179390931790955593519495509384917fcd66beec785ca42d0623b531cba30cb24eacae50d76d9301b6945341cbd5856591a450506001600160a01b0316600090815260066020526040812090815560010180546001600160a81b03191690558061137981612659565b915050611207565b5050505050565b600061139585858561191a565b805190915082156113c8576113c36113ac82610937565b3383604051806020016040528060008152506119f2565b6113db565b6113db6113d482610937565b3383611a70565b505050505050565b600081431161140557604051631391e11b60e21b815260040160405180910390fd5b6064611411834361269c565b1115611430576040516351cc51c760e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152824060348201819052906000906114bf9060540160408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b90506114cb8186610f9e565b95945050505050565b6007546000908082036114fa5760405163aeb0cc9b60e01b815260040160405180910390fd5b600061150582611c0c565b9050600061151383836126af565b600081815260086020526040812054919250818103611533575081611536565b50805b600061154360018761269c565b90508084146115945760008181526008602052604081205490819003611579576000858152600860205260409020829055611592565b6000858152600860205260408082208390558382528120555b505b600780549060006115a4836126d6565b9091555091979650505050505050565b6001600160a01b03821661160a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610611565b6000818152600260205260409020546001600160a01b03161561166f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610611565b6001600160a01b03821660009081526003602052604081208054600192906116989084906126c3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600080825160410361172c5760208301516040840151606085015160001a61172087828585611c80565b9450945050505061175d565b8251604003611755576020830151604084015161174a868383611d6d565b93509350505061175d565b506000905060025b9250929050565b6000816004811115611778576117786126ed565b036117805750565b6001816004811115611794576117946126ed565b036117e15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610611565b60028160048111156117f5576117f56126ed565b036118425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610611565b6003816004811115611856576118566126ed565b036118ae5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610611565b60048160048111156118c2576118c26126ed565b03610e105760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610611565b6040805160608101825260008082526020820181905291810191909152600061197a85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508792506113e3915050565b6001600160a01b0381811660009081526006602090815260409182902082516060810184528154815260019091015493841691810191909152600160a01b90920460ff1615801591830191909152919250906119d95791506108d69050565b604051638baa579f60e01b815260040160405180910390fd5b6119fd848484611a70565b611a0984848484611dbf565b610d3f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610611565b826001600160a01b0316611a8382610937565b6001600160a01b031614611ae75760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610611565b6001600160a01b038216611b495760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b611b54600082611f0b565b6001600160a01b0383166000908152600360205260408120805460019290611b7d90849061269c565b90915550506001600160a01b0382166000908152600360205260408120805460019290611bab9084906126c3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000333a434244611c1e60018461269c565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018390526101200160408051601f19818403018152919052805160209091012092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611cb75750600090506003611d64565b8460ff16601b14158015611ccf57508460ff16601c14155b15611ce05750600090506004611d64565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d34573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d5d57600060019250925050611d64565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681611da360ff86901c601b6126c3565b9050611db187828885611c80565b935093505050935093915050565b60006001600160a01b0384163b15611f0057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611e03903390899088908890600401612703565b6020604051808303816000875af1925050508015611e3e575060408051601f3d908101601f19168201909252611e3b9181019061273f565b60015b611ee6573d808015611e6c576040519150601f19603f3d011682016040523d82523d6000602084013e611e71565b606091505b508051600003611ede5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610611565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506111dc565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611f4082610937565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160e01b031981168114610e1057600080fd5b600060208284031215611fa157600080fd5b81356108d681611f79565b60005b83811015611fc7578181015183820152602001611faf565b50506000910152565b60008151808452611fe8816020860160208601611fac565b601f01601f19169290920160200192915050565b6020815260006108d66020830184611fd0565b60008083601f84011261202157600080fd5b50813567ffffffffffffffff81111561203957600080fd5b60208301915083602082850101111561175d57600080fd5b60008060006040848603121561206657600080fd5b833567ffffffffffffffff81111561207d57600080fd5b6120898682870161200f565b909790965060209590950135949350505050565b6000602082840312156120af57600080fd5b5035919050565b80356001600160a01b03811681146120cd57600080fd5b919050565b6000602082840312156120e457600080fd5b6108d6826120b6565b6000806040838503121561210057600080fd5b612109836120b6565b946020939093013593505050565b60008060006060848603121561212c57600080fd5b612135846120b6565b9250612143602085016120b6565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261217a57600080fd5b813567ffffffffffffffff8082111561219557612195612153565b604051601f8301601f19908116603f011681019082821181831017156121bd576121bd612153565b816040528381528660208588010111156121d657600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561220b57600080fd5b83359250602084013567ffffffffffffffff8082111561222a57600080fd5b61223687838801612169565b9350604086013591508082111561224c57600080fd5b5061225986828701612169565b9150509250925092565b6000806020838503121561227657600080fd5b823567ffffffffffffffff81111561228d57600080fd5b6122998582860161200f565b90969095509350505050565b60008083601f8401126122b757600080fd5b50813567ffffffffffffffff8111156122cf57600080fd5b6020830191508360208260051b850101111561175d57600080fd5b600080602083850312156122fd57600080fd5b823567ffffffffffffffff81111561231457600080fd5b612299858286016122a5565b803580151581146120cd57600080fd5b6000806040838503121561234357600080fd5b61234c836120b6565b915061235a60208401612320565b90509250929050565b6000806000806080858703121561237957600080fd5b612382856120b6565b9350612390602086016120b6565b925060408501359150606085013567ffffffffffffffff8111156123b357600080fd5b6123bf87828801612169565b91505092959194509250565b600080600080604085870312156123e157600080fd5b843567ffffffffffffffff808211156123f957600080fd5b612405888389016122a5565b9096509450602087013591508082111561241e57600080fd5b5061242b878288016122a5565b95989497509550505050565b6000806000806060858703121561244d57600080fd5b843567ffffffffffffffff81111561246457600080fd5b6124708782880161200f565b9095509350506020850135915061248960408601612320565b905092959194509250565b600080604083850312156124a757600080fd5b6124b0836120b6565b915061235a602084016120b6565b600181811c908216806124d257607f821691505b6020821081036124f257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561093257600081815260208120601f850160051c8101602086101561251f5750805b601f850160051c820191505b818110156113db5782815560010161252b565b67ffffffffffffffff83111561255657612556612153565b61256a8361256483546124be565b836124f8565b6000601f84116001811461259e57600085156125865750838201355b600019600387901b1c1916600186901b178355611381565b600083815260209020601f19861690835b828110156125cf57868501358255602094850194600190920191016125af565b50868210156125ec5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351612610818460208801611fac565b835190830190612624818360208801611fac565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161266b5761266b612643565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261269757612697612672565b500490565b8181038181111561046457610464612643565b6000826126be576126be612672565b500690565b8082018082111561046457610464612643565b6000816126e5576126e5612643565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60006001600160a01b038087168352808616602084015250836040830152608060608301526127356080830184611fd0565b9695505050505050565b60006020828403121561275157600080fd5b81516108d681611f7956fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220e699e90b554d719c36ef6311953c986bbac64f99bee10b05e2a94baff0bd1f7464736f6c63430008100033

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

000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000000084141486f6f64696500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084141484f4f444945000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): AAHoodie
Arg [1] : symbol_ (string): AAHOODIE
Arg [2] : maxSupply_ (uint256): 1200

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000004b0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 4141486f6f646965000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [6] : 4141484f4f444945000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.