ETH Price: $3,835.66 (-2.19%)

Token

Shishi (SHISHI)
 

Overview

Max Total Supply

3,520 SHISHI

Holders

868

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
sollux.eth
Balance
1 SHISHI
0x1A9A0B97CE419891f67468F81C91BC82497956E8
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Shishi520 is a collection of 3,520 generative NFTs in a neochibi aesthetic with randomized traits inspired by net art and fashion trends. Digital artist Shiro, aims to bring together whitehearted / whitepilled sentiments with net art and fashion.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Shishi

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 7 : Shishi.sol
// SPDX-License-Identifier: AGPL-3.0-only+VPL
pragma solidity ^0.8.16;

import {ERC721A} from "@ERC721A/contracts/ERC721A.sol";
import {LibPack} from "./LibPack.sol";
import {Ownable} from "solady/auth/Ownable.sol";
import {MerkleProofLib} from "solady/utils/MerkleProofLib.sol";
import {IShishi} from "./IShishi.sol";

/**
 *   @custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVM MEVM
 *   @title Shishi. Ever dream this girl?
 *   @author 0x_ultra
 *   @author many beautiful Shishis
 *   @custom:version 3.0
 *   @custom:third time's a charm
 *
 *   Shishi is a generative art project by shirosama.eth; yippiee!
 *
 *   @custom:date January 4thth, 2024.
 */
contract Shishi is ERC721A, IShishi, Ownable {
    using LibPack for *;

    /**
     * Store the provenance hash. This is computed as the keccak256 hash of the
     * list of metadatas for all Shishis, in token ID order. We understand that
     * this is only a weak guarantee of honesty--it proves that we committed to
     * the art and its order prior to beginning the mint but does nothing to
     * trustlessly conceal the specific metadata of particular Shishis ahead of
     * time. You'll just have to deal with that; schemes which apply
     * provably-randomized offsets to the provenance data are very difficult
     * to reconcile with instant reveals.
     */
    bytes32 private constant provenance = 0xfef66cef154a5d4dbed8c336934c23c383df7394ea03f033d7cfa81f7eacff5b;

    /// Track the base token metadata URI.
    string internal baseURI;

    /// Track whether the base token metadata URI is locked to future changes.
    bool private baseURILocked;

    /// Whether transfers can be paused / unpaused.
    bool public pausedLocked;

    /// Whether transfers are paused.
    bool public paused;

    /// Track the total supply cap on the number of Shishis that may be minted.
    uint256 private constant cap = 3520;

    uint256 maxPerWalletPublic = 2;

    // File extension for metadata
    string private fileExtension = ".json";

    /// Phase start times
    Phases public phasetimes;

    /// Merkle roots
    Roots public roots;

    /// Track the number of utilized FCFS Milady/Remilio mints.
    uint256 public fcfs;

    /**
     * Construct an instance of the Shishi contract.
     *
     * @param _owner The initial owner of this contract.
     * @param _initialBaseURI The initial base token metadata URI to use.
     * @param _phasetimes The initial phase times.
     * @param _roots The initial merkle roots.
     */
    constructor(address _owner, string memory _initialBaseURI, Phases memory _phasetimes, Roots memory _roots)
        ERC721A("Shishi", "SHISHI")
    {
        _initializeOwner(_owner);
        baseURI = _initialBaseURI;
        phasetimes = _phasetimes;
        roots = _roots;
        _mint(_owner, 1);
    }

    /**
     * Phase one mint (Oh I see and Shishi maker)
     *
     * @param _paidWant The number of paid Shishis to mint.
     * @param _freeWant The number of free Shishis to mint.
     * @param _paidMax The maximum number of paid Shishis that may be minted by the user.
     * @param _freeMax The maximum number of free Shishis that may be minted by the user.
     * @param proof The merkle proof.
     */
    function mintOne(uint8 _paidWant, uint8 _freeWant, uint8 _paidMax, uint8 _freeMax, bytes32[] calldata proof)
        external
        payable
    {
        Claimed memory claimed = claimedOne(msg.sender);
        _verifyMint(_paidWant, _freeWant, _paidMax, _freeMax, proof, phasetimes.startOne, roots.rootOne, claimed);
        claimed.paid += _paidWant;
        claimed.free += _freeWant;
        _setClaimedOne(msg.sender, claimed);

        _mint(msg.sender, _paidWant + _freeWant);

        emit PhaseOneMinted(msg.sender, _paidWant, _freeWant);
    }

    /**
     * Phase two mint (Miladys and Remilios)
     *
     * @param _paidWant The number of paid Shishis to mint.
     * @param _freeWant The number of free Shishis to mint.
     * @param _paidMax The maximum number of paid Shishis that may be minted by the user.
     * @param _freeMax The maximum number of free Shishis that may be minted by the user.
     * @param proof The merkle proof.
     */
    function mintTwo(uint8 _paidWant, uint8 _freeWant, uint8 _paidMax, uint8 _freeMax, bytes32[] calldata proof)
        external
        payable
    {
        Claimed memory claimed = claimedTwo(msg.sender);

        if (_freeWant > 0) {
            if (fcfs >= 300) {
                revert OutOfStock();
            } else {
                fcfs += _freeWant;
            }
        }

        _verifyMint(_paidWant, _freeWant, _paidMax, _freeMax, proof, phasetimes.startTwo, roots.rootTwo, claimed);
        claimed.paid += _paidWant;
        claimed.free += _freeWant;
        _setClaimedTwo(msg.sender, claimed);

        _mint(msg.sender, _paidWant + _freeWant);

        emit PhaseTwoMinted(msg.sender, _paidWant, _freeWant);
    }

    /**
     * Phase three mint (Public Mint)
     *
     * @param _amount The number of Shishis to mint.
     */
    function mintThree(uint8 _amount) external payable {
        if (block.timestamp < phasetimes.startThree) {
            revert NotStartedYet();
        }

        if (_totalMinted() + _amount > cap) {
            revert OutOfStock();
        }

        uint8 claimed = claimedThree(msg.sender);

        if (claimed + _amount > maxPerWalletPublic) {
            revert OutOfMints();
        }

        if (msg.value < uint256(_amount) * 0.04 ether) {
            revert NotEnoughPayment();
        }

        if (msg.sender != tx.origin) {
            uint8 claimedOrigin = claimedThree(tx.origin);
            if (claimedOrigin + _amount > maxPerWalletPublic) {
                revert OutOfMints();
            }
            _setClaimedThree(tx.origin, claimedOrigin + _amount);
        }

        _setClaimedThree(msg.sender, claimed + _amount);

        _mint(msg.sender, _amount);

        emit PhaseThreeMinted(msg.sender, _amount);
    }

    /**
     * Verifies that all conditions are met for the user to mint
     */
    function _verifyMint(
        uint8 _paidWant,
        uint8 _freeWant,
        uint8 _paidMax,
        uint8 _freeMax,
        bytes32[] calldata proof,
        uint256 _phase,
        bytes32 _root,
        Claimed memory claimed
    ) internal {
        if (block.timestamp < _phase) {
            revert NotStartedYet();
        }

        if (_totalMinted() + _paidWant + _freeWant > cap) {
            revert OutOfStock();
        }

        if (
            !MerkleProofLib.verifyCalldata(
                proof, _root, keccak256(abi.encodePacked(msg.sender, uint256(_paidMax), uint256(_freeMax)))
            )
        ) {
            revert CannotClaimInvalidProof();
        }

        if (claimed.paid + _paidWant > _paidMax || claimed.free + _freeWant > _freeMax) {
            revert OutOfMints();
        }

        if (msg.value < uint256(_paidWant) * 0.033 ether) {
            revert NotEnoughPayment();
        }
    }

    /**
     * Override the starting index of the first Shishi.
     *
     * @return _ The token ID of the first Shishi.
     */
    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    /**
     * Override the `_baseURI` used in our parent contract with our set value.
     *
     * @return _ The base token metadata URI.
     */
    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

    /**
     * Allows querying the URI for a given token ID.
     *
     * @param _tokenId uint256 ID of the token to query
     * @return URI of given token ID
     */
    function tokenURI(uint256 _tokenId) public view override(ERC721A) returns (string memory) {
        return string(abi.encodePacked(baseURI, _toString(_tokenId), fileExtension));
    }

    /**
     * Track Shishis minted by users during phase one.
     *
     * @return _ Shishis minted.
     */
    function claimedOne(address _address) public view returns (Claimed memory) {
        uint64 x = _getAux(_address);
        return Claimed({paid: x.get(0), free: x.get(1)});
    }

    /**
     * Track Shishis minted by users during phase two.
     *
     * @return _ Shishis minted.
     */
    function claimedTwo(address _address) public view returns (Claimed memory) {
        uint64 x = _getAux(_address);
        return Claimed({paid: x.get(2), free: x.get(3)});
    }

    /**
     * Track Shishis minted by users during phase three.
     *
     * @return _ Shishis minted.
     */
    function claimedThree(address _address) public view returns (uint8) {
        uint64 x = _getAux(_address);
        return x.get(4);
    }

    /**
     * Set Shishis minted by users during phase one.
     */
    function _setClaimedOne(address _address, Claimed memory _claimed) internal {
        _setAux(_address, _getAux(_address).set(0, _claimed.paid).set(1, _claimed.free));
    }

    /**
     * Set Shishis minted by users during phase two.
     */
    function _setClaimedTwo(address _address, Claimed memory _claimed) internal {
        _setAux(_address, _getAux(_address).set(2, _claimed.paid).set(3, _claimed.free));
    }

    /**
     * Set Shishis minted by users during phase three.
     */
    function _setClaimedThree(address _address, uint8 _claimed) internal {
        _setAux(_address, _getAux(_address).set(4, _claimed));
    }

    /**
     * Allow the contract owner to set the base token metadata URI.
     *
     * @param _newBaseURI The new base token metadata URI to set.
     * @custom:throws BaseURILocked if the base token metadata URI is locked
     *   against future changes.
     */
    function setBaseURI(string memory _newBaseURI) external onlyOwner {
        if (baseURILocked) {
            revert BaseURILocked();
        } else {
            baseURI = _newBaseURI;
        }
    }

    /**
     * Allow the contract owner to permanently lock base URI changes.
     */
    function lockBaseURI() external onlyOwner {
        baseURILocked = true;
    }

    /**
     * Allow the contract owner to set the whitelist phase times.
     *
     * @param _startOne The new phase one time.
     * @param _startTwo The new phase two time.
     * @param _startThree The new phase three time.
     */
    function setPhases(uint256 _startOne, uint64 _startTwo, uint64 _startThree) external onlyOwner {
        phasetimes = Phases(uint64(_startOne), _startTwo, _startThree);
    }

    /**
     * Allow the contract owner to set the whitelist roots.
     *
     * @param _rootOne The new phase one root.
     * @param _rootTwo The new phase two root.
     */
    function setRoots(bytes32 _rootOne, bytes32 _rootTwo) external onlyOwner {
        roots = Roots(_rootOne, _rootTwo);
    }

    /**
     * Allow the contract owner to set max amount of mints per wallet for public mint.
     *
     * @param _max The new max amount of mints per wallet.
     */
    function setMaxPerWalletPublic(uint256 _max) external onlyOwner {
        maxPerWalletPublic = _max;
    }

    /**
     * Allows the owner to sweep the contract balance.
     */
    function sweep(address _to) external onlyOwner {
        (bool success,) = payable(_to).call{value: address(this).balance}("");
        if (!success) revert SweepingTransferFailed();
    }

    /**
     * Allow the contract owner to permanently lock paused changes.
     */
    function lockPaused() external onlyOwner {
        pausedLocked = true;
    }

    /**
     * Allows the owner to pause / unpause transfers (including minting).
     */
    function setPaused(bool _paused) external onlyOwner {
        if (pausedLocked) {
            revert PausedLocked();
        } else {
            paused = _paused;
        }
    }

    /**
     * Overrides `ERC721A._beforeTokenTransfers` to revert if paused.
     */
    function _beforeTokenTransfers(address, address, uint256, uint256) internal virtual override {
        if (paused) revert Paused();
    }
}

File 2 of 7 : 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();
        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();

        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) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // 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, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @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.
     * 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) public payable virtual override {
        address owner = ownerOf(tokenId);

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

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

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

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

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (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();

        if (to == address(0)) revert TransferToZeroAddress();

        _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;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _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();
            }
    }

    /**
     * @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();
            } else {
                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();

        _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:
            // - `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)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // 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`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _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();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _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();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

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

    // =============================================================
    //                        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();
        }

        _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();
        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)
        }
    }
}

File 3 of 7 : LibPack.sol
// SPDX-License-Identifier: AGPL-3.0-only+VPL
pragma solidity ^0.8.16;

/**
 * @dev Library for packing uint8s in a uint64.
 */
library LibPack {
    /**
     * @dev Returns the `_i`th uint8 in `_x`.
     * @param _x The packed uint64.
     * @param _i The index of the element.
     * @return The element.
     */
    function get(uint64 _x, uint256 _i) internal pure returns (uint8) {
        return uint8(uint256(_x) >> (_i << 3));
    }

    /**
     * @dev Sets the `_i`th element to `_v` and returns the updated packed value.
     * @param _x The packed uint64.
     * @param _i The index of the element.
     * @param _v The value of the element.
     * @return The updated packed value.
     */
    function set(uint64 _x, uint256 _i, uint8 _v) internal pure returns (uint64) {
        uint256 s = _i << 3;
        return uint64(uint256(_x) ^ (((uint256(_x) >> s) ^ uint256(_v)) & 0xff) << s);
    }
}

File 4 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The caller is not authorized to call the function.
    error Unauthorized();

    /// @dev The `newOwner` cannot be the zero address.
    error NewOwnerIsZeroAddress();

    /// @dev The `pendingOwner` does not have a valid handover request.
    error NoHandoverRequest();

    /// @dev Cannot double-initialize.
    error AlreadyInitialized();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be
    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
    /// despite it not being as lightweight as a single argument event.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev An ownership handover to `pendingOwner` has been requested.
    event OwnershipHandoverRequested(address indexed pendingOwner);

    /// @dev The ownership handover to `pendingOwner` has been canceled.
    event OwnershipHandoverCanceled(address indexed pendingOwner);

    /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;

    /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;

    /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The owner slot is given by:
    /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
    /// It is intentionally chosen to be a high value
    /// to avoid collision with lower slots.
    /// The choice of manual storage layout is to enable compatibility
    /// with both regular and upgradeable contracts.
    bytes32 internal constant _OWNER_SLOT =
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;

    /// The ownership handover slot of `newOwner` is given by:
    /// ```
    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
    ///     let handoverSlot := keccak256(0x00, 0x20)
    /// ```
    /// It stores the expiry timestamp of the two-step ownership handover.
    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     INTERNAL FUNCTIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
    function _guardInitializeOwner() internal pure virtual returns (bool guard) {}

    /// @dev Initializes the owner directly without authorization guard.
    /// This function must be called upon initialization,
    /// regardless of whether the contract is upgradeable or not.
    /// This is to enable generalization to both regular and upgradeable contracts,
    /// and to save gas in case the initial owner is not the caller.
    /// For performance reasons, this function will not check if there
    /// is an existing owner.
    function _initializeOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                if sload(ownerSlot) {
                    mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
                    revert(0x1c, 0x04)
                }
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(_OWNER_SLOT, newOwner)
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        }
    }

    /// @dev Sets the owner directly without authorization guard.
    function _setOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, newOwner)
            }
        }
    }

    /// @dev Throws if the sender is not the owner.
    function _checkOwner() internal view virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // If the caller is not the stored owner, revert.
            if iszero(eq(caller(), sload(_OWNER_SLOT))) {
                mstore(0x00, 0x82b42900) // `Unauthorized()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns how long a two-step ownership handover is valid for in seconds.
    /// Override to return a different value if needed.
    /// Made internal to conserve bytecode. Wrap it in a public function if needed.
    function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
        return 48 * 3600;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  PUBLIC UPDATE FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Allows the owner to transfer the ownership to `newOwner`.
    function transferOwnership(address newOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(shl(96, newOwner)) {
                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
        }
        _setOwner(newOwner);
    }

    /// @dev Allows the owner to renounce their ownership.
    function renounceOwnership() public payable virtual onlyOwner {
        _setOwner(address(0));
    }

    /// @dev Request a two-step ownership handover to the caller.
    /// The request will automatically expire in 48 hours (172800 seconds) by default.
    function requestOwnershipHandover() public payable virtual {
        unchecked {
            uint256 expires = block.timestamp + _ownershipHandoverValidFor();
            /// @solidity memory-safe-assembly
            assembly {
                // Compute and set the handover slot to `expires`.
                mstore(0x0c, _HANDOVER_SLOT_SEED)
                mstore(0x00, caller())
                sstore(keccak256(0x0c, 0x20), expires)
                // Emit the {OwnershipHandoverRequested} event.
                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
            }
        }
    }

    /// @dev Cancels the two-step ownership handover to the caller, if any.
    function cancelOwnershipHandover() public payable virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x20), 0)
            // Emit the {OwnershipHandoverCanceled} event.
            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
        }
    }

    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            let handoverSlot := keccak256(0x0c, 0x20)
            // If the handover does not exist, or has expired.
            if gt(timestamp(), sload(handoverSlot)) {
                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
                revert(0x1c, 0x04)
            }
            // Set the handover slot to 0.
            sstore(handoverSlot, 0)
        }
        _setOwner(pendingOwner);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   PUBLIC READ FUNCTIONS                    */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the owner of the contract.
    function owner() public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := sload(_OWNER_SLOT)
        }
    }

    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
    function ownershipHandoverExpiresAt(address pendingOwner)
        public
        view
        virtual
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute the handover slot.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            // Load the handover slot.
            result := sload(keccak256(0x0c, 0x20))
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         MODIFIERS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Marks a function as only callable by the owner.
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }
}

File 5 of 7 : MerkleProofLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Gas optimized verification of proof of inclusion for a leaf in a Merkle tree.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol)
library MerkleProofLib {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*            MERKLE PROOF VERIFICATION OPERATIONS            */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf)
        internal
        pure
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(proof) {
                // Initialize `offset` to the offset of `proof` elements in memory.
                let offset := add(proof, 0x20)
                // Left shift by 5 is equivalent to multiplying by 0x20.
                let end := add(offset, shl(5, mload(proof)))
                // Iterate over proof elements to compute root hash.
                for {} 1 {} {
                    // Slot of `leaf` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(leaf, mload(offset)))
                    // Store elements to hash contiguously in scratch space.
                    // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.
                    mstore(scratch, leaf)
                    mstore(xor(scratch, 0x20), mload(offset))
                    // Reuse `leaf` to store the hash to reduce stack operations.
                    leaf := keccak256(0x00, 0x40)
                    offset := add(offset, 0x20)
                    if iszero(lt(offset, end)) { break }
                }
            }
            isValid := eq(leaf, root)
        }
    }

    /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf)
        internal
        pure
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            if proof.length {
                // Left shift by 5 is equivalent to multiplying by 0x20.
                let end := add(proof.offset, shl(5, proof.length))
                // Initialize `offset` to the offset of `proof` in the calldata.
                let offset := proof.offset
                // Iterate over proof elements to compute root hash.
                for {} 1 {} {
                    // Slot of `leaf` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(leaf, calldataload(offset)))
                    // Store elements to hash contiguously in scratch space.
                    // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.
                    mstore(scratch, leaf)
                    mstore(xor(scratch, 0x20), calldataload(offset))
                    // Reuse `leaf` to store the hash to reduce stack operations.
                    leaf := keccak256(0x00, 0x40)
                    offset := add(offset, 0x20)
                    if iszero(lt(offset, end)) { break }
                }
            }
            isValid := eq(leaf, root)
        }
    }

    /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,
    /// given `proof` and `flags`.
    ///
    /// Note:
    /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`
    ///   will always return false.
    /// - The sum of the lengths of `proof` and `leaves` must never overflow.
    /// - Any non-zero word in the `flags` array is treated as true.
    /// - The memory offset of `proof` must be non-zero
    ///   (i.e. `proof` is not pointing to the scratch space).
    function verifyMultiProof(
        bytes32[] memory proof,
        bytes32 root,
        bytes32[] memory leaves,
        bool[] memory flags
    ) internal pure returns (bool isValid) {
        // Rebuilds the root by consuming and producing values on a queue.
        // The queue starts with the `leaves` array, and goes into a `hashes` array.
        // After the process, the last element on the queue is verified
        // to be equal to the `root`.
        //
        // The `flags` array denotes whether the sibling
        // should be popped from the queue (`flag == true`), or
        // should be popped from the `proof` (`flag == false`).
        /// @solidity memory-safe-assembly
        assembly {
            // Cache the lengths of the arrays.
            let leavesLength := mload(leaves)
            let proofLength := mload(proof)
            let flagsLength := mload(flags)

            // Advance the pointers of the arrays to point to the data.
            leaves := add(0x20, leaves)
            proof := add(0x20, proof)
            flags := add(0x20, flags)

            // If the number of flags is correct.
            for {} eq(add(leavesLength, proofLength), add(flagsLength, 1)) {} {
                // For the case where `proof.length + leaves.length == 1`.
                if iszero(flagsLength) {
                    // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.
                    isValid := eq(mload(xor(leaves, mul(xor(proof, leaves), proofLength))), root)
                    break
                }

                // The required final proof offset if `flagsLength` is not zero, otherwise zero.
                let proofEnd := add(proof, shl(5, proofLength))
                // We can use the free memory space for the queue.
                // We don't need to allocate, since the queue is temporary.
                let hashesFront := mload(0x40)
                // Copy the leaves into the hashes.
                // Sometimes, a little memory expansion costs less than branching.
                // Should cost less, even with a high free memory offset of 0x7d00.
                leavesLength := shl(5, leavesLength)
                for { let i := 0 } iszero(eq(i, leavesLength)) { i := add(i, 0x20) } {
                    mstore(add(hashesFront, i), mload(add(leaves, i)))
                }
                // Compute the back of the hashes.
                let hashesBack := add(hashesFront, leavesLength)
                // This is the end of the memory for the queue.
                // We recycle `flagsLength` to save on stack variables (sometimes save gas).
                flagsLength := add(hashesBack, shl(5, flagsLength))

                for {} 1 {} {
                    // Pop from `hashes`.
                    let a := mload(hashesFront)
                    // Pop from `hashes`.
                    let b := mload(add(hashesFront, 0x20))
                    hashesFront := add(hashesFront, 0x40)

                    // If the flag is false, load the next proof,
                    // else, pops from the queue.
                    if iszero(mload(flags)) {
                        // Loads the next proof.
                        b := mload(proof)
                        proof := add(proof, 0x20)
                        // Unpop from `hashes`.
                        hashesFront := sub(hashesFront, 0x20)
                    }

                    // Advance to the next flag.
                    flags := add(flags, 0x20)

                    // Slot of `a` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(a, b))
                    // Hash the scratch space and push the result onto the queue.
                    mstore(scratch, a)
                    mstore(xor(scratch, 0x20), b)
                    mstore(hashesBack, keccak256(0x00, 0x40))
                    hashesBack := add(hashesBack, 0x20)
                    if iszero(lt(hashesBack, flagsLength)) { break }
                }
                isValid :=
                    and(
                        // Checks if the last value in the queue is same as the root.
                        eq(mload(sub(hashesBack, 0x20)), root),
                        // And whether all the proofs are used, if required.
                        eq(proofEnd, proof)
                    )
                break
            }
        }
    }

    /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,
    /// given `proof` and `flags`.
    ///
    /// Note:
    /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`
    ///   will always return false.
    /// - Any non-zero word in the `flags` array is treated as true.
    /// - The calldata offset of `proof` must be non-zero
    ///   (i.e. `proof` is from a regular Solidity function with a 4-byte selector).
    function verifyMultiProofCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32[] calldata leaves,
        bool[] calldata flags
    ) internal pure returns (bool isValid) {
        // Rebuilds the root by consuming and producing values on a queue.
        // The queue starts with the `leaves` array, and goes into a `hashes` array.
        // After the process, the last element on the queue is verified
        // to be equal to the `root`.
        //
        // The `flags` array denotes whether the sibling
        // should be popped from the queue (`flag == true`), or
        // should be popped from the `proof` (`flag == false`).
        /// @solidity memory-safe-assembly
        assembly {
            // If the number of flags is correct.
            for {} eq(add(leaves.length, proof.length), add(flags.length, 1)) {} {
                // For the case where `proof.length + leaves.length == 1`.
                if iszero(flags.length) {
                    // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.
                    // forgefmt: disable-next-item
                    isValid := eq(
                        calldataload(
                            xor(leaves.offset, mul(xor(proof.offset, leaves.offset), proof.length))
                        ),
                        root
                    )
                    break
                }

                // The required final proof offset if `flagsLength` is not zero, otherwise zero.
                let proofEnd := add(proof.offset, shl(5, proof.length))
                // We can use the free memory space for the queue.
                // We don't need to allocate, since the queue is temporary.
                let hashesFront := mload(0x40)
                // Copy the leaves into the hashes.
                // Sometimes, a little memory expansion costs less than branching.
                // Should cost less, even with a high free memory offset of 0x7d00.
                calldatacopy(hashesFront, leaves.offset, shl(5, leaves.length))
                // Compute the back of the hashes.
                let hashesBack := add(hashesFront, shl(5, leaves.length))
                // This is the end of the memory for the queue.
                // We recycle `flagsLength` to save on stack variables (sometimes save gas).
                flags.length := add(hashesBack, shl(5, flags.length))

                // We don't need to make a copy of `proof.offset` or `flags.offset`,
                // as they are pass-by-value (this trick may not always save gas).

                for {} 1 {} {
                    // Pop from `hashes`.
                    let a := mload(hashesFront)
                    // Pop from `hashes`.
                    let b := mload(add(hashesFront, 0x20))
                    hashesFront := add(hashesFront, 0x40)

                    // If the flag is false, load the next proof,
                    // else, pops from the queue.
                    if iszero(calldataload(flags.offset)) {
                        // Loads the next proof.
                        b := calldataload(proof.offset)
                        proof.offset := add(proof.offset, 0x20)
                        // Unpop from `hashes`.
                        hashesFront := sub(hashesFront, 0x20)
                    }

                    // Advance to the next flag offset.
                    flags.offset := add(flags.offset, 0x20)

                    // Slot of `a` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(a, b))
                    // Hash the scratch space and push the result onto the queue.
                    mstore(scratch, a)
                    mstore(xor(scratch, 0x20), b)
                    mstore(hashesBack, keccak256(0x00, 0x40))
                    hashesBack := add(hashesBack, 0x20)
                    if iszero(lt(hashesBack, flags.length)) { break }
                }
                isValid :=
                    and(
                        // Checks if the last value in the queue is same as the root.
                        eq(mload(sub(hashesBack, 0x20)), root),
                        // And whether all the proofs are used, if required.
                        eq(proofEnd, proof.offset)
                    )
                break
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   EMPTY CALLDATA HELPERS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns an empty calldata bytes32 array.
    function emptyProof() internal pure returns (bytes32[] calldata proof) {
        /// @solidity memory-safe-assembly
        assembly {
            proof.length := 0
        }
    }

    /// @dev Returns an empty calldata bytes32 array.
    function emptyLeaves() internal pure returns (bytes32[] calldata leaves) {
        /// @solidity memory-safe-assembly
        assembly {
            leaves.length := 0
        }
    }

    /// @dev Returns an empty calldata bool array.
    function emptyFlags() internal pure returns (bool[] calldata flags) {
        /// @solidity memory-safe-assembly
        assembly {
            flags.length := 0
        }
    }
}

File 6 of 7 : IShishi.sol
// SPDX-License-Identifier: AGPL-3.0-only+VPL
pragma solidity ^0.8.16;

interface IShishi {
    struct Phases {
        uint64 startOne; // timestamp start of phase one
        uint64 startTwo; // timestamp start of phase two
        uint64 startThree; // timestamp start of phase three
    }

    struct Claimed {
        uint8 paid; // paid mints
        uint8 free; // free mints
    }

    struct Roots {
        bytes32 rootOne; // root of the first whitelist merkle tree
        bytes32 rootTwo; // root of the second whitelist merkle tree
    }

    /// Thrown if the base token metadata URI is locked to updates.
    error BaseURILocked();

    /// Thrown if an invalid proof is being supplied by the caller.
    error CannotClaimInvalidProof();

    /// Thrown if the mint phase has not yet started.
    error NotStartedYet();

    /// Thrown if the caller did not supply enough payment.
    error NotEnoughPayment();

    /// Thrown if there are no more Shishis left to mint.
    error OutOfStock();

    /// Whether pausing / unpausing is locked.
    error PausedLocked();

    /// Transfers (including minting) are paused.
    error Paused();

    /**
     * This is thrown if a particular `msg.sender` (or, additionally, a `tx.origin`
     *   acting on behalf of smart contract caller) has run out of permitted mints.
     *   This does not and is not meant to protect against Sybil attacks originated by
     *   multiple different accounts.
     */
    error OutOfMints();

    // Thrown if sweeping funds from this contract fails.
    error SweepingTransferFailed();

    /// Emitted when user mints during phase one.
    event PhaseOneMinted(address indexed account, uint8 paid, uint8 free);

    /// Emitted when user mints during phase two.
    event PhaseTwoMinted(address indexed account, uint8 paid, uint8 free);

    /// Emitted when user mints during phase three.
    event PhaseThreeMinted(address indexed account, uint8 paid);
}

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

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@ERC721A/=lib/ERC721A/",
    "operator-filter-registry/=lib/operator-filter-registry/",
    "solady/=lib/solady/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ERC721A/=lib/ERC721A/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_initialBaseURI","type":"string"},{"components":[{"internalType":"uint64","name":"startOne","type":"uint64"},{"internalType":"uint64","name":"startTwo","type":"uint64"},{"internalType":"uint64","name":"startThree","type":"uint64"}],"internalType":"struct IShishi.Phases","name":"_phasetimes","type":"tuple"},{"components":[{"internalType":"bytes32","name":"rootOne","type":"bytes32"},{"internalType":"bytes32","name":"rootTwo","type":"bytes32"}],"internalType":"struct IShishi.Roots","name":"_roots","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BaseURILocked","type":"error"},{"inputs":[],"name":"CannotClaimInvalidProof","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"NotEnoughPayment","type":"error"},{"inputs":[],"name":"NotStartedYet","type":"error"},{"inputs":[],"name":"OutOfMints","type":"error"},{"inputs":[],"name":"OutOfStock","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"Paused","type":"error"},{"inputs":[],"name":"PausedLocked","type":"error"},{"inputs":[],"name":"SweepingTransferFailed","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":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint8","name":"paid","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"free","type":"uint8"}],"name":"PhaseOneMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint8","name":"paid","type":"uint8"}],"name":"PhaseThreeMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint8","name":"paid","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"free","type":"uint8"}],"name":"PhaseTwoMinted","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":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"claimedOne","outputs":[{"components":[{"internalType":"uint8","name":"paid","type":"uint8"},{"internalType":"uint8","name":"free","type":"uint8"}],"internalType":"struct IShishi.Claimed","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"claimedThree","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"claimedTwo","outputs":[{"components":[{"internalType":"uint8","name":"paid","type":"uint8"},{"internalType":"uint8","name":"free","type":"uint8"}],"internalType":"struct IShishi.Claimed","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fcfs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_paidWant","type":"uint8"},{"internalType":"uint8","name":"_freeWant","type":"uint8"},{"internalType":"uint8","name":"_paidMax","type":"uint8"},{"internalType":"uint8","name":"_freeMax","type":"uint8"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintOne","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_amount","type":"uint8"}],"name":"mintThree","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_paidWant","type":"uint8"},{"internalType":"uint8","name":"_freeWant","type":"uint8"},{"internalType":"uint8","name":"_paidMax","type":"uint8"},{"internalType":"uint8","name":"_freeMax","type":"uint8"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintTwo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","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":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pausedLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phasetimes","outputs":[{"internalType":"uint64","name":"startOne","type":"uint64"},{"internalType":"uint64","name":"startTwo","type":"uint64"},{"internalType":"uint64","name":"startThree","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"roots","outputs":[{"internalType":"bytes32","name":"rootOne","type":"bytes32"},{"internalType":"bytes32","name":"rootTwo","type":"bytes32"}],"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":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setMaxPerWalletPublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startOne","type":"uint256"},{"internalType":"uint64","name":"_startTwo","type":"uint64"},{"internalType":"uint64","name":"_startThree","type":"uint64"}],"name":"setPhases","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_rootOne","type":"bytes32"},{"internalType":"bytes32","name":"_rootTwo","type":"bytes32"}],"name":"setRoots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"}]

6002600a5560c06040526005608090815264173539b7b760d91b60a052600b906200002b90826200035e565b503480156200003957600080fd5b5060405162002705380380620027058339810160408190526200005c9162000544565b6040518060400160405280600681526020016553686973686960d01b8152506040518060400160405280600681526020016553484953484960d01b8152508160029081620000ab91906200035e565b506003620000ba82826200035e565b5050600160005550620000cd8462000159565b6008620000db84826200035e565b508151600c805460208086015160408701516001600160401b03908116600160801b02600160801b600160c01b031992821668010000000000000000026001600160801b0319909516919096161792909217919091169290921790558151600d55810151600e556200014f84600162000195565b5050505062000643565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6000805490829003620001bb5760405163b562e8dd60e01b815260040160405180910390fd5b620001ca600084838562000289565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020620026e58339815191528180a4600183015b818114620002595780836000600080516020620026e5833981519152600080a460010162000230565b50816000036200027b57604051622e076360e81b815260040160405180910390fd5b60005550505050565b505050565b60095462010000900460ff1615620002b4576040516313d0ff5960e31b815260040160405180910390fd5b50505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002e557607f821691505b6020821081036200030657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028457600081815260208120601f850160051c81016020861015620003355750805b601f850160051c820191505b81811015620003565782815560010162000341565b505050505050565b81516001600160401b038111156200037a576200037a620002ba565b62000392816200038b8454620002d0565b846200030c565b602080601f831160018114620003ca5760008415620003b15750858301515b600019600386901b1c1916600185901b17855562000356565b600085815260208120601f198616915b82811015620003fb57888601518255948401946001909101908401620003da565b50858210156200041a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604051601f8201601f191681016001600160401b0381118282101715620004555762000455620002ba565b604052919050565b80516001600160401b03811681146200047557600080fd5b919050565b6000606082840312156200048d57600080fd5b604051606081016001600160401b0381118282101715620004b257620004b2620002ba565b604052905080620004c3836200045d565b8152620004d3602084016200045d565b6020820152620004e6604084016200045d565b60408201525092915050565b6000604082840312156200050557600080fd5b604080519081016001600160401b03811182821017156200052a576200052a620002ba565b604052825181526020928301519281019290925250919050565b60008060008060e085870312156200055b57600080fd5b84516001600160a01b03811681146200057357600080fd5b602086810151919550906001600160401b03808211156200059357600080fd5b818801915088601f830112620005a857600080fd5b815181811115620005bd57620005bd620002ba565b620005d1601f8201601f191685016200042a565b91508082528984828501011115620005e857600080fd5b60005b8181101562000608578381018501518382018601528401620005eb565b506000848284010152508095505050506200062786604087016200047a565b9150620006388660a08701620004f2565b905092959194509250565b61209280620006536000396000f3fe60806040526004361061023b5760003560e01c806354d1f13d1161012e57806395d89b41116100ab578063cc6c47e21161006f578063cc6c47e214610685578063e985e9c5146106a5578063f04e283e146106c5578063f2fde38b146106d8578063fee81cf4146106eb57600080fd5b806395d89b41146105fd578063a22cb46514610612578063ab864ad914610632578063b88d4fde14610652578063c87b56dd1461066557600080fd5b8063715018a6116100f2578063715018a6146105495780638777bc17146105515780638a4d5e79146105b15780638b533ea4146105c45780638da5cb5b146105e457600080fd5b806354d1f13d146104c157806355f804b3146104c95780635c975abb146104e95780636352211e1461050957806370a082311461052957600080fd5b806325692962116101bc57806342842e0e1161018057806342842e0e1461043557806347e06a5d1461044857806349b9312a146104675780634a0a9a7e1461049957806353df5c7c146104ac57600080fd5b806325692962146103b45780632853ddf6146103bc5780632cadce8d146103d2578063393fe1cd146103e55780633e503de61461041557600080fd5b806315effce61161020357806315effce61461030457806316c38b3c1461034557806318160ddd146103655780632104b3a71461038c57806323b872dd146103a157600080fd5b806301681a621461024057806301ffc9a71461026257806306fdde0314610297578063081812fc146102b9578063095ea7b3146102f1575b600080fd5b34801561024c57600080fd5b5061026061025b366004611967565b61071e565b005b34801561026e57600080fd5b5061028261027d366004611998565b61079e565b60405190151581526020015b60405180910390f35b3480156102a357600080fd5b506102ac6107f0565b60405161028e9190611a05565b3480156102c557600080fd5b506102d96102d4366004611a18565b610882565b6040516001600160a01b03909116815260200161028e565b6102606102ff366004611a31565b6108c6565b34801561031057600080fd5b5061032461031f366004611967565b610966565b60408051825160ff908116825260209384015116928101929092520161028e565b34801561035157600080fd5b50610260610360366004611a6b565b6109d0565b34801561037157600080fd5b5060015460005403600019015b60405190815260200161028e565b34801561039857600080fd5b50610260610a1a565b6102606103af366004611a86565b610a33565b610260610bd9565b3480156103c857600080fd5b5061037e600f5481565b6102606103e0366004611ad3565b610c28565b3480156103f157600080fd5b50600d54600e54610400919082565b6040805192835260208301919091520161028e565b34801561042157600080fd5b50610260610430366004611ba0565b610d45565b610260610443366004611a86565b610db9565b34801561045457600080fd5b5060095461028290610100900460ff1681565b34801561047357600080fd5b50610487610482366004611967565b610dd9565b60405160ff909116815260200161028e565b6102606104a7366004611ad3565b610dfa565b3480156104b857600080fd5b50610260610eb6565b610260610ecd565b3480156104d557600080fd5b506102606104e4366004611c67565b610f09565b3480156104f557600080fd5b506009546102829062010000900460ff1681565b34801561051557600080fd5b506102d9610524366004611a18565b610f41565b34801561053557600080fd5b5061037e610544366004611967565b610f4c565b610260610f9a565b34801561055d57600080fd5b50600c54610587906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b039485168152928416602084015292169181019190915260600161028e565b6102606105bf366004611caf565b610fae565b3480156105d057600080fd5b506102606105df366004611a18565b61113f565b3480156105f057600080fd5b50638b78c6d819546102d9565b34801561060957600080fd5b506102ac61114c565b34801561061e57600080fd5b5061026061062d366004611cca565b61115b565b34801561063e57600080fd5b5061026061064d366004611cfd565b6111c7565b610260610660366004611d1f565b6111ed565b34801561067157600080fd5b506102ac610680366004611a18565b611237565b34801561069157600080fd5b506103246106a0366004611967565b61126e565b3480156106b157600080fd5b506102826106c0366004611d9a565b6112d2565b6102606106d3366004611967565b611300565b6102606106e6366004611967565b61133d565b3480156106f757600080fd5b5061037e610706366004611967565b63389a75e1600c908152600091909152602090205490565b610726611364565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610773576040519150601f19603f3d011682016040523d82523d6000602084013e610778565b606091505b505090508061079a57604051639081276360e01b815260040160405180910390fd5b5050565b60006301ffc9a760e01b6001600160e01b0319831614806107cf57506380ac58cd60e01b6001600160e01b03198316145b806107ea5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060600280546107ff90611dc4565b80601f016020809104026020016040519081016040528092919081815260200182805461082b90611dc4565b80156108785780601f1061084d57610100808354040283529160200191610878565b820191906000526020600020905b81548152906001019060200180831161085b57829003601f168201915b5050505050905090565b600061088d8261137f565b6108aa576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006108d182610f41565b9050336001600160a01b0382161461090a576108ed81336112d2565b61090a576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60408051808201909152600080825260208201526000610985836113b4565b905060405180604001604052806109af6002846001600160401b03166113d290919063ffffffff16565b60ff16815260200164ffffffffff601884901c165b60ff1690529392505050565b6109d8611364565b600954610100900460ff1615610a015760405163134e5f1f60e21b815260040160405180910390fd5b6009805462ff0000191662010000831515021790555b50565b610a22611364565b6009805461ff001916610100179055565b6000610a3e826113e8565b9050836001600160a01b0316816001600160a01b031614610a715760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610abe57610aa186336112d2565b610abe57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610ae557604051633a954ecd60e21b815260040160405180910390fd5b610af28686866001611457565b8015610afd57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003610b8f57600184016000818152600460205260408120549003610b8d576000548114610b8d5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b60006202a3006001600160401b03164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b6000610c3333610966565b905060ff861615610c7d5761012c600f5410610c625760405163ade1cb4160e01b815260040160405180910390fd5b8560ff16600f6000828254610c779190611e14565b90915550505b600c54600e54610caa91899189918991899189918991600160401b90046001600160401b03169089611481565b8681600001818151610cbc9190611e27565b60ff16905250602081018051879190610cd6908390611e27565b60ff16905250610ce633826115f0565b610cfc33610cf4888a611e27565b60ff16611664565b6040805160ff808a1682528816602082015233917f7cb1d1f12896e0890b79b005120d2d562e55a23bb8b2b1eaf7187a1b681d0a9391015b60405180910390a250505050505050565b610d4d611364565b604080516060810182526001600160401b0394851680825293851660208201819052929094169301839052600c80546fffffffffffffffffffffffffffffffff1916909217600160401b9091021767ffffffffffffffff60801b1916600160801b909202919091179055565b610dd4838383604051806020016040528060008152506111ed565b505050565b600080610de5836113b4565b905063ffffffff602082901c165b9392505050565b6000610e053361126e565b600c54600d54919250610e30918991899189918991899189916001600160401b039091169089611481565b8681600001818151610e429190611e27565b60ff16905250602081018051879190610e5c908390611e27565b60ff16905250610e6c338261176f565b610e7a33610cf4888a611e27565b6040805160ff808a1682528816602082015233917fc1522a5472c279530a0a1fd3a885f9b16157f0ba415ad892117b2e23567f61709101610d34565b610ebe611364565b6009805460ff19166001179055565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b610f11611364565b60095460ff1615610f355760405163696c636960e01b815260040160405180910390fd5b600861079a8282611e86565b60006107ea826113e8565b60006001600160a01b038216610f75576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b610fa2611364565b610fac6000611790565b565b600c54600160801b90046001600160401b0316421015610fe157604051631864d7ab60e21b815260040160405180910390fd5b610dc08160ff16610ff56000546000190190565b610fff9190611e14565b111561101e5760405163ade1cb4160e01b815260040160405180910390fd5b600061102933610dd9565b600a549091506110398383611e27565b60ff16111561105b576040516307bbb6ad60e41b815260040160405180910390fd5b61106f60ff8316668e1bc9bf040000611f45565b34101561108f57604051631b4d7fe360e21b815260040160405180910390fd5b3332146110e85760006110a132610dd9565b600a549091506110b18483611e27565b60ff1611156110d3576040516307bbb6ad60e41b815260040160405180910390fd5b6110e6326110e18584611e27565b6117ce565b505b6110f6336110e18484611e27565b611103338360ff16611664565b60405160ff8316815233907fdc82077b601a2234da9ad57e97f29b49f5b11c88269b6e8ea102ce187d2693179060200160405180910390a25050565b611147611364565b600a55565b6060600380546107ff90611dc4565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6111cf611364565b60408051808201909152828152602001819052600d91909155600e55565b6111f8848484610a33565b6001600160a01b0383163b1561123157611214848484846117e1565b611231576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60606008611244836118cd565b600b60405160200161125893929190611fcf565b6040516020818303038152906040529050919050565b6040805180820190915260008082526020820152600061128d836113b4565b905060405180604001604052806112b76000846001600160401b03166113d290919063ffffffff16565b60ff16815260200166ffffffffffffff600884901c166109c4565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b611308611364565b63389a75e1600c52806000526020600c20805442111561133057636f5e88186000526004601cfd5b60009055610a1781611790565b611345611364565b8060601b61135b57637448fbae6000526004601cfd5b610a1781611790565b638b78c6d819543314610fac576382b429006000526004601cfd5b600081600111158015611393575060005482105b80156107ea575050600090815260046020526040902054600160e01b161590565b6001600160a01b031660009081526005602052604090205460c01c90565b6001600160401b038216600382901b1c92915050565b6000818060011161143e5760005481101561143e5760008181526004602052604081205490600160e01b8216900361143c575b80600003610df357506000190160008181526004602052604090205461141b565b505b604051636f96cda160e11b815260040160405180910390fd5b60095462010000900460ff1615611231576040516313d0ff5960e31b815260040160405180910390fd5b824210156114a257604051631864d7ab60e21b815260040160405180910390fd5b610dc08860ff168a60ff166114ba6000546000190190565b6114c49190611e14565b6114ce9190611e14565b11156114ed5760405163ade1cb4160e01b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b16602082015260ff8089166034830152871660548201526115419086908690859060740160405160208183030381529060405280519060200120611911565b61155e57604051634db2932760e11b815260040160405180910390fd5b805160ff881690611570908b90611e27565b60ff16118061159357508560ff1688826020015161158e9190611e27565b60ff16115b156115b1576040516307bbb6ad60e41b815260040160405180910390fd5b6115c560ff8a1666753d533d968000611f45565b3410156115e557604051631b4d7fe360e21b815260040160405180910390fd5b505050505050505050565b61079a8261163260038460200151611611600287600001516116118a6113b4565b6001600160401b031660039290921b82811c60ff92831618909116901b1890565b6001600160a01b03909116600090815260056020526040902080546001600160c01b031660c09290921b919091179055565b60008054908290036116895760405163b562e8dd60e01b815260040160405180910390fd5b6116966000848385611457565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461174557808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460010161170d565b508160000361176657604051622e076360e81b815260040160405180910390fd5b60005550505050565b61079a8261163260018460200151611611600087600001516116118a6113b4565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b61079a82611632600484611611876113b4565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611816903390899088908890600401612002565b6020604051808303816000875af1925050508015611851575060408051601f3d908101601f1916820190925261184e9181019061203f565b60015b6118af573d80801561187f576040519150601f19603f3d011682016040523d82523d6000602084013e611884565b606091505b5080516000036118a7576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a9004806118e75750819003601f19909101908152919050565b60008315611943578360051b8501855b803580851160051b948552602094851852604060002093018181106119215750505b501492915050565b80356001600160a01b038116811461196257600080fd5b919050565b60006020828403121561197957600080fd5b610df38261194b565b6001600160e01b031981168114610a1757600080fd5b6000602082840312156119aa57600080fd5b8135610df381611982565b60005b838110156119d05781810151838201526020016119b8565b50506000910152565b600081518084526119f18160208601602086016119b5565b601f01601f19169290920160200192915050565b602081526000610df360208301846119d9565b600060208284031215611a2a57600080fd5b5035919050565b60008060408385031215611a4457600080fd5b611a4d8361194b565b946020939093013593505050565b8035801515811461196257600080fd5b600060208284031215611a7d57600080fd5b610df382611a5b565b600080600060608486031215611a9b57600080fd5b611aa48461194b565b9250611ab26020850161194b565b9150604084013590509250925092565b803560ff8116811461196257600080fd5b60008060008060008060a08789031215611aec57600080fd5b611af587611ac2565b9550611b0360208801611ac2565b9450611b1160408801611ac2565b9350611b1f60608801611ac2565b925060808701356001600160401b0380821115611b3b57600080fd5b818901915089601f830112611b4f57600080fd5b813581811115611b5e57600080fd5b8a60208260051b8501011115611b7357600080fd5b6020830194508093505050509295509295509295565b80356001600160401b038116811461196257600080fd5b600080600060608486031215611bb557600080fd5b83359250611bc560208501611b89565b9150611bd360408501611b89565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115611c0c57611c0c611bdc565b604051601f8501601f19908116603f01168101908282118183101715611c3457611c34611bdc565b81604052809350858152868686011115611c4d57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611c7957600080fd5b81356001600160401b03811115611c8f57600080fd5b8201601f81018413611ca057600080fd5b6118c584823560208401611bf2565b600060208284031215611cc157600080fd5b610df382611ac2565b60008060408385031215611cdd57600080fd5b611ce68361194b565b9150611cf460208401611a5b565b90509250929050565b60008060408385031215611d1057600080fd5b50508035926020909101359150565b60008060008060808587031215611d3557600080fd5b611d3e8561194b565b9350611d4c6020860161194b565b92506040850135915060608501356001600160401b03811115611d6e57600080fd5b8501601f81018713611d7f57600080fd5b611d8e87823560208401611bf2565b91505092959194509250565b60008060408385031215611dad57600080fd5b611db68361194b565b9150611cf46020840161194b565b600181811c90821680611dd857607f821691505b602082108103611df857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156107ea576107ea611dfe565b60ff81811683821601908111156107ea576107ea611dfe565b601f821115610dd457600081815260208120601f850160051c81016020861015611e675750805b601f850160051c820191505b81811015610bd157828155600101611e73565b81516001600160401b03811115611e9f57611e9f611bdc565b611eb381611ead8454611dc4565b84611e40565b602080601f831160018114611ee85760008415611ed05750858301515b600019600386901b1c1916600185901b178555610bd1565b600085815260208120601f198616915b82811015611f1757888601518255948401946001909101908401611ef8565b5085821015611f355787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176107ea576107ea611dfe565b60008154611f6981611dc4565b60018281168015611f815760018114611f9657611fc5565b60ff1984168752821515830287019450611fc5565b8560005260208060002060005b85811015611fbc5781548a820152908401908201611fa3565b50505082870194505b5050505092915050565b6000611fdb8286611f5c565b8451611feb8183602089016119b5565b611ff781830186611f5c565b979650505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612035908301846119d9565b9695505050505050565b60006020828403121561205157600080fd5b8151610df38161198256fea2646970667358221220bca9b3a18480cb99f50cbea490bbd3f3776826c548a55d4284ca4cf620e5c31664736f6c63430008140033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef000000000000000000000000e2ab52af4b18e494f03ed8519b5e448a48e92fd000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000006596c7f0000000000000000000000000000000000000000000000000000000006596d600000000000000000000000000000000000000000000000000000000006596e410f52d7b0b281bc48b2909bed0c02a3a4a345533dadc17557f2e190d32040fff7e8dea5bb28cd7463075dba0b8402fe6016839394f591cd880d940d51412007a4b000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f6170692e7368697368693532302e696f2f6170692f76312f7368697368692f00000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061023b5760003560e01c806354d1f13d1161012e57806395d89b41116100ab578063cc6c47e21161006f578063cc6c47e214610685578063e985e9c5146106a5578063f04e283e146106c5578063f2fde38b146106d8578063fee81cf4146106eb57600080fd5b806395d89b41146105fd578063a22cb46514610612578063ab864ad914610632578063b88d4fde14610652578063c87b56dd1461066557600080fd5b8063715018a6116100f2578063715018a6146105495780638777bc17146105515780638a4d5e79146105b15780638b533ea4146105c45780638da5cb5b146105e457600080fd5b806354d1f13d146104c157806355f804b3146104c95780635c975abb146104e95780636352211e1461050957806370a082311461052957600080fd5b806325692962116101bc57806342842e0e1161018057806342842e0e1461043557806347e06a5d1461044857806349b9312a146104675780634a0a9a7e1461049957806353df5c7c146104ac57600080fd5b806325692962146103b45780632853ddf6146103bc5780632cadce8d146103d2578063393fe1cd146103e55780633e503de61461041557600080fd5b806315effce61161020357806315effce61461030457806316c38b3c1461034557806318160ddd146103655780632104b3a71461038c57806323b872dd146103a157600080fd5b806301681a621461024057806301ffc9a71461026257806306fdde0314610297578063081812fc146102b9578063095ea7b3146102f1575b600080fd5b34801561024c57600080fd5b5061026061025b366004611967565b61071e565b005b34801561026e57600080fd5b5061028261027d366004611998565b61079e565b60405190151581526020015b60405180910390f35b3480156102a357600080fd5b506102ac6107f0565b60405161028e9190611a05565b3480156102c557600080fd5b506102d96102d4366004611a18565b610882565b6040516001600160a01b03909116815260200161028e565b6102606102ff366004611a31565b6108c6565b34801561031057600080fd5b5061032461031f366004611967565b610966565b60408051825160ff908116825260209384015116928101929092520161028e565b34801561035157600080fd5b50610260610360366004611a6b565b6109d0565b34801561037157600080fd5b5060015460005403600019015b60405190815260200161028e565b34801561039857600080fd5b50610260610a1a565b6102606103af366004611a86565b610a33565b610260610bd9565b3480156103c857600080fd5b5061037e600f5481565b6102606103e0366004611ad3565b610c28565b3480156103f157600080fd5b50600d54600e54610400919082565b6040805192835260208301919091520161028e565b34801561042157600080fd5b50610260610430366004611ba0565b610d45565b610260610443366004611a86565b610db9565b34801561045457600080fd5b5060095461028290610100900460ff1681565b34801561047357600080fd5b50610487610482366004611967565b610dd9565b60405160ff909116815260200161028e565b6102606104a7366004611ad3565b610dfa565b3480156104b857600080fd5b50610260610eb6565b610260610ecd565b3480156104d557600080fd5b506102606104e4366004611c67565b610f09565b3480156104f557600080fd5b506009546102829062010000900460ff1681565b34801561051557600080fd5b506102d9610524366004611a18565b610f41565b34801561053557600080fd5b5061037e610544366004611967565b610f4c565b610260610f9a565b34801561055d57600080fd5b50600c54610587906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b039485168152928416602084015292169181019190915260600161028e565b6102606105bf366004611caf565b610fae565b3480156105d057600080fd5b506102606105df366004611a18565b61113f565b3480156105f057600080fd5b50638b78c6d819546102d9565b34801561060957600080fd5b506102ac61114c565b34801561061e57600080fd5b5061026061062d366004611cca565b61115b565b34801561063e57600080fd5b5061026061064d366004611cfd565b6111c7565b610260610660366004611d1f565b6111ed565b34801561067157600080fd5b506102ac610680366004611a18565b611237565b34801561069157600080fd5b506103246106a0366004611967565b61126e565b3480156106b157600080fd5b506102826106c0366004611d9a565b6112d2565b6102606106d3366004611967565b611300565b6102606106e6366004611967565b61133d565b3480156106f757600080fd5b5061037e610706366004611967565b63389a75e1600c908152600091909152602090205490565b610726611364565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610773576040519150601f19603f3d011682016040523d82523d6000602084013e610778565b606091505b505090508061079a57604051639081276360e01b815260040160405180910390fd5b5050565b60006301ffc9a760e01b6001600160e01b0319831614806107cf57506380ac58cd60e01b6001600160e01b03198316145b806107ea5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060600280546107ff90611dc4565b80601f016020809104026020016040519081016040528092919081815260200182805461082b90611dc4565b80156108785780601f1061084d57610100808354040283529160200191610878565b820191906000526020600020905b81548152906001019060200180831161085b57829003601f168201915b5050505050905090565b600061088d8261137f565b6108aa576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006108d182610f41565b9050336001600160a01b0382161461090a576108ed81336112d2565b61090a576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60408051808201909152600080825260208201526000610985836113b4565b905060405180604001604052806109af6002846001600160401b03166113d290919063ffffffff16565b60ff16815260200164ffffffffff601884901c165b60ff1690529392505050565b6109d8611364565b600954610100900460ff1615610a015760405163134e5f1f60e21b815260040160405180910390fd5b6009805462ff0000191662010000831515021790555b50565b610a22611364565b6009805461ff001916610100179055565b6000610a3e826113e8565b9050836001600160a01b0316816001600160a01b031614610a715760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610abe57610aa186336112d2565b610abe57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610ae557604051633a954ecd60e21b815260040160405180910390fd5b610af28686866001611457565b8015610afd57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003610b8f57600184016000818152600460205260408120549003610b8d576000548114610b8d5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b60006202a3006001600160401b03164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b6000610c3333610966565b905060ff861615610c7d5761012c600f5410610c625760405163ade1cb4160e01b815260040160405180910390fd5b8560ff16600f6000828254610c779190611e14565b90915550505b600c54600e54610caa91899189918991899189918991600160401b90046001600160401b03169089611481565b8681600001818151610cbc9190611e27565b60ff16905250602081018051879190610cd6908390611e27565b60ff16905250610ce633826115f0565b610cfc33610cf4888a611e27565b60ff16611664565b6040805160ff808a1682528816602082015233917f7cb1d1f12896e0890b79b005120d2d562e55a23bb8b2b1eaf7187a1b681d0a9391015b60405180910390a250505050505050565b610d4d611364565b604080516060810182526001600160401b0394851680825293851660208201819052929094169301839052600c80546fffffffffffffffffffffffffffffffff1916909217600160401b9091021767ffffffffffffffff60801b1916600160801b909202919091179055565b610dd4838383604051806020016040528060008152506111ed565b505050565b600080610de5836113b4565b905063ffffffff602082901c165b9392505050565b6000610e053361126e565b600c54600d54919250610e30918991899189918991899189916001600160401b039091169089611481565b8681600001818151610e429190611e27565b60ff16905250602081018051879190610e5c908390611e27565b60ff16905250610e6c338261176f565b610e7a33610cf4888a611e27565b6040805160ff808a1682528816602082015233917fc1522a5472c279530a0a1fd3a885f9b16157f0ba415ad892117b2e23567f61709101610d34565b610ebe611364565b6009805460ff19166001179055565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b610f11611364565b60095460ff1615610f355760405163696c636960e01b815260040160405180910390fd5b600861079a8282611e86565b60006107ea826113e8565b60006001600160a01b038216610f75576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b610fa2611364565b610fac6000611790565b565b600c54600160801b90046001600160401b0316421015610fe157604051631864d7ab60e21b815260040160405180910390fd5b610dc08160ff16610ff56000546000190190565b610fff9190611e14565b111561101e5760405163ade1cb4160e01b815260040160405180910390fd5b600061102933610dd9565b600a549091506110398383611e27565b60ff16111561105b576040516307bbb6ad60e41b815260040160405180910390fd5b61106f60ff8316668e1bc9bf040000611f45565b34101561108f57604051631b4d7fe360e21b815260040160405180910390fd5b3332146110e85760006110a132610dd9565b600a549091506110b18483611e27565b60ff1611156110d3576040516307bbb6ad60e41b815260040160405180910390fd5b6110e6326110e18584611e27565b6117ce565b505b6110f6336110e18484611e27565b611103338360ff16611664565b60405160ff8316815233907fdc82077b601a2234da9ad57e97f29b49f5b11c88269b6e8ea102ce187d2693179060200160405180910390a25050565b611147611364565b600a55565b6060600380546107ff90611dc4565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6111cf611364565b60408051808201909152828152602001819052600d91909155600e55565b6111f8848484610a33565b6001600160a01b0383163b1561123157611214848484846117e1565b611231576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60606008611244836118cd565b600b60405160200161125893929190611fcf565b6040516020818303038152906040529050919050565b6040805180820190915260008082526020820152600061128d836113b4565b905060405180604001604052806112b76000846001600160401b03166113d290919063ffffffff16565b60ff16815260200166ffffffffffffff600884901c166109c4565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b611308611364565b63389a75e1600c52806000526020600c20805442111561133057636f5e88186000526004601cfd5b60009055610a1781611790565b611345611364565b8060601b61135b57637448fbae6000526004601cfd5b610a1781611790565b638b78c6d819543314610fac576382b429006000526004601cfd5b600081600111158015611393575060005482105b80156107ea575050600090815260046020526040902054600160e01b161590565b6001600160a01b031660009081526005602052604090205460c01c90565b6001600160401b038216600382901b1c92915050565b6000818060011161143e5760005481101561143e5760008181526004602052604081205490600160e01b8216900361143c575b80600003610df357506000190160008181526004602052604090205461141b565b505b604051636f96cda160e11b815260040160405180910390fd5b60095462010000900460ff1615611231576040516313d0ff5960e31b815260040160405180910390fd5b824210156114a257604051631864d7ab60e21b815260040160405180910390fd5b610dc08860ff168a60ff166114ba6000546000190190565b6114c49190611e14565b6114ce9190611e14565b11156114ed5760405163ade1cb4160e01b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b16602082015260ff8089166034830152871660548201526115419086908690859060740160405160208183030381529060405280519060200120611911565b61155e57604051634db2932760e11b815260040160405180910390fd5b805160ff881690611570908b90611e27565b60ff16118061159357508560ff1688826020015161158e9190611e27565b60ff16115b156115b1576040516307bbb6ad60e41b815260040160405180910390fd5b6115c560ff8a1666753d533d968000611f45565b3410156115e557604051631b4d7fe360e21b815260040160405180910390fd5b505050505050505050565b61079a8261163260038460200151611611600287600001516116118a6113b4565b6001600160401b031660039290921b82811c60ff92831618909116901b1890565b6001600160a01b03909116600090815260056020526040902080546001600160c01b031660c09290921b919091179055565b60008054908290036116895760405163b562e8dd60e01b815260040160405180910390fd5b6116966000848385611457565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461174557808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460010161170d565b508160000361176657604051622e076360e81b815260040160405180910390fd5b60005550505050565b61079a8261163260018460200151611611600087600001516116118a6113b4565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b61079a82611632600484611611876113b4565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611816903390899088908890600401612002565b6020604051808303816000875af1925050508015611851575060408051601f3d908101601f1916820190925261184e9181019061203f565b60015b6118af573d80801561187f576040519150601f19603f3d011682016040523d82523d6000602084013e611884565b606091505b5080516000036118a7576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a9004806118e75750819003601f19909101908152919050565b60008315611943578360051b8501855b803580851160051b948552602094851852604060002093018181106119215750505b501492915050565b80356001600160a01b038116811461196257600080fd5b919050565b60006020828403121561197957600080fd5b610df38261194b565b6001600160e01b031981168114610a1757600080fd5b6000602082840312156119aa57600080fd5b8135610df381611982565b60005b838110156119d05781810151838201526020016119b8565b50506000910152565b600081518084526119f18160208601602086016119b5565b601f01601f19169290920160200192915050565b602081526000610df360208301846119d9565b600060208284031215611a2a57600080fd5b5035919050565b60008060408385031215611a4457600080fd5b611a4d8361194b565b946020939093013593505050565b8035801515811461196257600080fd5b600060208284031215611a7d57600080fd5b610df382611a5b565b600080600060608486031215611a9b57600080fd5b611aa48461194b565b9250611ab26020850161194b565b9150604084013590509250925092565b803560ff8116811461196257600080fd5b60008060008060008060a08789031215611aec57600080fd5b611af587611ac2565b9550611b0360208801611ac2565b9450611b1160408801611ac2565b9350611b1f60608801611ac2565b925060808701356001600160401b0380821115611b3b57600080fd5b818901915089601f830112611b4f57600080fd5b813581811115611b5e57600080fd5b8a60208260051b8501011115611b7357600080fd5b6020830194508093505050509295509295509295565b80356001600160401b038116811461196257600080fd5b600080600060608486031215611bb557600080fd5b83359250611bc560208501611b89565b9150611bd360408501611b89565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115611c0c57611c0c611bdc565b604051601f8501601f19908116603f01168101908282118183101715611c3457611c34611bdc565b81604052809350858152868686011115611c4d57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611c7957600080fd5b81356001600160401b03811115611c8f57600080fd5b8201601f81018413611ca057600080fd5b6118c584823560208401611bf2565b600060208284031215611cc157600080fd5b610df382611ac2565b60008060408385031215611cdd57600080fd5b611ce68361194b565b9150611cf460208401611a5b565b90509250929050565b60008060408385031215611d1057600080fd5b50508035926020909101359150565b60008060008060808587031215611d3557600080fd5b611d3e8561194b565b9350611d4c6020860161194b565b92506040850135915060608501356001600160401b03811115611d6e57600080fd5b8501601f81018713611d7f57600080fd5b611d8e87823560208401611bf2565b91505092959194509250565b60008060408385031215611dad57600080fd5b611db68361194b565b9150611cf46020840161194b565b600181811c90821680611dd857607f821691505b602082108103611df857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156107ea576107ea611dfe565b60ff81811683821601908111156107ea576107ea611dfe565b601f821115610dd457600081815260208120601f850160051c81016020861015611e675750805b601f850160051c820191505b81811015610bd157828155600101611e73565b81516001600160401b03811115611e9f57611e9f611bdc565b611eb381611ead8454611dc4565b84611e40565b602080601f831160018114611ee85760008415611ed05750858301515b600019600386901b1c1916600185901b178555610bd1565b600085815260208120601f198616915b82811015611f1757888601518255948401946001909101908401611ef8565b5085821015611f355787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176107ea576107ea611dfe565b60008154611f6981611dc4565b60018281168015611f815760018114611f9657611fc5565b60ff1984168752821515830287019450611fc5565b8560005260208060002060005b85811015611fbc5781548a820152908401908201611fa3565b50505082870194505b5050505092915050565b6000611fdb8286611f5c565b8451611feb8183602089016119b5565b611ff781830186611f5c565b979650505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612035908301846119d9565b9695505050505050565b60006020828403121561205157600080fd5b8151610df38161198256fea2646970667358221220bca9b3a18480cb99f50cbea490bbd3f3776826c548a55d4284ca4cf620e5c31664736f6c63430008140033

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

000000000000000000000000e2ab52af4b18e494f03ed8519b5e448a48e92fd000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000006596c7f0000000000000000000000000000000000000000000000000000000006596d600000000000000000000000000000000000000000000000000000000006596e410f52d7b0b281bc48b2909bed0c02a3a4a345533dadc17557f2e190d32040fff7e8dea5bb28cd7463075dba0b8402fe6016839394f591cd880d940d51412007a4b000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f6170692e7368697368693532302e696f2f6170692f76312f7368697368692f00000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _owner (address): 0xe2ab52Af4b18E494F03Ed8519B5E448a48e92Fd0
Arg [1] : _initialBaseURI (string): https://api.shishi520.io/api/v1/shishi/
Arg [2] : _phasetimes (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [3] : _roots (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000e2ab52af4b18e494f03ed8519b5e448a48e92fd0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000000000000000000000000000000000006596c7f0
Arg [3] : 000000000000000000000000000000000000000000000000000000006596d600
Arg [4] : 000000000000000000000000000000000000000000000000000000006596e410
Arg [5] : f52d7b0b281bc48b2909bed0c02a3a4a345533dadc17557f2e190d32040fff7e
Arg [6] : 8dea5bb28cd7463075dba0b8402fe6016839394f591cd880d940d51412007a4b
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000027
Arg [8] : 68747470733a2f2f6170692e7368697368693532302e696f2f6170692f76312f
Arg [9] : 7368697368692f00000000000000000000000000000000000000000000000000


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.