ETH Price: $3,084.13 (-0.94%)

Token

The Art of Seasons (TAOS)
 

Overview

Max Total Supply

7,237 TAOS

Holders

2,925

Market

Volume (24H)

1.3706 ETH

Min Price (24H)

$31.15 @ 0.010100 ETH

Max Price (24H)

$832.71 @ 0.270000 ETH

Other Info

Balance
0 TAOS
0x5f20abebe0ba11a9dc0f08e654e416bbee8979f9
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

The Art of Seasons is a complete collection of dynamic illustrations featuring Spring, Summer, Autumn and Winter by artist DirtyRobot + RENGA Factory. You own art that acts as a gateway passport giving you advanced access to exclusive art.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
TheArtOfSeasons

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 14 : TheArtOfSeasons.sol
// SPDX-License-Identifier: MIT
// Creator: Christopher Mikel Shelton

pragma solidity ^0.8.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./ERC721SZNS.sol";

error SummerTokensClaimClosed();
error SeasonsMintClosed();
error NoContractMints();
error MaxMintExceeded();
error InvalidSignature();
error NotEnoughEth();
error InncorrectLengths();
error BaseURILocked();
error RoyaltyInfoForNonexistentToken();
error TransferFailed();

contract TheArtOfSeasons is Ownable, ERC721SZNS, IERC2981 {
    using ECDSA for bytes32;

    event PermanentURI(string _value, uint256 indexed _id);
    
    // the largest possible token id from the summer season
    uint256 public constant SUMMER_MAX_TOKEN_ID = 8564;
    uint256 public constant MAX_SEASONS_COUNT = 6304;
    uint256 public constant CLAIMER_MINT_PRICE = 0.04 ether;
    uint256 public constant MINT_PRICE = 0.08 ether;
    uint256 public constant MAX_MINT_DURING_CLAIM = 2;
    uint256 public constant MAX_MINT_PER_TX = 8;

    bool public summerTokensClaimable;
    bool public seasonsMintOpen;

    address public sigSigner = 0x68cBE370A1b35f3f185172c063BBbabF836d7Ecc;

    address public royaltyAddress;
    uint256 public royaltyPercent;

    string private _baseTokenURI;
    bool public locked;

    constructor() ERC721SZNS("The Art of Seasons", "TAOS", SUMMER_MAX_TOKEN_ID) {
        royaltyAddress = owner();
        royaltyPercent = 5;
    }

    function mintSeason(uint256 quantity) external payable {
        if (!seasonsMintOpen) revert SeasonsMintClosed();
        if (quantity > MAX_MINT_PER_TX) revert MaxMintExceeded();
        if (tx.origin != msg.sender) revert NoContractMints();
        if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();

        _mint(msg.sender, quantity);
        _refundOverPayment(MINT_PRICE * quantity);
    }

    function mintForSummerHolder(bytes calldata ticketSignature, uint256 ticket, uint256 quantity) external payable {
        if (!summerTokensClaimable) revert SummerTokensClaimClosed();
        if (quantity > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
        if (tx.origin != msg.sender) revert NoContractMints();
        if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();

        _claimSummerMintTicket(ticketSignature, ticket, quantity);
        _mint(msg.sender, quantity);
        _refundOverPayment(CLAIMER_MINT_PRICE * quantity);
    }

    function claimSummer(
        bytes calldata claimSignature,
        uint256[] calldata tokens,
        uint256[] calldata claimIdxs
    ) external payable {
        if (!summerTokensClaimable) revert SummerTokensClaimClosed();
        if (tx.origin != msg.sender) revert NoContractMints();

        uint256 len = claimIdxs.length;
        if (len - 1 > tokens.length) revert InncorrectLengths();

        _verifyClaimSignature(claimSignature, tokens);

        for (uint256 i = 0; i < len; i++) {
            uint256 tokenId = tokens[claimIdxs[i]];
            _claim(msg.sender, tokenId);
        }
    }

    function claimSummerAndMint(
        bytes calldata claimSignature,
        bytes calldata ticketSignature,
        uint256[] calldata tokens,
        uint256[] calldata claimIdxs,
        uint256 ticket,
        uint256 mintQty
    ) external payable {
        if (!summerTokensClaimable) revert SummerTokensClaimClosed();
        if (mintQty > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
        if (tx.origin != msg.sender) revert NoContractMints();
        if (tokensMinted() + mintQty > MAX_SEASONS_COUNT) revert MaxMintExceeded();

        uint256 len = claimIdxs.length;
        if (len - 1 > tokens.length) revert InncorrectLengths();

        _verifyClaimSignature(claimSignature, tokens);

        for (uint256 i = 0; i < len; i++) {
            uint256 tokenId = tokens[claimIdxs[i]];
            _claim(msg.sender, tokenId);
        }

        if (mintQty == 0) return;

        _claimSummerMintTicket(ticketSignature, ticket, mintQty);
        _mint(msg.sender, mintQty);
        _refundOverPayment(CLAIMER_MINT_PRICE * mintQty);
    }

    function claimAllSummer(bytes calldata signature, uint256[] calldata tokens) external payable {
        if (!summerTokensClaimable) revert SummerTokensClaimClosed();
        if (tx.origin != msg.sender) revert NoContractMints();

        _verifyClaimSignature(signature, tokens);

        uint256 len = tokens.length;

        for (uint256 i = 0; i < len; i++) {
            _claim(msg.sender, tokens[i]);
        }
    }

    function claimAllSummerAndMint(
        bytes calldata claimSignature,
        bytes calldata ticketSignature,
        uint256[] calldata tokens,
        uint256 ticket,
        uint256 mintQty
    ) external payable {
        if (!summerTokensClaimable) revert SummerTokensClaimClosed();
        if (mintQty > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
        if (tx.origin != msg.sender) revert NoContractMints();
        if (tokensMinted() + mintQty > MAX_SEASONS_COUNT) revert MaxMintExceeded();

        _verifyClaimSignature(claimSignature, tokens);

        uint256 len = tokens.length;

        for (uint256 i = 0; i < len; i++) {
            _claim(msg.sender, tokens[i]);
        }

        if (mintQty == 0) return;

        _claimSummerMintTicket(ticketSignature, ticket, mintQty);
        _mint(msg.sender, mintQty);
        _refundOverPayment(CLAIMER_MINT_PRICE * mintQty);
    }

    function _refundOverPayment(uint256 amount) internal {
        if (msg.value < amount) revert NotEnoughEth();
        if (msg.value > amount) {
            payable(msg.sender).transfer(msg.value - amount);
        }
    }

    function setSigSigner(address signer) external onlyOwner {
        if (signer == address(0)) revert OwnerIsZeroAddress();
        sigSigner = signer;
    }

    function _verifyClaimSignature(bytes calldata signature, uint256[] calldata tokens) internal view {
        address signedAddr = keccak256(abi.encodePacked(msg.sender, tokens))
            .toEthSignedMessageHash()
            .recover(signature);

        if (sigSigner != signedAddr) revert InvalidSignature();
    }

    uint256 private constant MAX_INT = 2**256-1;

    uint256 private mintGroup0 = MAX_INT;
    uint256 private mintGroup1 = MAX_INT;
    uint256 private mintGroup2 = MAX_INT;
    uint256 private mintGroup3 = MAX_INT;
    uint256 private mintGroup4 = MAX_INT;
    uint256 private mintGroup5 = MAX_INT;

    function _getBitForTicket(uint256 ticket) internal view returns(uint256) {
        uint256 slot;
        uint256 offsetInSlot;
        uint256 localGroup;

        unchecked {
            slot = ticket / 256;
            offsetInSlot = ticket % 256;
        }

        assembly {
            slot := add(mintGroup0.slot, slot)
            localGroup := sload(slot)
        }

        return (localGroup >> offsetInSlot) & uint256(1);
    }

    function _useBitForTicket(uint256 ticket) internal {
        uint256 slot;
        uint256 offsetInSlot;
        uint256 localGroup;

        unchecked {
            slot = ticket / 256;
            offsetInSlot = ticket % 256;
        }

        assembly {
            slot := add(mintGroup0.slot, slot)
            localGroup := sload(slot)
        }

        localGroup = localGroup & ~(uint256(1) << offsetInSlot);

        assembly {
            sstore(slot, localGroup)
        }
    }

    function _claimSummerMintTicket(bytes calldata signature, uint256 ticket, uint256 mintQty) internal {
        
        address signedAddr = keccak256(abi.encodePacked(msg.sender, ticket))
            .toEthSignedMessageHash()
            .recover(signature);

        if (sigSigner != signedAddr) revert InvalidSignature();

        // check the ticket number for the first mint available for minter
        uint256 storedBit1 = _getBitForTicket(ticket);

        // we will use the second ticket slot first
        // so if the first ticket slot is used, then we have none available
        if (storedBit1 == 0) revert MaxMintExceeded();

        uint256 secondTicket = ticket + 1;
        uint256 storedBit2 = _getBitForTicket(secondTicket);

        if (storedBit2 == 1) {
            _useBitForTicket(secondTicket);

            if (mintQty == 2) {
                _useBitForTicket(ticket);
            }
        } else {
            if (mintQty == 2) revert MaxMintExceeded();

            // mintQty is 1 and available is 1
            _useBitForTicket(ticket);
        }
    }

    function numberMintedDuringClaim(uint256 ticket) external view returns (uint256) {
        uint256 storedBit1 = _getBitForTicket(ticket);

        if (storedBit1 == 0) return 2;
        
        uint256 storedBit2 = _getBitForTicket(ticket + 1);

        if (storedBit2 == 0) return 1;

        return 0;
    }

    function toggleClaiming() external onlyOwner {
        summerTokensClaimable = !summerTokensClaimable;
    }

    function toggleMint() external onlyOwner {
        seasonsMintOpen = !seasonsMintOpen;
    }

    function setRoyaltyReceiver(address royaltyReceiver) external onlyOwner {
        royaltyAddress = royaltyReceiver;
    }

    function setRoyaltyPercentage(uint256 royaltyPercentage) external onlyOwner {
        royaltyPercent = royaltyPercentage;
    }

    function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) {
        if (!_exists(tokenId)) revert RoyaltyInfoForNonexistentToken();
        return (royaltyAddress, salePrice * royaltyPercent / 100);
    }
    
    function _baseURI() internal view virtual override returns (string memory) {
        return _baseTokenURI;
    }

    function setBaseURI(string calldata baseURI_) external onlyOwner {
        if (locked) revert BaseURILocked();
        _baseTokenURI = baseURI_;
    }

    function lockBaseURI() external onlyOwner {
        if (locked) revert BaseURILocked();
        locked = true;
    }

    function withdraw() external onlyOwner {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        if (!success) revert TransferFailed();
    }

    // @dev contract owner must be an EOA account
    function devClaimForHolder(uint256 tokenId, address to) external onlyOwner {
        _claim(to, tokenId);
    }

    // used for giveaways
    // @dev contract owner must be an EOA account
    function devMint(uint256 quantity, address to) external onlyOwner {
        if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();

        _mint(to, quantity);
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721SZNS, IERC165) returns(bool) {
        return super.supportsInterface(interfaceId) || interfaceId == type(IERC2981).interfaceId;
    }
}

File 2 of 14 : 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 14 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 4 of 14 : 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 5 of 14 : ERC721SZNS.sol
// SPDX-License-Identifier: MIT
// Creator: Christopher Mikel Shelton

pragma solidity ^0.8.12;

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";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintZeroQuantity();
error TokenNotClaimable();
error TokenAlreadyExists();
error OwnerIsZeroAddress();
error CallOnlyValidAfterTokenOffset();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard
 *
 * This contract is design to handle the standard ERC721 implementation
 * and a gas optimized batch minting process pioneered by ERC721A.
 * Within the same collection, the first range of tokens may be minted in any order
 * using {_safeClaim} and at the point of the offset, every token after that must
 * be minted sequentially as it implements batch minting using {_safeMint}
 * 
 */
contract ERC721SZNS 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;

    // ===== Key token split offset between known tokenIds and new collection =====
    uint256 internal immutable _tokenSplitOffset;

    // ===== tokenIds for the latter part of the collection, after offset =====
    uint256 private _nextTokenId;

    uint256 private _tokensClaimed;
    uint256 private _tokensMinted;

    constructor(string memory name_, string memory symbol_, uint256 offset) {
        _name = name_;
        _symbol = symbol_;
        _tokenSplitOffset = offset;
        // the next token id will be the offset plus 1, as it is 1 based indexed
        // i.e. offset is 5864, next token to be minted sequentially is 5865
        _nextTokenId = offset + 1;
    }

    /**
     * @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 {IERC721Enumerable-totalSupply}.
     *
     * Number of claimed summer tokens plus number of minted season tokens
     */
    function totalSupply() public view returns (uint256) {
        unchecked {
            return _tokensClaimed + _tokensMinted;
        }
    }

    function tokensClaimed() public view returns (uint256) {
        return _tokensClaimed;
    }

    function tokensMinted() public view returns (uint256) {
        return _tokensMinted;
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf} or {ERC721A-ownerOf}
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner;

        if (tokenId > _tokenSplitOffset) {
            unchecked {
                // 'tokenId + 1' and '>' is cheaper than doing '>=' without '+1'
                if (tokenId + 1 > _nextTokenId) revert OwnerQueryForNonexistentToken();

                for (uint256 curr = tokenId;; curr--) {
                    owner = _owners[curr];
                    if (owner != address(0)) {
                        return owner;
                    }
                }
            }

            revert OwnerQueryForNonexistentToken();
        }

        owner = _owners[tokenId];

        if (owner == address(0)) revert OwnerIsZeroAddress();
        
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual {
        address owner = ERC721SZNS.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public {
        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        _transfer(from, to, tokenId);
        if (!_checkOnERC721Received(from, to, tokenId, _data)) revert TransferToNonERC721ReceiverImplementer();
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 quantity) internal {
        if (quantity == 0) revert MintZeroQuantity();

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if currentIndex + quantity > 1.56e77 (2**256) - 1
        unchecked {
            _balances[to] += quantity;
            _owners[_nextTokenId] = to;

            uint256 updatedIndex = _nextTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                updatedIndex++;
            }

            _tokensMinted += quantity;
            _nextTokenId = updatedIndex;
        }
    }

    function _claim(address to, uint256 tokenId) internal {
        if (tokenId > _tokenSplitOffset) revert TokenNotClaimable();
        if (_exists(tokenId)) revert TokenAlreadyExists();

        unchecked {
            _balances[to]++;
            _owners[tokenId] = to;

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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) private {
        address prevOwner = ERC721SZNS.ownerOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwner ||
            isApprovedForAll(prevOwner, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();

        if (prevOwner != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _balances[from]--;
            _balances[to]++;
            _owners[tokenId] = to;

            // this only applies to the second part of the collection
            if (tokenId > _tokenSplitOffset) {
                // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
                // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
                uint256 nextTokenId = tokenId + 1;

                if (_owners[nextTokenId] == address(0)) {
                    if (_exists(nextTokenId)) {
                        _owners[nextTokenId] = prevOwner;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens will exist once they are claimed within the first part of the collection
     * or when they are {_mint}
     *
     * @dev If token is greater than the collection offset, it uses {ERC721A-_exist}
     * else it uses {ERC721-_exist}
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        if (tokenId > _tokenSplitOffset) return tokenId < _nextTokenId;

        return _owners[tokenId] != address(0);
    }

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

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

File 6 of 14 : 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 7 of 14 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

File 8 of 14 : 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 9 of 14 : 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 10 of 14 : 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 14 : 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 14 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 13 of 14 : 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 14 of 14 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BaseURILocked","type":"error"},{"inputs":[],"name":"InncorrectLengths","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MaxMintExceeded","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NoContractMints","type":"error"},{"inputs":[],"name":"NotEnoughEth","type":"error"},{"inputs":[],"name":"OwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"RoyaltyInfoForNonexistentToken","type":"error"},{"inputs":[],"name":"SeasonsMintClosed","type":"error"},{"inputs":[],"name":"SummerTokensClaimClosed","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TokenNotClaimable","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","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":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"CLAIMER_MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT_DURING_CLAIM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT_PER_TX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SEASONS_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUMMER_MAX_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"claimAllSummer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"claimSignature","type":"bytes"},{"internalType":"bytes","name":"ticketSignature","type":"bytes"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"uint256","name":"ticket","type":"uint256"},{"internalType":"uint256","name":"mintQty","type":"uint256"}],"name":"claimAllSummerAndMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"claimSignature","type":"bytes"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"uint256[]","name":"claimIdxs","type":"uint256[]"}],"name":"claimSummer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"claimSignature","type":"bytes"},{"internalType":"bytes","name":"ticketSignature","type":"bytes"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"uint256[]","name":"claimIdxs","type":"uint256[]"},{"internalType":"uint256","name":"ticket","type":"uint256"},{"internalType":"uint256","name":"mintQty","type":"uint256"}],"name":"claimSummerAndMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"devClaimForHolder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"ticketSignature","type":"bytes"},{"internalType":"uint256","name":"ticket","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintForSummerHolder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintSeason","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticket","type":"uint256"}],"name":"numberMintedDuringClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPercent","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":"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":[],"name":"seasonsMintOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"royaltyPercentage","type":"uint256"}],"name":"setRoyaltyPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSigSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sigSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"summerTokensClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"name":"toggleClaiming","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052600a805462010000600160b01b0319167568cbe370a1b35f3f185172c063bbbabf836d7ecc0000179055600019600f81905560108190556011819055601281905560138190556014553480156200005a57600080fd5b506040518060400160405280601281526020017154686520417274206f6620536561736f6e7360701b8152506040518060400160405280600481526020016354414f5360e01b815250612174620000c0620000ba6200013160201b60201c565b62000135565b8251620000d590600190602086019062000185565b508151620000eb90600290602085019062000185565b506080819052620000fe8160016200022b565b6007555050600054600b80546001600160a01b0319166001600160a01b03909216919091179055506005600c556200028f565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054620001939062000252565b90600052602060002090601f016020900481019282620001b7576000855562000202565b82601f10620001d257805160ff191683800117855562000202565b8280016001018555821562000202579182015b8281111562000202578251825591602001919060010190620001e5565b506200021092915062000214565b5090565b5b8082111562000210576000815560010162000215565b600082198211156200024d57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200026757607f821691505b602082108114156200028957634e487b7160e01b600052602260045260246000fd5b50919050565b608051612fec620002c06000396000818161125201528181611a5501528181611dcd0152611f910152612fec6000f3fe60806040526004361061031e5760003560e01c80636352211e116101a5578063ad2f852a116100ec578063cf30901211610095578063e985e9c51161006f578063e985e9c514610846578063f2fde38b1461088f578063f38b5422146108af578063f4326503146108c457600080fd5b8063cf30901214610804578063d3dd5fe01461081e578063d616edee1461083357600080fd5b8063c002d23d116100c6578063c002d23d146107a2578063c383d002146107be578063c87b56dd146107e457600080fd5b8063ad2f852a1461074d578063b44df72d1461076d578063b88d4fde1461078257600080fd5b80638da5cb5b1161014e57806395d89b411161012857806395d89b41146107025780639f67756d14610717578063a22cb4651461072d57600080fd5b80638da5cb5b146106af5780638dc251e3146106cd5780638ecad721146106ed57600080fd5b8063715018a61161017f578063715018a614610672578063747d6813146106875780638010fc451461069a57600080fd5b80636352211e1461061d5780636de9f32b1461063d57806370a082311461065257600080fd5b80633bf7840e116102695780634ffaf9c911610212578063585f766c116101ec578063585f766c146105bd5780635e8e8200146105dd57806361ba27da146105fd57600080fd5b80634ffaf9c91461057257806353df5c7c1461058857806355f804b31461059d57600080fd5b80634608c95d116102435780634608c95d146105325780634972034b146105455780634fb9102b1461055f57600080fd5b80633bf7840e146104dd5780633ccfd60b146104fd57806342842e0e1461051257600080fd5b806314bd01be116102cb57806325c9444c116102a557806325c9444c1461045f5780632a55205a1461047e5780632d1a12f6146104bd57600080fd5b806314bd01be1461040b57806318160ddd1461042657806323b872dd1461043f57600080fd5b806306fdde03116102fc57806306fdde0314610391578063081812fc146103b3578063095ea7b3146103eb57600080fd5b806301ffc9a71461032357806303ab90801461035857806306630eba1461037c575b600080fd5b34801561032f57600080fd5b5061034361033e366004612706565b6108d7565b60405190151581526020015b60405180910390f35b34801561036457600080fd5b5061036e6118a081565b60405190815260200161034f565b61038f61038a3660046127aa565b610903565b005b34801561039d57600080fd5b506103a6610a31565b60405161034f91906128ab565b3480156103bf57600080fd5b506103d36103ce3660046128be565b610ac3565b6040516001600160a01b03909116815260200161034f565b3480156103f757600080fd5b5061038f6104063660046128f3565b610b07565b34801561041757600080fd5b5061036e668e1bc9bf04000081565b34801561043257600080fd5b506009546008540161036e565b34801561044b57600080fd5b5061038f61045a36600461291d565b610b95565b34801561046b57600080fd5b50600a5461034390610100900460ff1681565b34801561048a57600080fd5b5061049e610499366004612959565b610ba0565b604080516001600160a01b03909316835260208301919091520161034f565b3480156104c957600080fd5b5061038f6104d836600461297b565b610bfe565b3480156104e957600080fd5b5061038f6104f836600461297b565b610c8f565b34801561050957600080fd5b5061038f610ce1565b34801561051e57600080fd5b5061038f61052d36600461291d565b610d95565b61038f6105403660046129a7565b610db0565b34801561055157600080fd5b50600a546103439060ff1681565b61038f61056d366004612a7d565b610f24565b34801561057e57600080fd5b5061036e61217481565b34801561059457600080fd5b5061038f610ffc565b3480156105a957600080fd5b5061038f6105b8366004612b17565b611077565b3480156105c957600080fd5b5061038f6105d8366004612b59565b6110ef565b3480156105e957600080fd5b5061036e6105f83660046128be565b61119e565b34801561060957600080fd5b5061038f6106183660046128be565b611200565b34801561062957600080fd5b506103d36106383660046128be565b61124d565b34801561064957600080fd5b5060095461036e565b34801561065e57600080fd5b5061036e61066d366004612b59565b611307565b34801561067e57600080fd5b5061038f61134c565b61038f6106953660046128be565b6113a0565b3480156106a657600080fd5b5061038f61145f565b3480156106bb57600080fd5b506000546001600160a01b03166103d3565b3480156106d957600080fd5b5061038f6106e8366004612b59565b6114bb565b3480156106f957600080fd5b5061036e600881565b34801561070e57600080fd5b506103a6611525565b34801561072357600080fd5b5061036e600c5481565b34801561073957600080fd5b5061038f610748366004612b74565b611534565b34801561075957600080fd5b50600b546103d3906001600160a01b031681565b34801561077957600080fd5b5060085461036e565b34801561078e57600080fd5b5061038f61079d366004612bc6565b6115ca565b3480156107ae57600080fd5b5061036e67011c37937e08000081565b3480156107ca57600080fd5b50600a546103d3906201000090046001600160a01b031681565b3480156107f057600080fd5b506103a66107ff3660046128be565b611604565b34801561081057600080fd5b50600e546103439060ff1681565b34801561082a57600080fd5b5061038f611689565b61038f610841366004612ca2565b6116ee565b34801561085257600080fd5b50610343610861366004612d0e565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561089b57600080fd5b5061038f6108aa366004612b59565b611779565b3480156108bb57600080fd5b5061036e600281565b61038f6108d2366004612d38565b611846565b60006108e28261190b565b806108fd57506001600160e01b0319821663152a902d60e11b145b92915050565b600a5460ff166109265760405163e332de5b60e01b815260040160405180910390fd5b600281111561094857604051633ce95f8560e11b815260040160405180910390fd5b32331461096857604051631f1e98b160e31b815260040160405180910390fd5b6118a08161097560095490565b61097f9190612d9f565b111561099e57604051633ce95f8560e11b815260040160405180910390fd5b6109aa8888868661195b565b8260005b818110156109ea576109d8338787848181106109cc576109cc612db7565b90506020020135611a53565b806109e281612dcd565b9150506109ae565b50816109f65750610a27565b610a0287878585611b33565b610a0c3383611cab565b610a25610a2083668e1bc9bf040000612de8565b611d6a565b505b5050505050505050565b606060018054610a4090612e07565b80601f0160208091040260200160405190810160405280929190818152602001828054610a6c90612e07565b8015610ab95780601f10610a8e57610100808354040283529160200191610ab9565b820191906000526020600020905b815481529060010190602001808311610a9c57829003601f168201915b5050505050905090565b6000610ace82611dc9565b610aeb576040516333d1c03960e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610b128261124d565b9050806001600160a01b0316836001600160a01b03161415610b475760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610b675750610b658133610861565b155b15610b85576040516367d9dca160e11b815260040160405180910390fd5b610b90838383611e19565b505050565b610b90838383611e75565b600080610bac84611dc9565b610bc95760405163615c17e560e01b815260040160405180910390fd5b600b54600c546001600160a01b0390911690606490610be89086612de8565b610bf29190612e58565b915091505b9250929050565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b81526020600482018190526024820152600080516020612f9783398151915260448201526064015b60405180910390fd5b6118a082610c5860095490565b610c629190612d9f565b1115610c8157604051633ce95f8560e11b815260040160405180910390fd5b610c8b8183611cab565b5050565b6000546001600160a01b03163314610cd75760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b610c8b8183611a53565b6000546001600160a01b03163314610d295760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b604051600090339047908381818185875af1925050503d8060008114610d6b576040519150601f19603f3d011682016040523d82523d6000602084013e610d70565b606091505b5050905080610d92576040516312171d8360e31b815260040160405180910390fd5b50565b610b90838383604051806020016040528060008152506115ca565b600a5460ff16610dd35760405163e332de5b60e01b815260040160405180910390fd5b6002811115610df557604051633ce95f8560e11b815260040160405180910390fd5b323314610e1557604051631f1e98b160e31b815260040160405180910390fd5b6118a081610e2260095490565b610e2c9190612d9f565b1115610e4b57604051633ce95f8560e11b815260040160405180910390fd5b8285610e58600183612e6c565b1115610e77576040516306e2985760e51b815260040160405180910390fd5b610e838b8b898961195b565b60005b81811015610ee05760008888888885818110610ea457610ea4612db7565b90506020020135818110610eba57610eba612db7565b905060200201359050610ecd3382611a53565b5080610ed881612dcd565b915050610e86565b5081610eec5750610f18565b610ef889898585611b33565b610f023383611cab565b610f16610a2083668e1bc9bf040000612de8565b505b50505050505050505050565b600a5460ff16610f475760405163e332de5b60e01b815260040160405180910390fd5b323314610f6757604051631f1e98b160e31b815260040160405180910390fd5b8083610f74600183612e6c565b1115610f93576040516306e2985760e51b815260040160405180910390fd5b610f9f8787878761195b565b60005b81811015610a275760008686868685818110610fc057610fc0612db7565b90506020020135818110610fd657610fd6612db7565b905060200201359050610fe93382611a53565b5080610ff481612dcd565b915050610fa2565b6000546001600160a01b031633146110445760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600e5460ff16156110685760405163696c636960e01b815260040160405180910390fd5b600e805460ff19166001179055565b6000546001600160a01b031633146110bf5760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600e5460ff16156110e35760405163696c636960e01b815260040160405180910390fd5b610b90600d8383612657565b6000546001600160a01b031633146111375760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b6001600160a01b03811661115e576040516354a4010f60e01b815260040160405180910390fd5b600a80546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b6101008104600f015460009060ff83161c600116806111c05750600292915050565b60006111e56111d0856001612d9f565b600f61010082040154600160ff9092161c1690565b9050806111f6575060019392505050565b5060009392505050565b6000546001600160a01b031633146112485760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600c55565b6000807f00000000000000000000000000000000000000000000000000000000000000008311156112d05760075483600101111561129e57604051636f96cda160e11b815260040160405180910390fd5b825b6000818152600360205260409020546001600160a01b0316915081156112c7575092915050565b600019016112a0565b506000828152600360205260409020546001600160a01b0316806108fd576040516354a4010f60e01b815260040160405180910390fd5b60006001600160a01b038216611330576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b031633146113945760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b61139e6000612057565b565b600a54610100900460ff166113c85760405163334b5fad60e11b815260040160405180910390fd5b60088111156113ea57604051633ce95f8560e11b815260040160405180910390fd5b32331461140a57604051631f1e98b160e31b815260040160405180910390fd5b6118a08161141760095490565b6114219190612d9f565b111561144057604051633ce95f8560e11b815260040160405180910390fd5b61144a3382611cab565b610d92610a208267011c37937e080000612de8565b6000546001600160a01b031633146114a75760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600a805460ff19811660ff90911615179055565b6000546001600160a01b031633146115035760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b606060028054610a4090612e07565b6001600160a01b03821633141561155e5760405163b06307db60e01b815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6115d5848484611e75565b6115e1848484846120a7565b6115fe576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061160f82611dc9565b61162c57604051630a14c4b560e41b815260040160405180910390fd5b60006116366121a7565b90508051600014156116575760405180602001604052806000815250611682565b80611661846121b6565b604051602001611672929190612e83565b6040516020818303038152906040525b9392505050565b6000546001600160a01b031633146116d15760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600a805461ff001981166101009182900460ff1615909102179055565b600a5460ff166117115760405163e332de5b60e01b815260040160405180910390fd5b32331461173157604051631f1e98b160e31b815260040160405180910390fd5b61173d8484848461195b565b8060005b818110156117715761175f338585848181106109cc576109cc612db7565b8061176981612dcd565b915050611741565b505050505050565b6000546001600160a01b031633146117c15760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b6001600160a01b03811661183d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c42565b610d9281612057565b600a5460ff166118695760405163e332de5b60e01b815260040160405180910390fd5b600281111561188b57604051633ce95f8560e11b815260040160405180910390fd5b3233146118ab57604051631f1e98b160e31b815260040160405180910390fd5b6118a0816118b860095490565b6118c29190612d9f565b11156118e157604051633ce95f8560e11b815260040160405180910390fd5b6118ed84848484611b33565b6118f73382611cab565b6115fe610a2082668e1bc9bf040000612de8565b60006001600160e01b031982166380ac58cd60e01b148061193c57506001600160e01b03198216635b5e139f60e01b145b806108fd57506301ffc9a760e01b6001600160e01b03198316146108fd565b6000611a1585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051611a0f92506119af9150339088908890602001612eb2565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b906122cc565b600a549091506001600160a01b03808316620100009092041614611a4c57604051638baa579f60e01b815260040160405180910390fd5b5050505050565b7f0000000000000000000000000000000000000000000000000000000000000000811115611a9457604051633b6d512960e01b815260040160405180910390fd5b611a9d81611dc9565b15611abb5760405163c991cbb160e01b815260040160405180910390fd5b6001600160a01b038216600081815260046020908152604080832080546001908101909155858452600390925280832080546001600160a01b031916851790556008805490920190915551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611b9d85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516bffffffffffffffffffffffff193360601b16602082015260348101889052611a0f925060540190506119af565b600a549091506001600160a01b03808316620100009092041614611bd457604051638baa579f60e01b815260040160405180910390fd5b6101008304600f015460ff84161c60011680611c0357604051633ce95f8560e11b815260040160405180910390fd5b6000611c10856001612d9f565b6101008104600f015490915060009060ff83161c60011690508060011415611c6f576101008204600f018054600160ff85161b191690558460021415611c6a576101008604600f018054600160ff89161b19169055610a27565b610a27565b8460021415611c9157604051633ce95f8560e11b815260040160405180910390fd5b6101008604600f018054600160ff89161b19169055610a27565b80611cc95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03821660008181526004602090815260408083208054860190556007805484526003909252822080546001600160a01b0319169093179092559054905b82811015611d595760405182906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101611d0d565b506009805490920190915560075550565b80341015611d8b5760405163f14a42b760e01b815260040160405180910390fd5b80341115610d9257336108fc611da18334612e6c565b6040518115909202916000818181858888f19350505050158015610c8b573d6000803e3d6000fd5b60007f0000000000000000000000000000000000000000000000000000000000000000821115611dfb57506007541190565b506000908152600360205260409020546001600160a01b0316151590565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611e808261124d565b90506000336001600160a01b0383161480611ea05750611ea08233610861565b80611ebb575033611eb084610ac3565b6001600160a01b0316145b905080611edb57604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b0316826001600160a01b031614611f0c5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416611f3357604051633a954ecd60e21b815260040160405180910390fd5b611f3f60008484611e19565b6001600160a01b038086166000908152600460209081526040808320805460001901905592871680835283832080546001019055868352600390915291902080546001600160a01b03191690911790557f000000000000000000000000000000000000000000000000000000000000000083111561200f57600183016000818152600360205260409020546001600160a01b031661200d57611fe081611dc9565b1561200d57600081815260036020526040902080546001600160a01b0319166001600160a01b0385161790555b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b0384163b1561219b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906120eb903390899088908890600401612f13565b6020604051808303816000875af1925050508015612126575060408051601f3d908101601f1916820190925261212391810190612f4f565b60015b612181573d808015612154576040519150601f19603f3d011682016040523d82523d6000602084013e612159565b606091505b508051612179576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061219f565b5060015b949350505050565b6060600d8054610a4090612e07565b6060816121da5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561220457806121ee81612dcd565b91506121fd9050600a83612e58565b91506121de565b60008167ffffffffffffffff81111561221f5761221f612bb0565b6040519080825280601f01601f191660200182016040528015612249576020820181803683370190505b5090505b841561219f5761225e600183612e6c565b915061226b600a86612f6c565b612276906030612d9f565b60f81b81838151811061228b5761228b612db7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506122c5600a86612e58565b945061224d565b60008060006122db85856122f0565b915091506122e88161235d565b509392505050565b6000808251604114156123275760208301516040840151606085015160001a61231b87828585612518565b94509450505050610bf7565b8251604014156123515760208301516040840151612346868383612605565b935093505050610bf7565b50600090506002610bf7565b600081600481111561237157612371612f80565b141561237a5750565b600181600481111561238e5761238e612f80565b14156123dc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c42565b60028160048111156123f0576123f0612f80565b141561243e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c42565b600381600481111561245257612452612f80565b14156124ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c42565b60048160048111156124bf576124bf612f80565b1415610d925760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c42565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561254f57506000905060036125fc565b8460ff16601b1415801561256757508460ff16601c14155b1561257857506000905060046125fc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156125cc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166125f5576000600192509250506125fc565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83168161263b60ff86901c601b612d9f565b905061264987828885612518565b935093505050935093915050565b82805461266390612e07565b90600052602060002090601f01602090048101928261268557600085556126cb565b82601f1061269e5782800160ff198235161785556126cb565b828001600101855582156126cb579182015b828111156126cb5782358255916020019190600101906126b0565b506126d79291506126db565b5090565b5b808211156126d757600081556001016126dc565b6001600160e01b031981168114610d9257600080fd5b60006020828403121561271857600080fd5b8135611682816126f0565b60008083601f84011261273557600080fd5b50813567ffffffffffffffff81111561274d57600080fd5b602083019150836020828501011115610bf757600080fd5b60008083601f84011261277757600080fd5b50813567ffffffffffffffff81111561278f57600080fd5b6020830191508360208260051b8501011115610bf757600080fd5b60008060008060008060008060a0898b0312156127c657600080fd5b883567ffffffffffffffff808211156127de57600080fd5b6127ea8c838d01612723565b909a50985060208b013591508082111561280357600080fd5b61280f8c838d01612723565b909850965060408b013591508082111561282857600080fd5b506128358b828c01612765565b999c989b509699959896976060870135966080013595509350505050565b60005b8381101561286e578181015183820152602001612856565b838111156115fe5750506000910152565b60008151808452612897816020860160208601612853565b601f01601f19169290920160200192915050565b602081526000611682602083018461287f565b6000602082840312156128d057600080fd5b5035919050565b80356001600160a01b03811681146128ee57600080fd5b919050565b6000806040838503121561290657600080fd5b61290f836128d7565b946020939093013593505050565b60008060006060848603121561293257600080fd5b61293b846128d7565b9250612949602085016128d7565b9150604084013590509250925092565b6000806040838503121561296c57600080fd5b50508035926020909101359150565b6000806040838503121561298e57600080fd5b8235915061299e602084016128d7565b90509250929050565b60008060008060008060008060008060c08b8d0312156129c657600080fd5b8a3567ffffffffffffffff808211156129de57600080fd5b6129ea8e838f01612723565b909c509a5060208d0135915080821115612a0357600080fd5b612a0f8e838f01612723565b909a50985060408d0135915080821115612a2857600080fd5b612a348e838f01612765565b909850965060608d0135915080821115612a4d57600080fd5b50612a5a8d828e01612765565b9b9e9a9d50989b979a969995989760808101359660a09091013595509350505050565b60008060008060008060608789031215612a9657600080fd5b863567ffffffffffffffff80821115612aae57600080fd5b612aba8a838b01612723565b90985096506020890135915080821115612ad357600080fd5b612adf8a838b01612765565b90965094506040890135915080821115612af857600080fd5b50612b0589828a01612765565b979a9699509497509295939492505050565b60008060208385031215612b2a57600080fd5b823567ffffffffffffffff811115612b4157600080fd5b612b4d85828601612723565b90969095509350505050565b600060208284031215612b6b57600080fd5b611682826128d7565b60008060408385031215612b8757600080fd5b612b90836128d7565b915060208301358015158114612ba557600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612bdc57600080fd5b612be5856128d7565b9350612bf3602086016128d7565b925060408501359150606085013567ffffffffffffffff80821115612c1757600080fd5b818701915087601f830112612c2b57600080fd5b813581811115612c3d57612c3d612bb0565b604051601f8201601f19908116603f01168101908382118183101715612c6557612c65612bb0565b816040528281528a6020848701011115612c7e57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060008060408587031215612cb857600080fd5b843567ffffffffffffffff80821115612cd057600080fd5b612cdc88838901612723565b90965094506020870135915080821115612cf557600080fd5b50612d0287828801612765565b95989497509550505050565b60008060408385031215612d2157600080fd5b612d2a836128d7565b915061299e602084016128d7565b60008060008060608587031215612d4e57600080fd5b843567ffffffffffffffff811115612d6557600080fd5b612d7187828801612723565b90989097506020870135966040013595509350505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612db257612db2612d89565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415612de157612de1612d89565b5060010190565b6000816000190483118215151615612e0257612e02612d89565b500290565b600181811c90821680612e1b57607f821691505b60208210811415612e3c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601260045260246000fd5b600082612e6757612e67612e42565b500490565b600082821015612e7e57612e7e612d89565b500390565b60008351612e95818460208801612853565b835190830190612ea9818360208801612853565b01949350505050565b6bffffffffffffffffffffffff198460601b16815260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612ef657600080fd5b8260051b8085601485013760009201601401918252509392505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612f45608083018461287f565b9695505050505050565b600060208284031215612f6157600080fd5b8151611682816126f0565b600082612f7b57612f7b612e42565b500690565b634e487b7160e01b600052602160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220ccca2eca0f099829b05171228710748ca4e60c045de7f918a92e64e4788b972464736f6c634300080c0033

Deployed Bytecode

0x60806040526004361061031e5760003560e01c80636352211e116101a5578063ad2f852a116100ec578063cf30901211610095578063e985e9c51161006f578063e985e9c514610846578063f2fde38b1461088f578063f38b5422146108af578063f4326503146108c457600080fd5b8063cf30901214610804578063d3dd5fe01461081e578063d616edee1461083357600080fd5b8063c002d23d116100c6578063c002d23d146107a2578063c383d002146107be578063c87b56dd146107e457600080fd5b8063ad2f852a1461074d578063b44df72d1461076d578063b88d4fde1461078257600080fd5b80638da5cb5b1161014e57806395d89b411161012857806395d89b41146107025780639f67756d14610717578063a22cb4651461072d57600080fd5b80638da5cb5b146106af5780638dc251e3146106cd5780638ecad721146106ed57600080fd5b8063715018a61161017f578063715018a614610672578063747d6813146106875780638010fc451461069a57600080fd5b80636352211e1461061d5780636de9f32b1461063d57806370a082311461065257600080fd5b80633bf7840e116102695780634ffaf9c911610212578063585f766c116101ec578063585f766c146105bd5780635e8e8200146105dd57806361ba27da146105fd57600080fd5b80634ffaf9c91461057257806353df5c7c1461058857806355f804b31461059d57600080fd5b80634608c95d116102435780634608c95d146105325780634972034b146105455780634fb9102b1461055f57600080fd5b80633bf7840e146104dd5780633ccfd60b146104fd57806342842e0e1461051257600080fd5b806314bd01be116102cb57806325c9444c116102a557806325c9444c1461045f5780632a55205a1461047e5780632d1a12f6146104bd57600080fd5b806314bd01be1461040b57806318160ddd1461042657806323b872dd1461043f57600080fd5b806306fdde03116102fc57806306fdde0314610391578063081812fc146103b3578063095ea7b3146103eb57600080fd5b806301ffc9a71461032357806303ab90801461035857806306630eba1461037c575b600080fd5b34801561032f57600080fd5b5061034361033e366004612706565b6108d7565b60405190151581526020015b60405180910390f35b34801561036457600080fd5b5061036e6118a081565b60405190815260200161034f565b61038f61038a3660046127aa565b610903565b005b34801561039d57600080fd5b506103a6610a31565b60405161034f91906128ab565b3480156103bf57600080fd5b506103d36103ce3660046128be565b610ac3565b6040516001600160a01b03909116815260200161034f565b3480156103f757600080fd5b5061038f6104063660046128f3565b610b07565b34801561041757600080fd5b5061036e668e1bc9bf04000081565b34801561043257600080fd5b506009546008540161036e565b34801561044b57600080fd5b5061038f61045a36600461291d565b610b95565b34801561046b57600080fd5b50600a5461034390610100900460ff1681565b34801561048a57600080fd5b5061049e610499366004612959565b610ba0565b604080516001600160a01b03909316835260208301919091520161034f565b3480156104c957600080fd5b5061038f6104d836600461297b565b610bfe565b3480156104e957600080fd5b5061038f6104f836600461297b565b610c8f565b34801561050957600080fd5b5061038f610ce1565b34801561051e57600080fd5b5061038f61052d36600461291d565b610d95565b61038f6105403660046129a7565b610db0565b34801561055157600080fd5b50600a546103439060ff1681565b61038f61056d366004612a7d565b610f24565b34801561057e57600080fd5b5061036e61217481565b34801561059457600080fd5b5061038f610ffc565b3480156105a957600080fd5b5061038f6105b8366004612b17565b611077565b3480156105c957600080fd5b5061038f6105d8366004612b59565b6110ef565b3480156105e957600080fd5b5061036e6105f83660046128be565b61119e565b34801561060957600080fd5b5061038f6106183660046128be565b611200565b34801561062957600080fd5b506103d36106383660046128be565b61124d565b34801561064957600080fd5b5060095461036e565b34801561065e57600080fd5b5061036e61066d366004612b59565b611307565b34801561067e57600080fd5b5061038f61134c565b61038f6106953660046128be565b6113a0565b3480156106a657600080fd5b5061038f61145f565b3480156106bb57600080fd5b506000546001600160a01b03166103d3565b3480156106d957600080fd5b5061038f6106e8366004612b59565b6114bb565b3480156106f957600080fd5b5061036e600881565b34801561070e57600080fd5b506103a6611525565b34801561072357600080fd5b5061036e600c5481565b34801561073957600080fd5b5061038f610748366004612b74565b611534565b34801561075957600080fd5b50600b546103d3906001600160a01b031681565b34801561077957600080fd5b5060085461036e565b34801561078e57600080fd5b5061038f61079d366004612bc6565b6115ca565b3480156107ae57600080fd5b5061036e67011c37937e08000081565b3480156107ca57600080fd5b50600a546103d3906201000090046001600160a01b031681565b3480156107f057600080fd5b506103a66107ff3660046128be565b611604565b34801561081057600080fd5b50600e546103439060ff1681565b34801561082a57600080fd5b5061038f611689565b61038f610841366004612ca2565b6116ee565b34801561085257600080fd5b50610343610861366004612d0e565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561089b57600080fd5b5061038f6108aa366004612b59565b611779565b3480156108bb57600080fd5b5061036e600281565b61038f6108d2366004612d38565b611846565b60006108e28261190b565b806108fd57506001600160e01b0319821663152a902d60e11b145b92915050565b600a5460ff166109265760405163e332de5b60e01b815260040160405180910390fd5b600281111561094857604051633ce95f8560e11b815260040160405180910390fd5b32331461096857604051631f1e98b160e31b815260040160405180910390fd5b6118a08161097560095490565b61097f9190612d9f565b111561099e57604051633ce95f8560e11b815260040160405180910390fd5b6109aa8888868661195b565b8260005b818110156109ea576109d8338787848181106109cc576109cc612db7565b90506020020135611a53565b806109e281612dcd565b9150506109ae565b50816109f65750610a27565b610a0287878585611b33565b610a0c3383611cab565b610a25610a2083668e1bc9bf040000612de8565b611d6a565b505b5050505050505050565b606060018054610a4090612e07565b80601f0160208091040260200160405190810160405280929190818152602001828054610a6c90612e07565b8015610ab95780601f10610a8e57610100808354040283529160200191610ab9565b820191906000526020600020905b815481529060010190602001808311610a9c57829003601f168201915b5050505050905090565b6000610ace82611dc9565b610aeb576040516333d1c03960e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610b128261124d565b9050806001600160a01b0316836001600160a01b03161415610b475760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610b675750610b658133610861565b155b15610b85576040516367d9dca160e11b815260040160405180910390fd5b610b90838383611e19565b505050565b610b90838383611e75565b600080610bac84611dc9565b610bc95760405163615c17e560e01b815260040160405180910390fd5b600b54600c546001600160a01b0390911690606490610be89086612de8565b610bf29190612e58565b915091505b9250929050565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b81526020600482018190526024820152600080516020612f9783398151915260448201526064015b60405180910390fd5b6118a082610c5860095490565b610c629190612d9f565b1115610c8157604051633ce95f8560e11b815260040160405180910390fd5b610c8b8183611cab565b5050565b6000546001600160a01b03163314610cd75760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b610c8b8183611a53565b6000546001600160a01b03163314610d295760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b604051600090339047908381818185875af1925050503d8060008114610d6b576040519150601f19603f3d011682016040523d82523d6000602084013e610d70565b606091505b5050905080610d92576040516312171d8360e31b815260040160405180910390fd5b50565b610b90838383604051806020016040528060008152506115ca565b600a5460ff16610dd35760405163e332de5b60e01b815260040160405180910390fd5b6002811115610df557604051633ce95f8560e11b815260040160405180910390fd5b323314610e1557604051631f1e98b160e31b815260040160405180910390fd5b6118a081610e2260095490565b610e2c9190612d9f565b1115610e4b57604051633ce95f8560e11b815260040160405180910390fd5b8285610e58600183612e6c565b1115610e77576040516306e2985760e51b815260040160405180910390fd5b610e838b8b898961195b565b60005b81811015610ee05760008888888885818110610ea457610ea4612db7565b90506020020135818110610eba57610eba612db7565b905060200201359050610ecd3382611a53565b5080610ed881612dcd565b915050610e86565b5081610eec5750610f18565b610ef889898585611b33565b610f023383611cab565b610f16610a2083668e1bc9bf040000612de8565b505b50505050505050505050565b600a5460ff16610f475760405163e332de5b60e01b815260040160405180910390fd5b323314610f6757604051631f1e98b160e31b815260040160405180910390fd5b8083610f74600183612e6c565b1115610f93576040516306e2985760e51b815260040160405180910390fd5b610f9f8787878761195b565b60005b81811015610a275760008686868685818110610fc057610fc0612db7565b90506020020135818110610fd657610fd6612db7565b905060200201359050610fe93382611a53565b5080610ff481612dcd565b915050610fa2565b6000546001600160a01b031633146110445760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600e5460ff16156110685760405163696c636960e01b815260040160405180910390fd5b600e805460ff19166001179055565b6000546001600160a01b031633146110bf5760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600e5460ff16156110e35760405163696c636960e01b815260040160405180910390fd5b610b90600d8383612657565b6000546001600160a01b031633146111375760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b6001600160a01b03811661115e576040516354a4010f60e01b815260040160405180910390fd5b600a80546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b6101008104600f015460009060ff83161c600116806111c05750600292915050565b60006111e56111d0856001612d9f565b600f61010082040154600160ff9092161c1690565b9050806111f6575060019392505050565b5060009392505050565b6000546001600160a01b031633146112485760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600c55565b6000807f00000000000000000000000000000000000000000000000000000000000021748311156112d05760075483600101111561129e57604051636f96cda160e11b815260040160405180910390fd5b825b6000818152600360205260409020546001600160a01b0316915081156112c7575092915050565b600019016112a0565b506000828152600360205260409020546001600160a01b0316806108fd576040516354a4010f60e01b815260040160405180910390fd5b60006001600160a01b038216611330576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b031633146113945760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b61139e6000612057565b565b600a54610100900460ff166113c85760405163334b5fad60e11b815260040160405180910390fd5b60088111156113ea57604051633ce95f8560e11b815260040160405180910390fd5b32331461140a57604051631f1e98b160e31b815260040160405180910390fd5b6118a08161141760095490565b6114219190612d9f565b111561144057604051633ce95f8560e11b815260040160405180910390fd5b61144a3382611cab565b610d92610a208267011c37937e080000612de8565b6000546001600160a01b031633146114a75760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600a805460ff19811660ff90911615179055565b6000546001600160a01b031633146115035760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b606060028054610a4090612e07565b6001600160a01b03821633141561155e5760405163b06307db60e01b815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6115d5848484611e75565b6115e1848484846120a7565b6115fe576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061160f82611dc9565b61162c57604051630a14c4b560e41b815260040160405180910390fd5b60006116366121a7565b90508051600014156116575760405180602001604052806000815250611682565b80611661846121b6565b604051602001611672929190612e83565b6040516020818303038152906040525b9392505050565b6000546001600160a01b031633146116d15760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b600a805461ff001981166101009182900460ff1615909102179055565b600a5460ff166117115760405163e332de5b60e01b815260040160405180910390fd5b32331461173157604051631f1e98b160e31b815260040160405180910390fd5b61173d8484848461195b565b8060005b818110156117715761175f338585848181106109cc576109cc612db7565b8061176981612dcd565b915050611741565b505050505050565b6000546001600160a01b031633146117c15760405162461bcd60e51b81526020600482018190526024820152600080516020612f978339815191526044820152606401610c42565b6001600160a01b03811661183d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c42565b610d9281612057565b600a5460ff166118695760405163e332de5b60e01b815260040160405180910390fd5b600281111561188b57604051633ce95f8560e11b815260040160405180910390fd5b3233146118ab57604051631f1e98b160e31b815260040160405180910390fd5b6118a0816118b860095490565b6118c29190612d9f565b11156118e157604051633ce95f8560e11b815260040160405180910390fd5b6118ed84848484611b33565b6118f73382611cab565b6115fe610a2082668e1bc9bf040000612de8565b60006001600160e01b031982166380ac58cd60e01b148061193c57506001600160e01b03198216635b5e139f60e01b145b806108fd57506301ffc9a760e01b6001600160e01b03198316146108fd565b6000611a1585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051611a0f92506119af9150339088908890602001612eb2565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b906122cc565b600a549091506001600160a01b03808316620100009092041614611a4c57604051638baa579f60e01b815260040160405180910390fd5b5050505050565b7f0000000000000000000000000000000000000000000000000000000000002174811115611a9457604051633b6d512960e01b815260040160405180910390fd5b611a9d81611dc9565b15611abb5760405163c991cbb160e01b815260040160405180910390fd5b6001600160a01b038216600081815260046020908152604080832080546001908101909155858452600390925280832080546001600160a01b031916851790556008805490920190915551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611b9d85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516bffffffffffffffffffffffff193360601b16602082015260348101889052611a0f925060540190506119af565b600a549091506001600160a01b03808316620100009092041614611bd457604051638baa579f60e01b815260040160405180910390fd5b6101008304600f015460ff84161c60011680611c0357604051633ce95f8560e11b815260040160405180910390fd5b6000611c10856001612d9f565b6101008104600f015490915060009060ff83161c60011690508060011415611c6f576101008204600f018054600160ff85161b191690558460021415611c6a576101008604600f018054600160ff89161b19169055610a27565b610a27565b8460021415611c9157604051633ce95f8560e11b815260040160405180910390fd5b6101008604600f018054600160ff89161b19169055610a27565b80611cc95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03821660008181526004602090815260408083208054860190556007805484526003909252822080546001600160a01b0319169093179092559054905b82811015611d595760405182906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101611d0d565b506009805490920190915560075550565b80341015611d8b5760405163f14a42b760e01b815260040160405180910390fd5b80341115610d9257336108fc611da18334612e6c565b6040518115909202916000818181858888f19350505050158015610c8b573d6000803e3d6000fd5b60007f0000000000000000000000000000000000000000000000000000000000002174821115611dfb57506007541190565b506000908152600360205260409020546001600160a01b0316151590565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611e808261124d565b90506000336001600160a01b0383161480611ea05750611ea08233610861565b80611ebb575033611eb084610ac3565b6001600160a01b0316145b905080611edb57604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b0316826001600160a01b031614611f0c5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416611f3357604051633a954ecd60e21b815260040160405180910390fd5b611f3f60008484611e19565b6001600160a01b038086166000908152600460209081526040808320805460001901905592871680835283832080546001019055868352600390915291902080546001600160a01b03191690911790557f000000000000000000000000000000000000000000000000000000000000217483111561200f57600183016000818152600360205260409020546001600160a01b031661200d57611fe081611dc9565b1561200d57600081815260036020526040902080546001600160a01b0319166001600160a01b0385161790555b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b0384163b1561219b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906120eb903390899088908890600401612f13565b6020604051808303816000875af1925050508015612126575060408051601f3d908101601f1916820190925261212391810190612f4f565b60015b612181573d808015612154576040519150601f19603f3d011682016040523d82523d6000602084013e612159565b606091505b508051612179576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061219f565b5060015b949350505050565b6060600d8054610a4090612e07565b6060816121da5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561220457806121ee81612dcd565b91506121fd9050600a83612e58565b91506121de565b60008167ffffffffffffffff81111561221f5761221f612bb0565b6040519080825280601f01601f191660200182016040528015612249576020820181803683370190505b5090505b841561219f5761225e600183612e6c565b915061226b600a86612f6c565b612276906030612d9f565b60f81b81838151811061228b5761228b612db7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506122c5600a86612e58565b945061224d565b60008060006122db85856122f0565b915091506122e88161235d565b509392505050565b6000808251604114156123275760208301516040840151606085015160001a61231b87828585612518565b94509450505050610bf7565b8251604014156123515760208301516040840151612346868383612605565b935093505050610bf7565b50600090506002610bf7565b600081600481111561237157612371612f80565b141561237a5750565b600181600481111561238e5761238e612f80565b14156123dc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c42565b60028160048111156123f0576123f0612f80565b141561243e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c42565b600381600481111561245257612452612f80565b14156124ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c42565b60048160048111156124bf576124bf612f80565b1415610d925760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c42565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561254f57506000905060036125fc565b8460ff16601b1415801561256757508460ff16601c14155b1561257857506000905060046125fc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156125cc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166125f5576000600192509250506125fc565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83168161263b60ff86901c601b612d9f565b905061264987828885612518565b935093505050935093915050565b82805461266390612e07565b90600052602060002090601f01602090048101928261268557600085556126cb565b82601f1061269e5782800160ff198235161785556126cb565b828001600101855582156126cb579182015b828111156126cb5782358255916020019190600101906126b0565b506126d79291506126db565b5090565b5b808211156126d757600081556001016126dc565b6001600160e01b031981168114610d9257600080fd5b60006020828403121561271857600080fd5b8135611682816126f0565b60008083601f84011261273557600080fd5b50813567ffffffffffffffff81111561274d57600080fd5b602083019150836020828501011115610bf757600080fd5b60008083601f84011261277757600080fd5b50813567ffffffffffffffff81111561278f57600080fd5b6020830191508360208260051b8501011115610bf757600080fd5b60008060008060008060008060a0898b0312156127c657600080fd5b883567ffffffffffffffff808211156127de57600080fd5b6127ea8c838d01612723565b909a50985060208b013591508082111561280357600080fd5b61280f8c838d01612723565b909850965060408b013591508082111561282857600080fd5b506128358b828c01612765565b999c989b509699959896976060870135966080013595509350505050565b60005b8381101561286e578181015183820152602001612856565b838111156115fe5750506000910152565b60008151808452612897816020860160208601612853565b601f01601f19169290920160200192915050565b602081526000611682602083018461287f565b6000602082840312156128d057600080fd5b5035919050565b80356001600160a01b03811681146128ee57600080fd5b919050565b6000806040838503121561290657600080fd5b61290f836128d7565b946020939093013593505050565b60008060006060848603121561293257600080fd5b61293b846128d7565b9250612949602085016128d7565b9150604084013590509250925092565b6000806040838503121561296c57600080fd5b50508035926020909101359150565b6000806040838503121561298e57600080fd5b8235915061299e602084016128d7565b90509250929050565b60008060008060008060008060008060c08b8d0312156129c657600080fd5b8a3567ffffffffffffffff808211156129de57600080fd5b6129ea8e838f01612723565b909c509a5060208d0135915080821115612a0357600080fd5b612a0f8e838f01612723565b909a50985060408d0135915080821115612a2857600080fd5b612a348e838f01612765565b909850965060608d0135915080821115612a4d57600080fd5b50612a5a8d828e01612765565b9b9e9a9d50989b979a969995989760808101359660a09091013595509350505050565b60008060008060008060608789031215612a9657600080fd5b863567ffffffffffffffff80821115612aae57600080fd5b612aba8a838b01612723565b90985096506020890135915080821115612ad357600080fd5b612adf8a838b01612765565b90965094506040890135915080821115612af857600080fd5b50612b0589828a01612765565b979a9699509497509295939492505050565b60008060208385031215612b2a57600080fd5b823567ffffffffffffffff811115612b4157600080fd5b612b4d85828601612723565b90969095509350505050565b600060208284031215612b6b57600080fd5b611682826128d7565b60008060408385031215612b8757600080fd5b612b90836128d7565b915060208301358015158114612ba557600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612bdc57600080fd5b612be5856128d7565b9350612bf3602086016128d7565b925060408501359150606085013567ffffffffffffffff80821115612c1757600080fd5b818701915087601f830112612c2b57600080fd5b813581811115612c3d57612c3d612bb0565b604051601f8201601f19908116603f01168101908382118183101715612c6557612c65612bb0565b816040528281528a6020848701011115612c7e57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060008060408587031215612cb857600080fd5b843567ffffffffffffffff80821115612cd057600080fd5b612cdc88838901612723565b90965094506020870135915080821115612cf557600080fd5b50612d0287828801612765565b95989497509550505050565b60008060408385031215612d2157600080fd5b612d2a836128d7565b915061299e602084016128d7565b60008060008060608587031215612d4e57600080fd5b843567ffffffffffffffff811115612d6557600080fd5b612d7187828801612723565b90989097506020870135966040013595509350505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612db257612db2612d89565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415612de157612de1612d89565b5060010190565b6000816000190483118215151615612e0257612e02612d89565b500290565b600181811c90821680612e1b57607f821691505b60208210811415612e3c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601260045260246000fd5b600082612e6757612e67612e42565b500490565b600082821015612e7e57612e7e612d89565b500390565b60008351612e95818460208801612853565b835190830190612ea9818360208801612853565b01949350505050565b6bffffffffffffffffffffffff198460601b16815260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612ef657600080fd5b8260051b8085601485013760009201601401918252509392505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612f45608083018461287f565b9695505050505050565b600060208284031215612f6157600080fd5b8151611682816126f0565b600082612f7b57612f7b612e42565b500690565b634e487b7160e01b600052602160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220ccca2eca0f099829b05171228710748ca4e60c045de7f918a92e64e4788b972464736f6c634300080c0033

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

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