ETH Price: $2,622.40 (+7.72%)
 

Overview

Max Total Supply

436 AFUNDAMENTALDISPUTE

Holders

246

Market

Volume (24H)

0.065 ETH

Min Price (24H)

$170.46 @ 0.065000 ETH

Max Price (24H)

$170.46 @ 0.065000 ETH
Balance
1 AFUNDAMENTALDISPUTE
0xfB38cc51133eF30286229Be866A261C36C1E8F8C
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
AFundamentalDispute

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

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

import {NFT} from "./NFT.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {BitMaps} from "@openzeppelin/contracts/utils/structs/BitMaps.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

/// @author frolic.eth
/// @title  A Fundamental Dispute
contract AFundamentalDispute is NFT {
    using BitMaps for BitMaps.BitMap;

    uint256 public constant publicPrice = 0.12 ether;
    uint256 public constant holderPrice = 0.08 ether;

    IERC721 public immutable foldedFaces;
    BitMaps.BitMap internal foldedFacesUsed;

    address public sharedSigner;
    address public constant signatureNotRequired =
        address(bytes20(keccak256("signatureNotRequired")));

    event TokenDiscountUsed(address token, uint256 tokenId);
    event SharedSignerUpdated(
        address nextSharedSigner, address previousSharedSigner
    );

    // ****************** //
    // *** INITIALIZE *** //
    // ****************** //

    constructor(IERC721 _foldedFaces, address artist, address developer)
        NFT("A Fundamental Dispute", "AFUNDAMENTALDISPUTE", 436)
    {
        foldedFaces = _foldedFaces;

        // Mint ~10% of supply to creators in lieu of royalties
        _mintERC2309(artist, 21);
        _mintERC2309(developer, 21);
    }

    // ********************* //
    // *** SHARED SIGNER *** //
    // ********************* //

    error InvalidSignature();

    modifier hasValidSignature(bytes memory message, bytes memory signature) {
        if (sharedSigner != signatureNotRequired) {
            bytes32 messageHash = ECDSA.toEthSignedMessageHash(message);
            (address signer,) = ECDSA.tryRecover(messageHash, signature);
            if (signer != sharedSigner) {
                revert InvalidSignature();
            }
        }
        _;
    }

    // ******************* //
    // *** PUBLIC MINT *** //
    // ******************* //

    function mint(bytes memory signature)
        external
        payable
        hasExactPayment(publicPrice)
        withinMaxSupply
        withinMintLimit(2)
        hasValidSignature(abi.encode(msg.sender), signature)
    {
        _mint(msg.sender, 1);
    }

    // ******************* //
    // *** HOLDER MINT *** //
    // ******************* //

    error NoValidTokenDiscount(address token, uint256[] tokenIds);

    function hasUsedFoldedFaces(uint256 tokenId) public view returns (bool) {
        return foldedFacesUsed.get(tokenId);
    }

    function foldedFacesMint(
        uint256[] calldata tokenIds,
        bytes memory signature
    )
        external
        payable
        hasExactPayment(holderPrice)
        withinMaxSupply
        withinMintLimit(2)
        hasValidSignature(abi.encode(msg.sender), signature)
    {
        uint256 tokenId;
        for (uint256 i = 0; i < tokenIds.length; i++) {
            tokenId = tokenIds[i];
            if (foldedFacesUsed.get(tokenId)) continue;
            if (foldedFaces.ownerOf(tokenId) != msg.sender) continue;

            foldedFacesUsed.set(tokenId);
            emit TokenDiscountUsed(address(foldedFaces), tokenId);
            _mint(msg.sender, 1);
            return;
        }

        revert NoValidTokenDiscount(address(foldedFaces), tokenIds);
    }

    // **************** //
    // *** INTERNAL *** //
    // **************** //

    function setSharedSigner(address signer) external onlyOwner {
        emit SharedSignerUpdated(signer, sharedSigner);
        sharedSigner = signer;
    }

    function tokenSeed(uint256 tokenId) public view returns (uint24) {
        return uint24(
            uint256(
                keccak256(
                    abi.encode(tokenId, explicitOwnershipOf(tokenId).extraData)
                )
            )
        );
    }

    function generateSeed(bytes memory extraEntropy)
        public
        view
        returns (uint24)
    {
        return uint24(
            uint256(
                keccak256(
                    abi.encode(
                        block.difficulty,
                        blockhash(block.number - 1),
                        msg.sender,
                        extraEntropy
                    )
                )
            )
        );
    }

    function _extraData(address from, address to, uint24 previousExtraData)
        internal
        view
        override
        returns (uint24)
    {
        if (previousExtraData != 0) {
            return previousExtraData;
        }
        return generateSeed(abi.encode(from, to));
    }

    uint256 public lastDispute = block.number;
    uint256 public disputes = 218;

    function dispute(uint256 tokenId, bytes memory signature)
        external
        hasValidSignature(abi.encode(msg.sender, tokenId, lastDispute), signature)
    {
        require(disputes > 0, "It's time to listen");
        require(block.number - lastDispute >= 2180, "Now is not the time");
        require(_exists(tokenId), "There is nothing to dispute");
        require(msg.sender == ownerOf(tokenId), "We are in agreement");

        if (_ownershipAt(tokenId).extraData == 0) {
            _initializeOwnershipAt(tokenId);
        }
        if (
            tokenId + 1 < _nextTokenId()
                && _ownershipAt(tokenId + 1).extraData == 0
        ) {
            _initializeOwnershipAt(tokenId + 1);
        }

        disputes -= 1;
        lastDispute = block.number;
        _setExtraDataAt(tokenId, generateSeed(signature));
        emit MetadataUpdate(tokenId);
    }
}

File 2 of 21 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);

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

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = _packedOwnerships[tokenId];
            // If not burned.
            if (packed & _BITMASK_BURNED == 0) {
                // If the data at the starting slot does not exist, start the scan.
                if (packed == 0) {
                    if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
                    // Invariant:
                    // There will always be an initialized ownership slot
                    // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                    // before an unintialized ownership slot
                    // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                    // Hence, `tokenId` will not underflow.
                    //
                    // We can directly compare the packed value.
                    // If the address is zero, packed will be zero.
                    for (;;) {
                        unchecked {
                            packed = _packedOwnerships[--tokenId];
                        }
                        if (packed == 0) continue;
                        return packed;
                    }
                }
                // Otherwise, the data exists and is not burned. We can skip the scan.
                // This is possible because we have already achieved the target condition.
                // This saves 2143 gas on transfers of initialized tokens.
                return packed;
            }
        }
        _revert(OwnerQueryForNonexistentToken.selector);
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     */
    function approve(address to, uint256 tokenId) public payable virtual override {
        _approve(to, tokenId, true);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
        from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));

        if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // 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 {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
        uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
        assembly {
            // Emit the `Transfer` event.
            log4(
                0, // Start of data (0, since no data).
                0, // End of data (0, since no data).
                _TRANSFER_EVENT_SIGNATURE, // Signature.
                from, // `from`.
                toMasked, // `to`.
                tokenId // `tokenId`.
            )
        }
        if (toMasked == 0) _revert(TransferToZeroAddress.selector);

        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                _revert(TransferToNonERC721ReceiverImplementer.selector);
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                _revert(TransferToNonERC721ReceiverImplementer.selector);
            }
            assembly {
                revert(add(32, reason), mload(reason))
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @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 for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) _revert(MintZeroQuantity.selector);

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
            uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;

            if (toMasked == 0) _revert(MintToZeroAddress.selector);

            uint256 end = startTokenId + quantity;
            uint256 tokenId = startTokenId;

            do {
                assembly {
                    // Emit the `Transfer` event.
                    log4(
                        0, // Start of data (0, since no data).
                        0, // End of data (0, since no data).
                        _TRANSFER_EVENT_SIGNATURE, // Signature.
                        0, // `address(0)`.
                        toMasked, // `to`.
                        tokenId // `tokenId`.
                    )
                }
                // The `!=` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
            } while (++tokenId != end);

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) _revert(MintToZeroAddress.selector);
        if (quantity == 0) _revert(MintZeroQuantity.selector);
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        _revert(TransferToNonERC721ReceiverImplementer.selector);
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) _revert(bytes4(0));
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                       APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_approve(to, tokenId, false)`.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _approve(to, tokenId, false);
    }

    /**
     * @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:
     *
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        bool approvalCheck
    ) internal virtual {
        address owner = ownerOf(tokenId);

        if (approvalCheck && _msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                _revert(ApprovalCallerNotOwnerNorApproved.selector);
            }

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

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

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // 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 {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }

    /**
     * @dev For more efficient reverts.
     */
    function _revert(bytes4 errorSelector) internal pure {
        assembly {
            mstore(0x00, errorSelector)
            revert(0x00, 0x04)
        }
    }
}

File 3 of 21 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` 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 payable;

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

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

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 4 of 21 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AQueryable.sol';
import '../ERC721A.sol';

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (TokenOwnership memory ownership)
    {
        if (tokenId >= _startTokenId()) {
            if (tokenId < _nextTokenId()) {
                ownership = _ownershipAt(tokenId);
                if (!ownership.burned) {
                    ownership = _ownershipOf(tokenId);
                }
            }
        }
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        TokenOwnership[] memory ownerships;
        uint256 i = tokenIds.length;
        assembly {
            // Grab the free memory pointer.
            ownerships := mload(0x40)
            // Store the length.
            mstore(ownerships, i)
            // Allocate one word for the length,
            // `tokenIds.length` words for the pointers.
            i := shl(5, i) // Multiply `i` by 32.
            mstore(0x40, add(add(ownerships, 0x20), i))
        }
        while (i != 0) {
            uint256 tokenId;
            assembly {
                i := sub(i, 0x20)
                tokenId := calldataload(add(tokenIds.offset, i))
            }
            TokenOwnership memory ownership = explicitOwnershipOf(tokenId);
            assembly {
                // Store the pointer of `ownership` in the `ownerships` array.
                mstore(add(add(ownerships, 0x20), i), ownership)
            }
        }
        return ownerships;
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) _revert(InvalidQueryRange.selector);
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            uint256 stopLimit = _nextTokenId();
            // Set `stop = min(stop, stopLimit)`.
            if (stop >= stopLimit) {
                stop = stopLimit;
            }
            uint256[] memory tokenIds;
            uint256 tokenIdsMaxLength = balanceOf(owner);
            bool startLtStop = start < stop;
            assembly {
                // Set `tokenIdsMaxLength` to zero if `start` is less than `stop`.
                tokenIdsMaxLength := mul(tokenIdsMaxLength, startLtStop)
            }
            if (tokenIdsMaxLength != 0) {
                // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
                // to cater for cases where `balanceOf(owner)` is too big.
                if (stop - start <= tokenIdsMaxLength) {
                    tokenIdsMaxLength = stop - start;
                }
                assembly {
                    // Grab the free memory pointer.
                    tokenIds := mload(0x40)
                    // Allocate one word for the length, and `tokenIdsMaxLength` words
                    // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
                    mstore(0x40, add(tokenIds, shl(5, add(tokenIdsMaxLength, 1))))
                }
                // We need to call `explicitOwnershipOf(start)`,
                // because the slot at `start` may not be initialized.
                TokenOwnership memory ownership = explicitOwnershipOf(start);
                address currOwnershipAddr;
                // If the starting slot exists (i.e. not burned),
                // initialize `currOwnershipAddr`.
                // `ownership.address` will not be zero,
                // as `start` is clamped to the valid token ID range.
                if (!ownership.burned) {
                    currOwnershipAddr = ownership.addr;
                }
                uint256 tokenIdsIdx;
                // Use a do-while, which is slightly more efficient for this case,
                // as the array will at least contain one element.
                do {
                    ownership = _ownershipAt(start);
                    assembly {
                        // if `ownership.burned == false`.
                        if iszero(mload(add(ownership, 0x40))) {
                            // if `ownership.addr != address(0)`.
                            // The `addr` already has it's upper 96 bits clearned,
                            // since it is written to memory with regular Solidity.
                            if mload(ownership) {
                                currOwnershipAddr := mload(ownership)
                            }
                            // if `currOwnershipAddr == owner`.
                            // The `shl(96, x)` is to make the comparison agnostic to any
                            // dirty upper 96 bits in `owner`.
                            if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                                tokenIdsIdx := add(tokenIdsIdx, 1)
                                mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)
                            }
                        }
                        start := add(start, 1)
                    }
                } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));
                // Store the length of the array.
                assembly {
                    mstore(tokenIds, tokenIdsIdx)
                }
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
        uint256 tokenIdsLength = balanceOf(owner);
        uint256[] memory tokenIds;
        assembly {
            // Grab the free memory pointer.
            tokenIds := mload(0x40)
            // Allocate one word for the length, and `tokenIdsMaxLength` words
            // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
            mstore(0x40, add(tokenIds, shl(5, add(tokenIdsLength, 1))))
            // Store the length of `tokenIds`.
            mstore(tokenIds, tokenIdsLength)
        }
        address currOwnershipAddr;
        uint256 tokenIdsIdx;
        for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ) {
            TokenOwnership memory ownership = _ownershipAt(i);
            assembly {
                // if `ownership.burned == false`.
                if iszero(mload(add(ownership, 0x40))) {
                    // if `ownership.addr != address(0)`.
                    // The `addr` already has it's upper 96 bits clearned,
                    // since it is written to memory with regular Solidity.
                    if mload(ownership) {
                        currOwnershipAddr := mload(ownership)
                    }
                    // if `currOwnershipAddr == owner`.
                    // The `shl(96, x)` is to make the comparison agnostic to any
                    // dirty upper 96 bits in `owner`.
                    if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                        tokenIdsIdx := add(tokenIdsIdx, 1)
                        mstore(add(tokenIds, shl(5, tokenIdsIdx)), i)
                    }
                }
                i := add(i, 1)
            }
        }
        return tokenIds;
    }
}

File 5 of 21 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 7 of 21 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/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 paid in that same unit of exchange.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

File 8 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 9 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

File 10 of 21 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

File 11 of 21 : 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 12 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 13 of 21 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 // Deprecated in v4.8
    }

    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");
        }
    }

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

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

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

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

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

        // If 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 14 of 21 : 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 15 of 21 : 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 16 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

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

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 17 of 21 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 18 of 21 : BitMaps.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/BitMaps.sol)
pragma solidity ^0.8.0;

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */
library BitMaps {
    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(BitMap storage bitmap, uint256 index, bool value) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }
}

File 19 of 21 : IRenderer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

/// @author frolic.eth
/// @title  Upgradeable renderer interface
/// @notice This leaves room for us to change how we return token metadata and
///         unlocks future capability like fully on-chain storage.
interface IRenderer {
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 20 of 21 : NFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {ERC721A, IERC721A} from "erc721a/contracts/ERC721A.sol";
import {ERC721AQueryable} from
    "erc721a/contracts/extensions/ERC721AQueryable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
    ERC2981,
    IERC2981,
    IERC165
} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {IRenderer} from "./IRenderer.sol";
import {OwnablePayable} from "./OwnablePayable.sol";

/// @author frolic.eth
/// @title  ERC721 base contract
/// @notice ERC721-specific functionality to keep the actual NFT contract more
///         readable and focused on the mint/project mechanics.
abstract contract NFT is ERC721A, ERC721AQueryable, OwnablePayable, ERC2981 {
    uint256 public immutable maxSupply;
    // TODO: upgradeable transfer hooks?

    IERC2981 public royaltyProvider;
    IRenderer public renderer;
    string public baseTokenURI;

    event Initialized();
    event RendererUpdated(IRenderer previousRenderer, IRenderer newRenderer);
    event BaseTokenURIUpdated(
        string previousBaseTokenURI, string newBaseTokenURI
    );

    // https://eips.ethereum.org/EIPS/eip-4906
    event MetadataUpdate(uint256 _tokenId);
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

    // ****************** //
    // *** INITIALIZE *** //
    // ****************** //

    constructor(string memory name, string memory symbol, uint256 _maxSupply)
        ERC721A(name, symbol)
    {
        maxSupply = _maxSupply;
        emit Initialized();
    }

    function _startTokenId() internal pure override returns (uint256) {
        return 1;
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721A, IERC721A, ERC2981)
        returns (bool)
    {
        return ERC721A.supportsInterface(interfaceId)
            || ERC2981.supportsInterface(interfaceId);
    }

    // ************ //
    // *** MINT *** //
    // ************ //

    error MintLimitExceeded(uint256 mintsLeft);
    error MaxSupplyExceeded(uint256 mintsLeft);
    error WrongPayment(uint256 expectedPayment);

    modifier withinMintLimit(uint256 limit) {
        uint256 numMinted = _numberMinted(msg.sender);
        if (numMinted + 1 > limit) {
            revert MintLimitExceeded(limit - numMinted);
        }
        _;
    }

    modifier withinMaxSupply() {
        uint256 numMinted = _totalMinted();
        if (numMinted + 1 > maxSupply) {
            revert MaxSupplyExceeded(maxSupply - numMinted);
        }
        _;
    }

    function totalMinted() public view returns (uint256) {
        return _totalMinted();
    }

    function numberMinted(address owner) public view returns (uint256) {
        return _numberMinted(owner);
    }

    modifier hasExactPayment(uint256 expectedPayment) {
        if (msg.value != expectedPayment) {
            revert WrongPayment(expectedPayment);
        }
        _;
    }

    // ****************** //
    // *** AFTER MINT *** //
    // ****************** //

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

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721A, IERC721A)
        returns (string memory)
    {
        if (address(renderer) != address(0)) {
            return renderer.tokenURI(tokenId);
        }
        return super.tokenURI(tokenId);
    }

    // ***************** //
    // *** ROYALTIES *** //
    // ***************** //

    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        public
        view
        override
        returns (address, uint256)
    {
        if (address(royaltyProvider) != address(0)) {
            return royaltyProvider.royaltyInfo(tokenId, salePrice);
        }
        return super.royaltyInfo(tokenId, salePrice);
    }

    // ************* //
    // *** ADMIN *** //
    // ************* //

    function setRoyaltyProvider(IERC2981 _royaltyProvider) external onlyOwner {
        royaltyProvider = _royaltyProvider;
    }

    function setDefaultRoyalty(uint96 _royaltyBasisPoints) external onlyOwner {
        _setDefaultRoyalty(address(this), _royaltyBasisPoints);
    }

    function setRenderer(IRenderer _renderer) external onlyOwner {
        emit RendererUpdated(renderer, _renderer);
        emit BatchMetadataUpdate(_startTokenId(), _totalMinted());
        renderer = _renderer;
    }

    function setBaseTokenURI(string calldata _baseTokenURI)
        external
        onlyOwner
    {
        emit BaseTokenURIUpdated(baseTokenURI, _baseTokenURI);
        emit BatchMetadataUpdate(_startTokenId(), _totalMinted());
        baseTokenURI = _baseTokenURI;
    }

    // Can be run any time after mint to optimize gas for future transfers
    function normalizeOwnership(uint256 startTokenId, uint256 quantity)
        external
    {
        for (uint256 i = 0; i < quantity; i++) {
            _initializeOwnershipAt(startTokenId + i);
        }
    }
}

File 21 of 21 : OwnablePayable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/// @author frolic.eth
/// @title Payable utilities to make sure we can withdraw all funds/tokens
contract OwnablePayable is Ownable {
    function withdrawAll(address to) external onlyOwner {
        require(address(this).balance > 0, "Zero balance");
        (bool sent,) = to.call{value: address(this).balance}("");
        require(sent, "Failed to withdraw");
    }

    function withdrawAllERC20(IERC20 token, address to) external onlyOwner {
        token.transfer(to, token.balanceOf(address(this)));
    }

    function withdrawERC721(IERC721 token, uint256 tokenId, address to)
        external
        onlyOwner
    {
        token.safeTransferFrom(address(this), to, tokenId);
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=packages/contracts/lib/openzeppelin-contracts/",
    "ERC721A/=packages/contracts/lib/ERC721A/contracts/",
    "ds-test/=packages/contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=packages/contracts/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "erc721a/=packages/contracts/lib/ERC721A/",
    "ethfs/=packages/contracts/lib/ethfs/packages/contracts/src/",
    "ethier/=packages/contracts/lib/ethfs/packages/contracts/lib/ethier/",
    "forge-std/=packages/contracts/lib/forge-std/src/",
    "openzeppelin-contracts/=packages/contracts/lib/openzeppelin-contracts/",
    "openzeppelin/=packages/contracts/lib/ethfs/packages/contracts/lib/openzeppelin-contracts/contracts/",
    "solady/=packages/contracts/lib/ethfs/packages/contracts/lib/solady/src/",
    "solmate/=packages/contracts/lib/ethfs/packages/contracts/lib/solady/lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC721","name":"_foldedFaces","type":"address"},{"internalType":"address","name":"artist","type":"address"},{"internalType":"address","name":"developer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"mintsLeft","type":"uint256"}],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[{"internalType":"uint256","name":"mintsLeft","type":"uint256"}],"name":"MintLimitExceeded","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"NoValidTokenDiscount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"expectedPayment","type":"uint256"}],"name":"WrongPayment","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"previousBaseTokenURI","type":"string"},{"indexed":false,"internalType":"string","name":"newBaseTokenURI","type":"string"}],"name":"BaseTokenURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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":"contract IRenderer","name":"previousRenderer","type":"address"},{"indexed":false,"internalType":"contract IRenderer","name":"newRenderer","type":"address"}],"name":"RendererUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nextSharedSigner","type":"address"},{"indexed":false,"internalType":"address","name":"previousSharedSigner","type":"address"}],"name":"SharedSignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenDiscountUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"dispute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disputes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"ownership","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"foldedFaces","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"foldedFacesMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"extraEntropy","type":"bytes"}],"name":"generateSeed","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"hasUsedFoldedFaces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"holderPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"lastDispute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"normalizeOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"numberMinted","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":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderer","outputs":[{"internalType":"contract IRenderer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyProvider","outputs":[{"internalType":"contract IERC2981","name":"","type":"address"}],"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":"payable","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":"payable","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":"_baseTokenURI","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_royaltyBasisPoints","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRenderer","name":"_renderer","type":"address"}],"name":"setRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC2981","name":"_royaltyProvider","type":"address"}],"name":"setRoyaltyProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSharedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"signatureNotRequired","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSeed","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawAllERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405234620000b157606062003b523881900390819060c0601f8301601f19168101906001600160401b03821190821017620000b6575b60405260c03912620000b1576200007a60c051620000568162000148565b60e051620000648162000148565b6101005191620000748362000148565b62000184565b60405161341d9081620007358239608051818181610913015281816112890152611c90015260a051818181610a9c0152612b430152f35b600080fd5b620000c0620000c6565b62000038565b50634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b03821117620000f957604052565b62000103620000c6565b604052565b606081019081106001600160401b03821117620000f957604052565b601f909101601f19168101906001600160401b03821190821017620000f957604052565b6001600160a01b03811603620000b157565b604051906200016982620000dd565b60158252565b604051906200017e82620000dd565b60138252565b6200018e6200015a565b6020907f412046756e64616d656e74616c2044697370757465000000000000000000000082820152620001c06200016f565b7f4146554e44414d454e54414c4449535055544500000000000000000000000000838201528151909290916001600160401b0383116200036b575b62000213836200020d6002546200037b565b620003b8565b81601f8411600114620002ce57509282620002ba95936200025993620002c0999896600092620002c2575b50508160011b916000199060031b1c1916176002556200046a565b620002646001600055565b6200026f33620006e6565b6101b46080527f5daa87a0e9463431830481fd4b6e3403442dfb9a12b9c07597e9f61d50b633c86000604051a1620002a643601055565b620002b160da601155565b60a0526200056e565b6200056e565b565b0151905038806200023e565b60026000529190601f1984167f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000905b82821062000352575050936200025993620002c09998969360019383620002ba9a981062000338575b505050811b016002556200046a565b015160001960f88460031b161c1916905538808062000329565b8060018697829497870151815501960194019062000300565b62000375620000c6565b620001fb565b90600182811c92168015620003ad575b60208310146200039757565b634e487b7160e01b600052602260045260246000fd5b91607f16916200038b565b601f8111620003c5575050565b6000906002825260208220906020601f850160051c8301941062000406575b601f0160051c01915b828110620003fa57505050565b818155600101620003ed565b9092508290620003e4565b601f81116200041e575050565b6000906003825260208220906020601f850160051c830194106200045f575b601f0160051c01915b8281106200045357505050565b81815560010162000446565b90925082906200043d565b80519091906001600160401b0381116200055e575b6200049781620004916003546200037b565b62000411565b602080601f8311600114620004d65750819293600092620004ca575b50508160011b916000199060031b1c191617600355565b015190503880620004b3565b6003600052601f198316949091907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b926000905b878210620005455750508360019596106200052b575b505050811b01600355565b015160001960f88460031b161c1916905538808062000520565b806001859682949686015181550195019301906200050a565b62000568620000c6565b6200047f565b600080549192916001600160a01b0384168015620006d857808352602060058152604080852068150000000000000015815401905580519685838901528382890152818852620005be8862000108565b60014310620006c45781518381014481526000194301408483015233606083015260808083015289518060a0840152885b818110620006af57899a9b509383620006698a97946200065660c060159e9b98876200067f987fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d9c11620006a2575b601f801991011681010360a081018652018462000124565b62ffffff60e81b9251902062ffffff1690565b60e81b164260a01b179060018060a01b03161790565b62000694856000526004602052604060002090565b5551601484018152a4019055565b8d8382840101526200063e565b8b810187015184820160c001528601620005ef565b634e487b7160e01b86526011600452602486fd5b622e076360e81b8352600483fd5b600880546001600160a01b039283166001600160a01b031982168117909255604051919216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a356fe60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a7146103fb5780630378ab98146103f257806306fdde03146103e9578063081812fc146103e0578063095ea7b3146103d75780630e07b3aa146103ce578063105ea6d3146103c557806318160ddd146103bc57806323b872dd146103b35780632a55205a146103aa57806330176e13146103a157806333bc51c71461039857806342842e0e1461038f57806352f0832a1461038657806355ea73281461037d57806356d3163d1461037457806359edf34e1461036b5780635bbb2177146103625780635f516836146103595780635f7c7cca146103505780636352211e1461034757806370a082311461033e578063715018a6146103355780637b9f76b51461032c5780637ba0e2e7146103235780638462151c1461031a5780638ada6b0f146103115780638da5cb5b1461030857806392556632146102ff57806395d89b41146102f657806399a2557a146102ed578063a22cb465146102e4578063a2309ff8146102db578063a945bf80146102d2578063ae11c7f8146102c9578063aeb6c233146102c0578063b88d4fde146102b7578063b9b8f4d8146102ae578063c23dc68f146102a5578063c87b56dd1461029c578063d4c5b25214610293578063d547cfb71461028a578063d5abeb0114610281578063d6948b7514610278578063dc33e6811461026f578063e985e9c514610266578063f2fde38b1461025d578063f82d578a14610254578063fa09e6301461024b5763fe018d841461024357600080fd5b61000e612086565b5061000e611fd0565b5061000e611f18565b5061000e611e48565b5061000e611ddf565b5061000e611d97565b5061000e611cb3565b5061000e611c77565b5061000e611be1565b5061000e611b00565b5061000e611acc565b5061000e611a68565b5061000e611a20565b5061000e6119ce565b5061000e6119a8565b5061000e61187f565b5061000e61185b565b5061000e611838565b5061000e6117a2565b5061000e611602565b5061000e61155a565b5061000e61152a565b5061000e611500565b5061000e6114d6565b5061000e611430565b5061000e611257565b5061000e611186565b5061000e611124565b5061000e6110f4565b5061000e6110c4565b5061000e611081565b5061000e611012565b5061000e610f99565b5061000e610ef1565b5061000e610e41565b5061000e610e1d565b5061000e610dca565b5061000e610da6565b5061000e610d2a565b5061000e610b71565b5061000e610b34565b5061000e610b1f565b5061000e610acb565b5061000e610a85565b5061000e6108a2565b5061000e61068b565b5061000e610626565b5061000e610549565b5061000e6104b1565b5061000e610416565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561043681610404565b63ffffffff60e01b166301ffc9a760e01b811490819082156104a0575b821561048f575b821561046d575b50506040519015158152f35b63152a902d60e11b1491508115610487575b503880610461565b90503861047f565b635b5e139f60e01b8114925061045a565b6380ac58cd60e01b81149250610453565b503461000e57600036600319011261000e57600f546040516001600160a01b039091168152602090f35b918091926000905b8282106104fb5750116104f4575050565b6000910152565b915080602091830151818601520182916104e3565b90602091610529815180928185528580860191016104db565b601f01601f1916010190565b906020610546928181520190610510565b90565b503461000e5760008060031936011261062357604051908060025461056d81611b1f565b8085529160019180831690811561060257506001146105a7575b6105a38561059781870382610801565b60405191829182610535565b0390f35b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b8284106105ea575050508101602001610597826105a3610587565b805460208587018101919091529093019281016105cf565b60ff19166020870152505060408401925061059791508390506105a3610587565b80fd5b503461000e57602036600319011261000e5760043561064481612182565b15610669576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b6001600160a01b0381160361000e57565b50604036600319011261000e576004356106a48161067a565b6001600160a01b0390602435826106ba826120df565b16803303610717575b600082815260066020526040812080546001600160a01b0319166001600160a01b038616179055936040519316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258585a4f35b600081815260076020908152604080832033845290915290205460ff166106c3576367d9dca160e11b60005260046000fd5b9181601f8401121561000e578235916001600160401b03831161000e576020808501948460051b01011161000e57565b50634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116107a357604052565b6107ab610779565b604052565b604081019081106001600160401b038211176107a357604052565b602081019081106001600160401b038211176107a357604052565b606081019081106001600160401b038211176107a357604052565b90601f801991011681019081106001600160401b038211176107a357604052565b6040519061082f826107b0565b565b6020906001600160401b03811161084e575b601f01601f19160190565b610856610779565b610843565b81601f8201121561000e5780359061087282610831565b926108806040519485610801565b8284526020838301011161000e57816000926020809301838601378301015290565b5060408060031936011261000e576004906001600160401b03823581811161000e576108d19036908501610749565b93909160243590811161000e576108eb903690830161085b565b67011c37937e080000803403610a6f575060005460011990600019810190828211610a62575b7f000000000000000000000000000000000000000000000000000000000000000091828211610a31575050336000908152600560205260409081902054901c6001600160401b03169050908111610a24575b600260018201116109f4575083519033602083015260208252610985826107b0565b600f546001600160a01b039081169290919073e94098906c4bd7c9d8e2706159d226c5bc72b7371984016109c4575b6000876109c18a89612b38565b51f35b906109d16109d6926128eb565b612810565b5016036109e657808080806109b4565b8251638baa579f60e01b8152fd5b808386602493600210610a17575b5191637e0311c360e11b835260020390820152fd5b610a1f61268e565b610a02565b610a2c61268e565b610963565b6001839289889360249610610a55575b5163cbbf111360e01b815293030190820152fd5b610a5d61268e565b610a41565b610a6a61268e565b610911565b8260249186519163b23bee0560e01b8352820152fd5b503461000e57600036600319011261000e576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461000e57600036600319011261000e576000546001546040519103600019018152602090f35b606090600319011261000e57600435610b0b8161067a565b90602435610b188161067a565b9060443590565b50610b32610b2c36610af3565b916121bd565b005b503461000e57604036600319011261000e57610b546024356004356131d6565b604080516001600160a01b03939093168352602083019190915290f35b503461000e5760208060031936011261000e57600435906001600160401b0380831161000e573660238401121561000e57826004013590811161000e576024903682828601011161000e57610bc4612636565b604092835194848652610bd8858701611b59565b938685038388015283855283818301848701377f19c1a81f34d9a8d208a44017474815e9089aff4b57e461c08509577eea2c3900600097888587890101528481601f199889601f8a011601030190a16000199283885401927f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c88805160019687825285820152a1610c7386610c6e600d54611b1f565b61336d565b8891601f8711600114610caf575085965090859392918996610ca2575b5050501b9260031b1c191617600d5551f35b0101359350388080610c90565b9490939686908116610cd1600d6000526000805160206133f183398151915290565b968b905b8a838310610d0e5750505010610cf4575b5050505050811b01600d5551f35b60f88660031b161c19920101351690553880808080610ce6565b8887018801358a55909801979485019489935090810190610cd5565b503461000e57602036600319011261000e57600435610d488161067a565b610d50612636565b600f54604080516001600160a01b03848116825280841660208301529293917fd9c1a818d3059379d98e9173f10c617e05fb6e1d11051d2abeb3c1e7c8b7046891a16001600160a01b0319909216911617600f55005b50610b32610db336610af3565b9060405192610dc1846107cb565b6000845261238b565b503461000e57604036600319011261000e5760043560243560005b818110610dee57005b80610e0b91198411610e10575b610e06818501612fd7565b612aaf565b610de5565b610e1861268e565b610dfb565b503461000e57600036600319011261000e57602060405167011c37937e0800008152f35b503461000e57602036600319011261000e57600435610e5f8161067a565b610e67612636565b600c54604080516001600160a01b03808416825290931660208401819052927f10e9b6d73105db46c6a41a698f35efb8e1688178fe274b7b21f0bdc792de3ea59190a17f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c604060001960005401815190600182526020820152a16001600160a01b03191617600c55005b503461000e57600036600319011261000e57600b546040516001600160a01b039091168152602090f35b6020908160408183019282815285518094520193019160005b828110610f42575050505090565b9091929382608082610f8d600194895162ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565b01950193929101610f34565b503461000e57602036600319011261000e576004356001600160401b03811161000e57610fca903690600401610749565b906040519180835260051b6020818401016040525b8081801561100457610ffb90601f198091019385010135612583565b90840152610fdf565b604051806105a38782610f1b565b503461000e57602036600319011261000e57602060043562ffffff80606061103984612583565b015116916040519284840191825260408401526040835260608301928084106001600160401b03851117611074575b83604052519020168152f35b61107c610779565b611068565b503461000e57602036600319011261000e5760206110ba60043560ff6001918060081c600052600e602052161b60406000205416151590565b6040519015158152f35b503461000e57602036600319011261000e5760206001600160a01b036110eb6004356120df565b16604051908152f35b503461000e57602036600319011261000e57602061111c6004356111178161067a565b6120a5565b604051908152f35b503461000e576000806003193601126106235761113f612636565b600880546001600160a01b031981169091556040519082906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08284a3f35b503461000e5760006060366003190112610623576004356111a68161067a565b81604435916111b48361067a565b6111bc612636565b6001600160a01b0390811692833b1561122957606490836040519586948593632142170760e11b855230600486015216602484015260243560448401525af1801561121c575b61120d575b50604051f35b61121690610790565b38611207565b6112246123e3565b611202565b8280fd5b602060031982011261000e57600435906001600160401b03821161000e576105469160040161085b565b506112613661122d565b6701aa535d3d0c00008034036113dd5750600054600119906000198101908282116113d0575b7f00000000000000000000000000000000000000000000000000000000000000009182821161139e575050336000908152600560205260409081902054901c6001600160401b03169050908111611391575b600260018201116113605750604051336020820152602081526112fb816107b0565b600f546001600160a01b039081169290919073e94098906c4bd7c9d8e2706159d226c5bc72b737198401611332575b610b326126f5565b6109d161133e926128eb565b50160361134e573880808061132a565b604051638baa579f60e01b8152600490fd5b80602491600210611384575b60405190637e0311c360e11b82526002036004820152fd5b61138c61268e565b61136c565b61139961268e565b6112d9565b8291600191602494106113c3575b60405163cbbf111360e01b81529203016004820152fd5b6113cb61268e565b6113ac565b6113d861268e565b611287565b6024906040519063b23bee0560e01b82526004820152fd5b6020908160408183019282815285518094520193019160005b82811061141c575050505090565b83518552938101939281019260010161140e565b503461000e57602036600319011261000e5760043561144e8161067a565b611457816120a5565b6040805191600193600590858301821b8501845282855260009081875b858403611488578651806105a38a826113f5565b806114938a926125d8565b88810151156114a4575b5001611474565b51806114ce575b5083831860601b156114be575b3861149d565b938101938085871b8a01526114b8565b9250386114ab565b503461000e57600036600319011261000e57600c546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e576008546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e57602060405173e94098906c4bd7c9d8e2706159d226c5bc72b7388152f35b503461000e5760008060031936011261062357604051908060035461157e81611b1f565b8085529160019180831690811561060257506001146115a7576105a38561059781870382610801565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106115ea575050508101602001610597826105a3610587565b805460208587018101919091529093019281016115cf565b503461000e5760608060031936011261000e576004356116218161067a565b602435604435908082948383101561178b575b6001809310611783575b60009384548091101561177b575b508094611658816120a5565b8784100280611670575b604051806105a389826113f5565b9091928094959650870381811115611773575b50604080519686830160051b8801825261169c86612583565b9281936116b26116ae85830151151590565b1590565b611761575b5081999796999787805b6116e1575b5050505050505050506105a392508152388080808080611662565b99989915611740575b826116f48c6125d8565b858101511561170c575b5088809a9b9c019b996116c1565b5180611738575b50868618881b15611725575b386116fe565b998801600581901b8a018c90529961171f565b955038611713565b808b148015611758575b156116ea57809998996116c6565b50818a1461174a565b516001600160a01b03169350386116b7565b905038611683565b95503861164c565b82915061163e565b6117936124e7565b611634565b8015150361000e57565b503461000e57604036600319011261000e576004356117c08161067a565b602435906117cd82611798565b3360009081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e57600036600319011261000e57602060001960005401604051908152f35b503461000e57600036600319011261000e5760206040516701aa535d3d0c00008152f35b503461000e57604036600319011261000e5760043561189d8161067a565b611928602435916118ad8361067a565b6118b5612636565b6040516370a0823160e01b815230600482015260209384926001600160a01b0316908383602481855afa92831561199b575b60009361196c575b5060405163a9059cbb60e01b81526001600160a01b03909116600482015260248101929092529092839190829060009082906044820190565b03925af1801561195f575b61193957005b81610b3292903d10611958575b6119508183610801565b8101906133db565b503d611946565b6119676123e3565b611933565b61198d919350843d8611611994575b6119858183610801565b8101906133cc565b91386118ef565b503d61197b565b6119a36123e3565b6118e7565b503461000e5760206119c16119bc3661122d565b612ce8565b62ffffff60405191168152f35b50608036600319011261000e576004356119e78161067a565b6024356119f38161067a565b606435916001600160401b03831161000e57611a16610b3293369060040161085b565b916044359161238b565b503461000e57602036600319011261000e57600435611a3e8161067a565b611a46612636565b600b80546001600160a01b0319166001600160a01b0392909216919091179055005b503461000e57602036600319011261000e576080611a87600435612583565b611aca604051809262ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565bf35b503461000e57602036600319011261000e576105a3611aec600435613046565b604051918291602083526020830190610510565b503461000e57600036600319011261000e576020601154604051908152f35b90600182811c92168015611b4f575b6020831014611b3957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611b2e565b600d5460009291611b6982611b1f565b80825291600190818116908115611bce5750600114611b8757505050565b91929350600d6000526000805160206133f1833981519152916000925b848410611bb657505060209250010190565b80546020858501810191909152909301928101611ba4565b60ff191660208401525050604001925050565b503461000e57600080600319360112610623576040519080600d54611c0581611b1f565b808552916001918083169081156106025750600114611c2e576105a38561059781870382610801565b9250600d83526000805160206133f18339815191525b828410611c5f575050508101602001610597826105a3610587565b80546020858701810191909152909301928101611c44565b503461000e57600036600319011261000e5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461000e57602036600319011261000e576004356001600160601b03811680820361000e5761271090611ce5612636565b11611d3f57610b3290611cf9301515613321565b611d18611d04610822565b308152916001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600955565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b503461000e57602036600319011261000e57602061111c600435611dba8161067a565b60018060a01b031660005260056020526001600160401b0360406000205460401c1690565b503461000e57604036600319011261000e57602060ff611e3c600435611e048161067a565b60243590611e118261067a565b60018060a01b03166000526007845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b503461000e57602036600319011261000e57600435611e668161067a565b611e6e612636565b6001600160a01b03908116908115611ec45760009160085491816001600160601b0360a01b84161760085560405192167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08484a3f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b503461000e57604036600319011261000e576004356024356001600160401b03811161000e57611f4c90369060040161085b565b601054604080513360208201529081018490526060810191909152611f7e81608081015b03601f198101835282610801565b600f546001600160a01b039081169173e94098906c4bd7c9d8e2706159d226c5bc72b737198301611fb4575b610b328486612e8e565b836109d1611fc1926128eb565b50160361134e57388080611faa565b503461000e57602036600319011261000e57600435611fee8161067a565b611ff6612636565b471561205257600080809247604051915af16120106123f0565b501561201857005b60405162461bcd60e51b81526020600482015260126024820152714661696c656420746f20776974686472617760701b6044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b5a65726f2062616c616e636560a01b6044820152606490fd5b503461000e57600036600319011261000e576020601054604051908152f35b6001600160a01b031680156120ce5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b600090600190808211156120fd575b636f96cda160e11b8352600483fd5b8083526004602052604083205491600160e01b83161561211d57506120ee565b909192831561212d575b50505090565b8054831015612173575090815b6121445780612127565b9091506000190161215f816000526004602052604060002090565b5491821561216c57505090565b908161213a565b636f96cda160e11b8152600490fd5b806001111590816121b1575b81612197575090565b90506000526004602052600160e01b604060002054161590565b6000548110915061218e565b9190916121c9826120df565b6001600160a01b03918216939082811685900361237e575b6000848152600660205260409020805461220a6001600160a01b03881633908114908314171590565b612328575b61231e575b506001600160a01b038581166000908152600560205260408082208054600019019055918416815220805460010190556001600160e81b031961225c60e883901c8488612d3d565b60e81b1661227f600160e11b91821784904260a01b179060018060a01b03161790565b612293866000526004602052604060002090565b558116156122d4575b501680927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4156122cc57565b61082f61251c565b600184016122ec816000526004602052604060002090565b54156122f9575b5061229c565b60005481146122f357612316906000526004602052604060002090565b5538806122f3565b6000905538612214565b61236c6116ae6123653361234e8b60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b5460ff1690565b1561220f5761237961250a565b61220f565b6123866124f9565b6121e1565b9291906123998282866121bd565b803b6123a6575b50505050565b6123af93612420565b156123bd57388080806123a0565b6368d2bf6b60e11b60005260046000fd5b9081602091031261000e575161054681610404565b506040513d6000823e3d90fd5b3d1561241b573d9061240182610831565b9161240f6040519384610801565b82523d6000602084013e565b606090565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015292936020928492909183916000918390612471906084830190610510565b0393165af1600091816124b7575b506124a95761248c6123f0565b80511561249c575b805190602001fd5b6124a461252e565b612494565b6001600160e01b0319161490565b6124d991925060203d81116124e0575b6124d18183610801565b8101906123ce565b903861247f565b503d6124c7565b50631960ccad60e11b60005260046000fd5b5062a1148160e81b60005260046000fd5b50632ce44b5f60e11b60005260046000fd5b50633a954ecd60e21b60005260046000fd5b506368d2bf6b60e11b60005260046000fd5b60405190608082018281106001600160401b03821117612576575b60405260006060838281528260208201528260408201520152565b61257e610779565b61255b565b9061258c612540565b91600181101561259a575b50565b60005481106125a65750565b91506125b1826125d8565b916040830151612597576105469192506125d3906125cd612540565b506120df565b6125f3565b6125e0612540565b5060005260046020526105466040600020545b906125fc612540565b6001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b83161515604082015260e89290921c6060830152565b6008546001600160a01b0316330361264a57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b50634e487b7160e01b600052601160045260246000fd5b60019060011981116126b5570190565b6126bd61268e565b0190565b600181106126d1575b6000190190565b6126d961268e565b6126ca565b8181106126e9570390565b6126f161268e565b0390565b61082f335b60008054916127916040519183602084015261276260018060a01b038216938460408201526040815261272c816107e6565b6001600160e81b03199061273f90612ce8565b6001600160a01b0384164260a01b60e89290921b929092161717600160e11b1790565b612776866000526004602052604060002090565b556001600160a01b0316600090815260056020526040902090565b680100000000000000018154019055801561280257600190818401939180805b6127bd575b5050505055565b156127f1575b83818484877fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46127b1565b809201918483036127c357806127b6565b622e076360e81b8252600482fd5b90604181511460001461283e5761283a916020820151906060604084015193015160001a90612848565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116128cc5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156128bf575b81516001600160a01b038116156128b9579190565b50600190565b6128c76123e3565b6128a4565b50505050600090600390565b906126bd602092828151948592016104db565b805190816000927a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000080821015612a6f575b506d04ee2d6d415b85acef810000000080831015612a60575b50662386f26fc1000080831015612a51575b506305f5e10080831015612a42575b5061271080831015612a33575b506064821015612a23575b600a80921015612a19575b600190816021612985828801612a7d565b96870101905b6129e3575b505050506129dd611f70916040519283916129d760208401966129d788601a907f19457468657265756d205369676e6564204d6573736167653a0a00000000000081520190565b906128d8565b51902090565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304918215612a145791908261298b565b612990565b9260010192612974565b9290606460029104910192612969565b6004919492049101923861295e565b60089194920491019238612951565b60109194920491019238612942565b60209194920491019238612930565b604094508104915038612917565b90612a8782610831565b612a946040519182610801565b8281528092612aa5601f1991610831565b0190602036910137565b60019060001981146126b5570190565b9190811015612acf5760051b0190565b634e487b7160e01b600052603260045260246000fd5b9081602091031261000e57516105468161067a565b6001600160a01b03909116815260406020820181905281018390526001600160fb1b03831161000e5760609260051b80928483013701016000815290565b916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116929160009182905b848410612b945760405163039e5b7760e51b815280612b90878a8a60048501612afa565b0390fd5b612ba684868995989699979497612abf565b3594612bcb8660ff6001918060081c600052600e602052161b60406000205416151590565b612cd857604080516331a9108f60e11b81526004810188905290989060209081816024818b5afa918215612ccb575b8492612c9e575b50508333911603612c86575050505050612c7a7f3626b5db6ac6441079214cae6a8c3aaaa1681a609a0b424772b5b4f5297a114f9394612c5a848060081c600052600e602052600160ff604060002092161b8154179055565b516001600160a01b03909216825260208201929092529081906040820190565b0390a161082f336126fa565b90929550612c98919496939750612aaf565b92612b6c565b612cbd9250803d10612cc4575b612cb58183610801565b810190612ae5565b3880612c01565b503d612cab565b612cd36123e3565b612bfa565b91945092949195612c9890612aaf565b62ffffff9060014310612d30575b604051612d2981611f706020820194448652600019430140604084015233606084015260808084015260a0830190610510565b5190201690565b612d3861268e565b612cf6565b9162ffffff8116612d765750604080516001600160a01b0393841660208201529290911690820152610546906119bc8160608101611f70565b91505090565b15612d8357565b60405162461bcd60e51b815260206004820152601360248201527224ba13b9903a34b6b2903a37903634b9ba32b760691b6044820152606490fd5b15612dc557565b60405162461bcd60e51b81526020600482015260136024820152724e6f77206973206e6f74207468652074696d6560681b6044820152606490fd5b15612e0757565b60405162461bcd60e51b815260206004820152601b60248201527f5468657265206973206e6f7468696e6720746f206469737075746500000000006044820152606490fd5b15612e5357565b60405162461bcd60e51b815260206004820152601360248201527215d948185c99481a5b881859dc99595b595b9d606a1b6044820152606490fd5b612f8690612f76612f707ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce794612ec76011541515612d7c565b612ee0610884612ed9601054436126de565b1015612dbe565b612ef1612eec85612182565b612e00565b612f19612f12612f06612f06612f06886120df565b6001600160a01b031690565b3314612e4c565b62ffffff612f356060612f2b876125d8565b015162ffffff1690565b1615612fc9575b612f45846126a5565b6000541180612fa1575b612f8b575b612f67612f626011546126c1565b601155565b6119bc43601055565b82613008565b6040519081529081906020820190565b0390a1565b612f9c612f97856126a5565b612fd7565b612f54565b50612fc3612fbb6060612f2b612fb6886126a5565b6125d8565b62ffffff1690565b15612f4f565b612fd284612fd7565b612f3c565b80600052600460205260406000205415612fee5750565b612ff7816120df565b906000526004602052604060002055565b60009181835260046020526040832054918215613038579060409291845260e81b9060018060e81b031617912055565b62d5815360e01b8452600484fd5b600c546001600160a01b0316908161306257610546915061311b565b60405191829163c87b56dd60e01b8352600483015281602460009485935afa91821561310e575b809261309457505090565b9091503d8082843e6130a68184610801565b82019160208184031261310a578051906001600160401b038211611229570182601f8201121561310a578051916130dc83610831565b936130ea6040519586610801565b8385526020848401011161062357509061054691602080850191016104db565b5080fd5b6131166123e3565b613089565b61312481612182565b156131c557604051906131418261313a81611b59565b0383610801565b8151600090156131b057506040519060a08201604052608082019060008252905b6000190190600a9060308282060183530490816131625790506129d7926131a4610546936080601f1994858101920301815260405195869360208501906128d8565b03908101835282610801565b915050604051906131c0826107cb565b815290565b630a14c4b560e41b60005260046000fd5b600b546001600160a01b0316929190836131f55761283a929350613279565b9060446040928351958693849263152a902d60e11b8452600484015260248301525afa91821561326c575b600090819361322e57509190565b92506040833d8211613264575b8161324860409383610801565b810103126106235750602082519261325f8461067a565b015190565b3d915061323b565b6132746123e3565b613220565b919091600052600a602052612710604060002060405190613299826107b0565b546001600160a01b0380821680845260a09290921c602084015290156132fd575b506132ea6001600160601b036020830151169185600019048311861515166132f0575b516001600160a01b031690565b93020490565b6132f861268e565b6132dd565b604051915061330b826107b0565b600954908116825260a01c6020820152386132ba565b1561332857565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b601f8111613379575050565b600090600d82526000805160206133f1833981519152906020601f850160051c830194106133c2575b601f0160051c01915b8281106133b757505050565b8181556001016133ab565b90925082906133a2565b9081602091031261000e575190565b9081602091031261000e57516105468161179856fed7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5a164736f6c634300080d000a000000000000000000000000f01dfac37dd149cb686e05d06cd21930b011f10f000000000000000000000000879fa72912012b3906c5fe41e83a72e140300203000000000000000000000000c9c022fcfebe730710ae93ca9247c5ec9d9236d0

Deployed Bytecode

0x60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a7146103fb5780630378ab98146103f257806306fdde03146103e9578063081812fc146103e0578063095ea7b3146103d75780630e07b3aa146103ce578063105ea6d3146103c557806318160ddd146103bc57806323b872dd146103b35780632a55205a146103aa57806330176e13146103a157806333bc51c71461039857806342842e0e1461038f57806352f0832a1461038657806355ea73281461037d57806356d3163d1461037457806359edf34e1461036b5780635bbb2177146103625780635f516836146103595780635f7c7cca146103505780636352211e1461034757806370a082311461033e578063715018a6146103355780637b9f76b51461032c5780637ba0e2e7146103235780638462151c1461031a5780638ada6b0f146103115780638da5cb5b1461030857806392556632146102ff57806395d89b41146102f657806399a2557a146102ed578063a22cb465146102e4578063a2309ff8146102db578063a945bf80146102d2578063ae11c7f8146102c9578063aeb6c233146102c0578063b88d4fde146102b7578063b9b8f4d8146102ae578063c23dc68f146102a5578063c87b56dd1461029c578063d4c5b25214610293578063d547cfb71461028a578063d5abeb0114610281578063d6948b7514610278578063dc33e6811461026f578063e985e9c514610266578063f2fde38b1461025d578063f82d578a14610254578063fa09e6301461024b5763fe018d841461024357600080fd5b61000e612086565b5061000e611fd0565b5061000e611f18565b5061000e611e48565b5061000e611ddf565b5061000e611d97565b5061000e611cb3565b5061000e611c77565b5061000e611be1565b5061000e611b00565b5061000e611acc565b5061000e611a68565b5061000e611a20565b5061000e6119ce565b5061000e6119a8565b5061000e61187f565b5061000e61185b565b5061000e611838565b5061000e6117a2565b5061000e611602565b5061000e61155a565b5061000e61152a565b5061000e611500565b5061000e6114d6565b5061000e611430565b5061000e611257565b5061000e611186565b5061000e611124565b5061000e6110f4565b5061000e6110c4565b5061000e611081565b5061000e611012565b5061000e610f99565b5061000e610ef1565b5061000e610e41565b5061000e610e1d565b5061000e610dca565b5061000e610da6565b5061000e610d2a565b5061000e610b71565b5061000e610b34565b5061000e610b1f565b5061000e610acb565b5061000e610a85565b5061000e6108a2565b5061000e61068b565b5061000e610626565b5061000e610549565b5061000e6104b1565b5061000e610416565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561043681610404565b63ffffffff60e01b166301ffc9a760e01b811490819082156104a0575b821561048f575b821561046d575b50506040519015158152f35b63152a902d60e11b1491508115610487575b503880610461565b90503861047f565b635b5e139f60e01b8114925061045a565b6380ac58cd60e01b81149250610453565b503461000e57600036600319011261000e57600f546040516001600160a01b039091168152602090f35b918091926000905b8282106104fb5750116104f4575050565b6000910152565b915080602091830151818601520182916104e3565b90602091610529815180928185528580860191016104db565b601f01601f1916010190565b906020610546928181520190610510565b90565b503461000e5760008060031936011261062357604051908060025461056d81611b1f565b8085529160019180831690811561060257506001146105a7575b6105a38561059781870382610801565b60405191829182610535565b0390f35b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b8284106105ea575050508101602001610597826105a3610587565b805460208587018101919091529093019281016105cf565b60ff19166020870152505060408401925061059791508390506105a3610587565b80fd5b503461000e57602036600319011261000e5760043561064481612182565b15610669576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b6001600160a01b0381160361000e57565b50604036600319011261000e576004356106a48161067a565b6001600160a01b0390602435826106ba826120df565b16803303610717575b600082815260066020526040812080546001600160a01b0319166001600160a01b038616179055936040519316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258585a4f35b600081815260076020908152604080832033845290915290205460ff166106c3576367d9dca160e11b60005260046000fd5b9181601f8401121561000e578235916001600160401b03831161000e576020808501948460051b01011161000e57565b50634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116107a357604052565b6107ab610779565b604052565b604081019081106001600160401b038211176107a357604052565b602081019081106001600160401b038211176107a357604052565b606081019081106001600160401b038211176107a357604052565b90601f801991011681019081106001600160401b038211176107a357604052565b6040519061082f826107b0565b565b6020906001600160401b03811161084e575b601f01601f19160190565b610856610779565b610843565b81601f8201121561000e5780359061087282610831565b926108806040519485610801565b8284526020838301011161000e57816000926020809301838601378301015290565b5060408060031936011261000e576004906001600160401b03823581811161000e576108d19036908501610749565b93909160243590811161000e576108eb903690830161085b565b67011c37937e080000803403610a6f575060005460011990600019810190828211610a62575b7f00000000000000000000000000000000000000000000000000000000000001b491828211610a31575050336000908152600560205260409081902054901c6001600160401b03169050908111610a24575b600260018201116109f4575083519033602083015260208252610985826107b0565b600f546001600160a01b039081169290919073e94098906c4bd7c9d8e2706159d226c5bc72b7371984016109c4575b6000876109c18a89612b38565b51f35b906109d16109d6926128eb565b612810565b5016036109e657808080806109b4565b8251638baa579f60e01b8152fd5b808386602493600210610a17575b5191637e0311c360e11b835260020390820152fd5b610a1f61268e565b610a02565b610a2c61268e565b610963565b6001839289889360249610610a55575b5163cbbf111360e01b815293030190820152fd5b610a5d61268e565b610a41565b610a6a61268e565b610911565b8260249186519163b23bee0560e01b8352820152fd5b503461000e57600036600319011261000e576040517f000000000000000000000000f01dfac37dd149cb686e05d06cd21930b011f10f6001600160a01b03168152602090f35b503461000e57600036600319011261000e576000546001546040519103600019018152602090f35b606090600319011261000e57600435610b0b8161067a565b90602435610b188161067a565b9060443590565b50610b32610b2c36610af3565b916121bd565b005b503461000e57604036600319011261000e57610b546024356004356131d6565b604080516001600160a01b03939093168352602083019190915290f35b503461000e5760208060031936011261000e57600435906001600160401b0380831161000e573660238401121561000e57826004013590811161000e576024903682828601011161000e57610bc4612636565b604092835194848652610bd8858701611b59565b938685038388015283855283818301848701377f19c1a81f34d9a8d208a44017474815e9089aff4b57e461c08509577eea2c3900600097888587890101528481601f199889601f8a011601030190a16000199283885401927f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c88805160019687825285820152a1610c7386610c6e600d54611b1f565b61336d565b8891601f8711600114610caf575085965090859392918996610ca2575b5050501b9260031b1c191617600d5551f35b0101359350388080610c90565b9490939686908116610cd1600d6000526000805160206133f183398151915290565b968b905b8a838310610d0e5750505010610cf4575b5050505050811b01600d5551f35b60f88660031b161c19920101351690553880808080610ce6565b8887018801358a55909801979485019489935090810190610cd5565b503461000e57602036600319011261000e57600435610d488161067a565b610d50612636565b600f54604080516001600160a01b03848116825280841660208301529293917fd9c1a818d3059379d98e9173f10c617e05fb6e1d11051d2abeb3c1e7c8b7046891a16001600160a01b0319909216911617600f55005b50610b32610db336610af3565b9060405192610dc1846107cb565b6000845261238b565b503461000e57604036600319011261000e5760043560243560005b818110610dee57005b80610e0b91198411610e10575b610e06818501612fd7565b612aaf565b610de5565b610e1861268e565b610dfb565b503461000e57600036600319011261000e57602060405167011c37937e0800008152f35b503461000e57602036600319011261000e57600435610e5f8161067a565b610e67612636565b600c54604080516001600160a01b03808416825290931660208401819052927f10e9b6d73105db46c6a41a698f35efb8e1688178fe274b7b21f0bdc792de3ea59190a17f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c604060001960005401815190600182526020820152a16001600160a01b03191617600c55005b503461000e57600036600319011261000e57600b546040516001600160a01b039091168152602090f35b6020908160408183019282815285518094520193019160005b828110610f42575050505090565b9091929382608082610f8d600194895162ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565b01950193929101610f34565b503461000e57602036600319011261000e576004356001600160401b03811161000e57610fca903690600401610749565b906040519180835260051b6020818401016040525b8081801561100457610ffb90601f198091019385010135612583565b90840152610fdf565b604051806105a38782610f1b565b503461000e57602036600319011261000e57602060043562ffffff80606061103984612583565b015116916040519284840191825260408401526040835260608301928084106001600160401b03851117611074575b83604052519020168152f35b61107c610779565b611068565b503461000e57602036600319011261000e5760206110ba60043560ff6001918060081c600052600e602052161b60406000205416151590565b6040519015158152f35b503461000e57602036600319011261000e5760206001600160a01b036110eb6004356120df565b16604051908152f35b503461000e57602036600319011261000e57602061111c6004356111178161067a565b6120a5565b604051908152f35b503461000e576000806003193601126106235761113f612636565b600880546001600160a01b031981169091556040519082906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08284a3f35b503461000e5760006060366003190112610623576004356111a68161067a565b81604435916111b48361067a565b6111bc612636565b6001600160a01b0390811692833b1561122957606490836040519586948593632142170760e11b855230600486015216602484015260243560448401525af1801561121c575b61120d575b50604051f35b61121690610790565b38611207565b6112246123e3565b611202565b8280fd5b602060031982011261000e57600435906001600160401b03821161000e576105469160040161085b565b506112613661122d565b6701aa535d3d0c00008034036113dd5750600054600119906000198101908282116113d0575b7f00000000000000000000000000000000000000000000000000000000000001b49182821161139e575050336000908152600560205260409081902054901c6001600160401b03169050908111611391575b600260018201116113605750604051336020820152602081526112fb816107b0565b600f546001600160a01b039081169290919073e94098906c4bd7c9d8e2706159d226c5bc72b737198401611332575b610b326126f5565b6109d161133e926128eb565b50160361134e573880808061132a565b604051638baa579f60e01b8152600490fd5b80602491600210611384575b60405190637e0311c360e11b82526002036004820152fd5b61138c61268e565b61136c565b61139961268e565b6112d9565b8291600191602494106113c3575b60405163cbbf111360e01b81529203016004820152fd5b6113cb61268e565b6113ac565b6113d861268e565b611287565b6024906040519063b23bee0560e01b82526004820152fd5b6020908160408183019282815285518094520193019160005b82811061141c575050505090565b83518552938101939281019260010161140e565b503461000e57602036600319011261000e5760043561144e8161067a565b611457816120a5565b6040805191600193600590858301821b8501845282855260009081875b858403611488578651806105a38a826113f5565b806114938a926125d8565b88810151156114a4575b5001611474565b51806114ce575b5083831860601b156114be575b3861149d565b938101938085871b8a01526114b8565b9250386114ab565b503461000e57600036600319011261000e57600c546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e576008546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e57602060405173e94098906c4bd7c9d8e2706159d226c5bc72b7388152f35b503461000e5760008060031936011261062357604051908060035461157e81611b1f565b8085529160019180831690811561060257506001146115a7576105a38561059781870382610801565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106115ea575050508101602001610597826105a3610587565b805460208587018101919091529093019281016115cf565b503461000e5760608060031936011261000e576004356116218161067a565b602435604435908082948383101561178b575b6001809310611783575b60009384548091101561177b575b508094611658816120a5565b8784100280611670575b604051806105a389826113f5565b9091928094959650870381811115611773575b50604080519686830160051b8801825261169c86612583565b9281936116b26116ae85830151151590565b1590565b611761575b5081999796999787805b6116e1575b5050505050505050506105a392508152388080808080611662565b99989915611740575b826116f48c6125d8565b858101511561170c575b5088809a9b9c019b996116c1565b5180611738575b50868618881b15611725575b386116fe565b998801600581901b8a018c90529961171f565b955038611713565b808b148015611758575b156116ea57809998996116c6565b50818a1461174a565b516001600160a01b03169350386116b7565b905038611683565b95503861164c565b82915061163e565b6117936124e7565b611634565b8015150361000e57565b503461000e57604036600319011261000e576004356117c08161067a565b602435906117cd82611798565b3360009081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e57600036600319011261000e57602060001960005401604051908152f35b503461000e57600036600319011261000e5760206040516701aa535d3d0c00008152f35b503461000e57604036600319011261000e5760043561189d8161067a565b611928602435916118ad8361067a565b6118b5612636565b6040516370a0823160e01b815230600482015260209384926001600160a01b0316908383602481855afa92831561199b575b60009361196c575b5060405163a9059cbb60e01b81526001600160a01b03909116600482015260248101929092529092839190829060009082906044820190565b03925af1801561195f575b61193957005b81610b3292903d10611958575b6119508183610801565b8101906133db565b503d611946565b6119676123e3565b611933565b61198d919350843d8611611994575b6119858183610801565b8101906133cc565b91386118ef565b503d61197b565b6119a36123e3565b6118e7565b503461000e5760206119c16119bc3661122d565b612ce8565b62ffffff60405191168152f35b50608036600319011261000e576004356119e78161067a565b6024356119f38161067a565b606435916001600160401b03831161000e57611a16610b3293369060040161085b565b916044359161238b565b503461000e57602036600319011261000e57600435611a3e8161067a565b611a46612636565b600b80546001600160a01b0319166001600160a01b0392909216919091179055005b503461000e57602036600319011261000e576080611a87600435612583565b611aca604051809262ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565bf35b503461000e57602036600319011261000e576105a3611aec600435613046565b604051918291602083526020830190610510565b503461000e57600036600319011261000e576020601154604051908152f35b90600182811c92168015611b4f575b6020831014611b3957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611b2e565b600d5460009291611b6982611b1f565b80825291600190818116908115611bce5750600114611b8757505050565b91929350600d6000526000805160206133f1833981519152916000925b848410611bb657505060209250010190565b80546020858501810191909152909301928101611ba4565b60ff191660208401525050604001925050565b503461000e57600080600319360112610623576040519080600d54611c0581611b1f565b808552916001918083169081156106025750600114611c2e576105a38561059781870382610801565b9250600d83526000805160206133f18339815191525b828410611c5f575050508101602001610597826105a3610587565b80546020858701810191909152909301928101611c44565b503461000e57600036600319011261000e5760206040517f00000000000000000000000000000000000000000000000000000000000001b48152f35b503461000e57602036600319011261000e576004356001600160601b03811680820361000e5761271090611ce5612636565b11611d3f57610b3290611cf9301515613321565b611d18611d04610822565b308152916001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600955565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b503461000e57602036600319011261000e57602061111c600435611dba8161067a565b60018060a01b031660005260056020526001600160401b0360406000205460401c1690565b503461000e57604036600319011261000e57602060ff611e3c600435611e048161067a565b60243590611e118261067a565b60018060a01b03166000526007845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b503461000e57602036600319011261000e57600435611e668161067a565b611e6e612636565b6001600160a01b03908116908115611ec45760009160085491816001600160601b0360a01b84161760085560405192167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08484a3f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b503461000e57604036600319011261000e576004356024356001600160401b03811161000e57611f4c90369060040161085b565b601054604080513360208201529081018490526060810191909152611f7e81608081015b03601f198101835282610801565b600f546001600160a01b039081169173e94098906c4bd7c9d8e2706159d226c5bc72b737198301611fb4575b610b328486612e8e565b836109d1611fc1926128eb565b50160361134e57388080611faa565b503461000e57602036600319011261000e57600435611fee8161067a565b611ff6612636565b471561205257600080809247604051915af16120106123f0565b501561201857005b60405162461bcd60e51b81526020600482015260126024820152714661696c656420746f20776974686472617760701b6044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b5a65726f2062616c616e636560a01b6044820152606490fd5b503461000e57600036600319011261000e576020601054604051908152f35b6001600160a01b031680156120ce5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b600090600190808211156120fd575b636f96cda160e11b8352600483fd5b8083526004602052604083205491600160e01b83161561211d57506120ee565b909192831561212d575b50505090565b8054831015612173575090815b6121445780612127565b9091506000190161215f816000526004602052604060002090565b5491821561216c57505090565b908161213a565b636f96cda160e11b8152600490fd5b806001111590816121b1575b81612197575090565b90506000526004602052600160e01b604060002054161590565b6000548110915061218e565b9190916121c9826120df565b6001600160a01b03918216939082811685900361237e575b6000848152600660205260409020805461220a6001600160a01b03881633908114908314171590565b612328575b61231e575b506001600160a01b038581166000908152600560205260408082208054600019019055918416815220805460010190556001600160e81b031961225c60e883901c8488612d3d565b60e81b1661227f600160e11b91821784904260a01b179060018060a01b03161790565b612293866000526004602052604060002090565b558116156122d4575b501680927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4156122cc57565b61082f61251c565b600184016122ec816000526004602052604060002090565b54156122f9575b5061229c565b60005481146122f357612316906000526004602052604060002090565b5538806122f3565b6000905538612214565b61236c6116ae6123653361234e8b60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b5460ff1690565b1561220f5761237961250a565b61220f565b6123866124f9565b6121e1565b9291906123998282866121bd565b803b6123a6575b50505050565b6123af93612420565b156123bd57388080806123a0565b6368d2bf6b60e11b60005260046000fd5b9081602091031261000e575161054681610404565b506040513d6000823e3d90fd5b3d1561241b573d9061240182610831565b9161240f6040519384610801565b82523d6000602084013e565b606090565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015292936020928492909183916000918390612471906084830190610510565b0393165af1600091816124b7575b506124a95761248c6123f0565b80511561249c575b805190602001fd5b6124a461252e565b612494565b6001600160e01b0319161490565b6124d991925060203d81116124e0575b6124d18183610801565b8101906123ce565b903861247f565b503d6124c7565b50631960ccad60e11b60005260046000fd5b5062a1148160e81b60005260046000fd5b50632ce44b5f60e11b60005260046000fd5b50633a954ecd60e21b60005260046000fd5b506368d2bf6b60e11b60005260046000fd5b60405190608082018281106001600160401b03821117612576575b60405260006060838281528260208201528260408201520152565b61257e610779565b61255b565b9061258c612540565b91600181101561259a575b50565b60005481106125a65750565b91506125b1826125d8565b916040830151612597576105469192506125d3906125cd612540565b506120df565b6125f3565b6125e0612540565b5060005260046020526105466040600020545b906125fc612540565b6001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b83161515604082015260e89290921c6060830152565b6008546001600160a01b0316330361264a57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b50634e487b7160e01b600052601160045260246000fd5b60019060011981116126b5570190565b6126bd61268e565b0190565b600181106126d1575b6000190190565b6126d961268e565b6126ca565b8181106126e9570390565b6126f161268e565b0390565b61082f335b60008054916127916040519183602084015261276260018060a01b038216938460408201526040815261272c816107e6565b6001600160e81b03199061273f90612ce8565b6001600160a01b0384164260a01b60e89290921b929092161717600160e11b1790565b612776866000526004602052604060002090565b556001600160a01b0316600090815260056020526040902090565b680100000000000000018154019055801561280257600190818401939180805b6127bd575b5050505055565b156127f1575b83818484877fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46127b1565b809201918483036127c357806127b6565b622e076360e81b8252600482fd5b90604181511460001461283e5761283a916020820151906060604084015193015160001a90612848565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116128cc5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156128bf575b81516001600160a01b038116156128b9579190565b50600190565b6128c76123e3565b6128a4565b50505050600090600390565b906126bd602092828151948592016104db565b805190816000927a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000080821015612a6f575b506d04ee2d6d415b85acef810000000080831015612a60575b50662386f26fc1000080831015612a51575b506305f5e10080831015612a42575b5061271080831015612a33575b506064821015612a23575b600a80921015612a19575b600190816021612985828801612a7d565b96870101905b6129e3575b505050506129dd611f70916040519283916129d760208401966129d788601a907f19457468657265756d205369676e6564204d6573736167653a0a00000000000081520190565b906128d8565b51902090565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304918215612a145791908261298b565b612990565b9260010192612974565b9290606460029104910192612969565b6004919492049101923861295e565b60089194920491019238612951565b60109194920491019238612942565b60209194920491019238612930565b604094508104915038612917565b90612a8782610831565b612a946040519182610801565b8281528092612aa5601f1991610831565b0190602036910137565b60019060001981146126b5570190565b9190811015612acf5760051b0190565b634e487b7160e01b600052603260045260246000fd5b9081602091031261000e57516105468161067a565b6001600160a01b03909116815260406020820181905281018390526001600160fb1b03831161000e5760609260051b80928483013701016000815290565b916001600160a01b037f000000000000000000000000f01dfac37dd149cb686e05d06cd21930b011f10f8116929160009182905b848410612b945760405163039e5b7760e51b815280612b90878a8a60048501612afa565b0390fd5b612ba684868995989699979497612abf565b3594612bcb8660ff6001918060081c600052600e602052161b60406000205416151590565b612cd857604080516331a9108f60e11b81526004810188905290989060209081816024818b5afa918215612ccb575b8492612c9e575b50508333911603612c86575050505050612c7a7f3626b5db6ac6441079214cae6a8c3aaaa1681a609a0b424772b5b4f5297a114f9394612c5a848060081c600052600e602052600160ff604060002092161b8154179055565b516001600160a01b03909216825260208201929092529081906040820190565b0390a161082f336126fa565b90929550612c98919496939750612aaf565b92612b6c565b612cbd9250803d10612cc4575b612cb58183610801565b810190612ae5565b3880612c01565b503d612cab565b612cd36123e3565b612bfa565b91945092949195612c9890612aaf565b62ffffff9060014310612d30575b604051612d2981611f706020820194448652600019430140604084015233606084015260808084015260a0830190610510565b5190201690565b612d3861268e565b612cf6565b9162ffffff8116612d765750604080516001600160a01b0393841660208201529290911690820152610546906119bc8160608101611f70565b91505090565b15612d8357565b60405162461bcd60e51b815260206004820152601360248201527224ba13b9903a34b6b2903a37903634b9ba32b760691b6044820152606490fd5b15612dc557565b60405162461bcd60e51b81526020600482015260136024820152724e6f77206973206e6f74207468652074696d6560681b6044820152606490fd5b15612e0757565b60405162461bcd60e51b815260206004820152601b60248201527f5468657265206973206e6f7468696e6720746f206469737075746500000000006044820152606490fd5b15612e5357565b60405162461bcd60e51b815260206004820152601360248201527215d948185c99481a5b881859dc99595b595b9d606a1b6044820152606490fd5b612f8690612f76612f707ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce794612ec76011541515612d7c565b612ee0610884612ed9601054436126de565b1015612dbe565b612ef1612eec85612182565b612e00565b612f19612f12612f06612f06612f06886120df565b6001600160a01b031690565b3314612e4c565b62ffffff612f356060612f2b876125d8565b015162ffffff1690565b1615612fc9575b612f45846126a5565b6000541180612fa1575b612f8b575b612f67612f626011546126c1565b601155565b6119bc43601055565b82613008565b6040519081529081906020820190565b0390a1565b612f9c612f97856126a5565b612fd7565b612f54565b50612fc3612fbb6060612f2b612fb6886126a5565b6125d8565b62ffffff1690565b15612f4f565b612fd284612fd7565b612f3c565b80600052600460205260406000205415612fee5750565b612ff7816120df565b906000526004602052604060002055565b60009181835260046020526040832054918215613038579060409291845260e81b9060018060e81b031617912055565b62d5815360e01b8452600484fd5b600c546001600160a01b0316908161306257610546915061311b565b60405191829163c87b56dd60e01b8352600483015281602460009485935afa91821561310e575b809261309457505090565b9091503d8082843e6130a68184610801565b82019160208184031261310a578051906001600160401b038211611229570182601f8201121561310a578051916130dc83610831565b936130ea6040519586610801565b8385526020848401011161062357509061054691602080850191016104db565b5080fd5b6131166123e3565b613089565b61312481612182565b156131c557604051906131418261313a81611b59565b0383610801565b8151600090156131b057506040519060a08201604052608082019060008252905b6000190190600a9060308282060183530490816131625790506129d7926131a4610546936080601f1994858101920301815260405195869360208501906128d8565b03908101835282610801565b915050604051906131c0826107cb565b815290565b630a14c4b560e41b60005260046000fd5b600b546001600160a01b0316929190836131f55761283a929350613279565b9060446040928351958693849263152a902d60e11b8452600484015260248301525afa91821561326c575b600090819361322e57509190565b92506040833d8211613264575b8161324860409383610801565b810103126106235750602082519261325f8461067a565b015190565b3d915061323b565b6132746123e3565b613220565b919091600052600a602052612710604060002060405190613299826107b0565b546001600160a01b0380821680845260a09290921c602084015290156132fd575b506132ea6001600160601b036020830151169185600019048311861515166132f0575b516001600160a01b031690565b93020490565b6132f861268e565b6132dd565b604051915061330b826107b0565b600954908116825260a01c6020820152386132ba565b1561332857565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b601f8111613379575050565b600090600d82526000805160206133f1833981519152906020601f850160051c830194106133c2575b601f0160051c01915b8281106133b757505050565b8181556001016133ab565b90925082906133a2565b9081602091031261000e575190565b9081602091031261000e57516105468161179856fed7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5a164736f6c634300080d000a

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

000000000000000000000000f01dfac37dd149cb686e05d06cd21930b011f10f000000000000000000000000879fa72912012b3906c5fe41e83a72e140300203000000000000000000000000c9c022fcfebe730710ae93ca9247c5ec9d9236d0

-----Decoded View---------------
Arg [0] : _foldedFaces (address): 0xf01DfAC37DD149Cb686E05d06cd21930B011F10F
Arg [1] : artist (address): 0x879fa72912012b3906c5FE41E83A72E140300203
Arg [2] : developer (address): 0xC9C022FCFebE730710aE93CA9247c5Ec9d9236d0

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f01dfac37dd149cb686e05d06cd21930b011f10f
Arg [1] : 000000000000000000000000879fa72912012b3906c5fe41e83a72e140300203
Arg [2] : 000000000000000000000000c9c022fcfebe730710ae93ca9247c5ec9d9236d0


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.