ETH Price: $2,047.67 (+1.18%)

Transaction Decoder

Block:
15020078 at Jun-24-2022 08:24:23 PM +UTC
Transaction Fee:
0.003480060455155225 ETH $7.13
Gas Used:
77,633 Gas / 44.827076825 Gwei

Account State Difference:

  Address   Before After State Difference Code
0x67ddb218...20bb1603f
0.106447391773570709 Eth
Nonce: 2092
0.102967331318415484 Eth
Nonce: 2093
0.003480060455155225
(F2Pool Old)
4,397.12775578150045608 Eth4,397.127834153941505837 Eth0.000078372441049757
0xB6e438f9...ED77f4398

Execution Trace

BoredApePurged.FREEmint( _quantity=5 )
{"boredapepurged.sol":{"content":"//Bored Ape Purged\r\n//All links to racism and or other forms of hate have been removed from the collection.\r\n\r\n\r\n// SPDX-License-Identifier: None\r\n\r\npragma solidity ^0.8.4;\r\n\r\nimport \"./ERC721A.sol\";\r\nimport \"./Ownable.sol\";\r\nimport \"./ERC721AQueryable.sol\";\r\nimport \"./Context.sol\";\r\n\r\ncontract BoredApePurged is ERC721A, ERC721AQueryable, Ownable {\r\n  uint256 public EXTRA_MINT_PRICE = 0 ether;\r\n  uint256 public MAX_SUPPLY_PLUS_ONE  = 8387;\r\n  uint256 public MAX_FREE_SUPPLY = 0;\r\n  uint256 public constant MAX_PER_TRANSACTION_PLUS_ONE = 6;\r\n\r\n\r\n  string tokenBaseUri = \"ipfs:QmXmBUkDF1tHF8mfbWKS6DxMyW25aLmERAo2pRyZ96pLoM/\";\r\n\r\n  bool public paused = true;\r\n\r\n  address public immutable proxyRegistryAddress;\r\n\r\n  mapping(address =\u003e uint256) private _freeMintedCount;\r\n\r\n  constructor(address _proxyRegistryAddress) ERC721A(\"BoredApepurged\", \"PURGE\") {\r\n    proxyRegistryAddress = _proxyRegistryAddress;\r\n  }\r\n\r\n  function FREEmint(uint256 _quantity) external payable {\r\n    require(!paused, \"Minting is Paused\");\r\n\r\n    uint256 _totalSupply = totalSupply();\r\n\r\n    require(_totalSupply + _quantity \u003c MAX_SUPPLY_PLUS_ONE, \"Exceeds Supply\");\r\n    require(_quantity \u003c MAX_PER_TRANSACTION_PLUS_ONE, \"Exceed Max Supply\");\r\n\r\n    // Free Mints\r\n    uint256 payForCount = _quantity;\r\n    uint256 freeMintCount = _freeMintedCount[msg.sender];\r\n\r\n    if (freeMintCount \u003c MAX_FREE_SUPPLY) {\r\n      if (_quantity \u003e MAX_FREE_SUPPLY) {\r\n        payForCount = _quantity - MAX_FREE_SUPPLY;\r\n      } else {\r\n        payForCount = 0;\r\n      }\r\n\r\n      _freeMintedCount[msg.sender] = MAX_FREE_SUPPLY;\r\n    }\r\n\r\n\r\n\r\n    require(msg.value \u003e= payForCount * EXTRA_MINT_PRICE, \"Ether amount sent wrong\");\r\n\r\n    _mint(msg.sender, _quantity);\r\n  }\r\n\r\n  function freeMintedCount(address owner) external view returns (uint256) {\r\n    return _freeMintedCount[owner];\r\n  }\r\n\r\n  function _startTokenId() internal pure override returns (uint256) {\r\n    return 0;\r\n  }\r\n\r\n  function _baseURI() internal view override returns (string memory) {\r\n    return tokenBaseUri;\r\n  }\r\n\r\n  function configMaxFreePrice(uint256 newPrice) public onlyOwner {\r\n        MAX_FREE_SUPPLY = newPrice;\r\n    }\r\n\r\n\r\n function configActualPrice(uint256 newnewPrice) public onlyOwner {\r\n        EXTRA_MINT_PRICE = newnewPrice;\r\n    }\r\n\r\n    function configtotalsupply(uint256 newsupply) public onlyOwner {\r\n        MAX_SUPPLY_PLUS_ONE = newsupply;\r\n    }\r\n    \r\n  function isApprovedForAll(address owner, address operator)\r\n    public\r\n    view\r\n   override(ERC721A, IERC721A)\r\n    returns (bool)\r\n  {\r\n    OpenSeaProxyRegistry proxyRegistry = OpenSeaProxyRegistry(\r\n      proxyRegistryAddress\r\n    );\r\n\r\n    if (address(proxyRegistry.proxies(owner)) == operator) {\r\n      return true;\r\n    }\r\n\r\n    return super.isApprovedForAll(owner, operator);\r\n  }\r\n\r\n  function setBaseURI(string calldata _newBaseUri) external onlyOwner {\r\n    tokenBaseUri = _newBaseUri;\r\n  }\r\n\r\n  function flipSale() external onlyOwner {\r\n    paused = !paused;\r\n  }\r\n\r\nfunction collectReserves(address[] calldata addresses, uint256 quantity)\r\n    external\r\n    onlyOwner\r\n  {\r\n    uint256 _totalSupply = totalSupply();\r\n\r\n    require(\r\n      _totalSupply + quantity * addresses.length \u003c= MAX_SUPPLY_PLUS_ONE,\r\n      \"Exceeds max supply\"\r\n    );\r\n\r\n    for (uint256 i = 0; i \u003c addresses.length; i++) {\r\n      _mint(addresses[i], quantity);\r\n    }\r\n  }\r\n\r\n  function withdraw() external onlyOwner {\r\n    require(\r\n      payable(owner()).send(address(this).balance),\r\n      \"Withdraw Unsuccessful\"\r\n    );\r\n  }\r\n}\r\n\r\n\r\ncontract OwnableDelegateProxy {}\r\n\r\ncontract OpenSeaProxyRegistry {\r\n  mapping(address =\u003e OwnableDelegateProxy) public proxies;\r\n}"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\r\n\r\npragma solidity ^0.8.0;\r\n\r\n/**\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n    function _msgSender() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n\r\n    function _msgData() internal view virtual returns (bytes calldata) {\r\n        return msg.data;\r\n    }\r\n}"},"ERC721A.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// ERC721A Contracts v4.0.0\r\n// Creator: Chiru Labs\r\n\r\npragma solidity ^0.8.4;\r\n\r\nimport \u0027./IERC721A.sol\u0027;\r\n\r\n/**\r\n * @dev ERC721 token receiver interface.\r\n */\r\ninterface ERC721A__IERC721Receiver {\r\n    function onERC721Received(\r\n        address operator,\r\n        address from,\r\n        uint256 tokenId,\r\n        bytes calldata data\r\n    ) external returns (bytes4);\r\n}\r\n\r\n/**\r\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\r\n * the Metadata extension. Built to optimize for lower gas during batch mints.\r\n *\r\n * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).\r\n *\r\n * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\r\n *\r\n * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).\r\n */\r\ncontract ERC721A is IERC721A {\r\n    // Mask of an entry in packed address data.\r\n    uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 \u003c\u003c 64) - 1;\r\n\r\n    // The bit position of `numberMinted` in packed address data.\r\n    uint256 private constant BITPOS_NUMBER_MINTED = 64;\r\n\r\n    // The bit position of `numberBurned` in packed address data.\r\n    uint256 private constant BITPOS_NUMBER_BURNED = 128;\r\n\r\n    // The bit position of `aux` in packed address data.\r\n    uint256 private constant BITPOS_AUX = 192;\r\n\r\n    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\r\n    uint256 private constant BITMASK_AUX_COMPLEMENT = (1 \u003c\u003c 192) - 1;\r\n\r\n    // The bit position of `startTimestamp` in packed ownership.\r\n    uint256 private constant BITPOS_START_TIMESTAMP = 160;\r\n\r\n    // The bit mask of the `burned` bit in packed ownership.\r\n    uint256 private constant BITMASK_BURNED = 1 \u003c\u003c 224;\r\n    \r\n    // The bit position of the `nextInitialized` bit in packed ownership.\r\n    uint256 private constant BITPOS_NEXT_INITIALIZED = 225;\r\n\r\n    // The bit mask of the `nextInitialized` bit in packed ownership.\r\n    uint256 private constant BITMASK_NEXT_INITIALIZED = 1 \u003c\u003c 225;\r\n\r\n    // The tokenId of the next token to be minted.\r\n    uint256 private _currentIndex;\r\n\r\n    // The number of tokens burned.\r\n    uint256 private _burnCounter;\r\n\r\n    // Token name\r\n    string private _name;\r\n\r\n    // Token symbol\r\n    string private _symbol;\r\n\r\n    // Mapping from token ID to ownership details\r\n    // An empty struct value does not necessarily mean the token is unowned.\r\n    // See `_packedOwnershipOf` implementation for details.\r\n    //\r\n    // Bits Layout:\r\n    // - [0..159]   `addr`\r\n    // - [160..223] `startTimestamp`\r\n    // - [224]      `burned`\r\n    // - [225]      `nextInitialized`\r\n    mapping(uint256 =\u003e uint256) private _packedOwnerships;\r\n\r\n    // Mapping owner address to address data.\r\n    //\r\n    // Bits Layout:\r\n    // - [0..63]    `balance`\r\n    // - [64..127]  `numberMinted`\r\n    // - [128..191] `numberBurned`\r\n    // - [192..255] `aux`\r\n    mapping(address =\u003e uint256) private _packedAddressData;\r\n\r\n    // Mapping from token ID to approved address.\r\n    mapping(uint256 =\u003e address) private _tokenApprovals;\r\n\r\n    // Mapping from owner to operator approvals\r\n    mapping(address =\u003e mapping(address =\u003e bool)) private _operatorApprovals;\r\n\r\n    constructor(string memory name_, string memory symbol_) {\r\n        _name = name_;\r\n        _symbol = symbol_;\r\n        _currentIndex = _startTokenId();\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the starting token ID. \r\n     * To change the starting token ID, please override this function.\r\n     */\r\n    function _startTokenId() internal view virtual returns (uint256) {\r\n        return 0;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the next token ID to be minted.\r\n     */\r\n    function _nextTokenId() internal view returns (uint256) {\r\n        return _currentIndex;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the total number of tokens in existence.\r\n     * Burned tokens will reduce the count. \r\n     * To get the total number of tokens minted, please see `_totalMinted`.\r\n     */\r\n    function totalSupply() public view override returns (uint256) {\r\n        // Counter underflow is impossible as _burnCounter cannot be incremented\r\n        // more than `_currentIndex - _startTokenId()` times.\r\n        unchecked {\r\n            return _currentIndex - _burnCounter - _startTokenId();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the total amount of tokens minted in the contract.\r\n     */\r\n    function _totalMinted() internal view returns (uint256) {\r\n        // Counter underflow is impossible as _currentIndex does not decrement,\r\n        // and it is initialized to `_startTokenId()`\r\n        unchecked {\r\n            return _currentIndex - _startTokenId();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the total number of tokens burned.\r\n     */\r\n    function _totalBurned() internal view returns (uint256) {\r\n        return _burnCounter;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC165-supportsInterface}.\r\n     */\r\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\r\n        // The interface IDs are constants representing the first 4 bytes of the XOR of\r\n        // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165\r\n        // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`\r\n        return\r\n            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\r\n            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\r\n            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-balanceOf}.\r\n     */\r\n    function balanceOf(address owner) public view override returns (uint256) {\r\n        if (owner == address(0)) revert BalanceQueryForZeroAddress();\r\n        return _packedAddressData[owner] \u0026 BITMASK_ADDRESS_DATA_ENTRY;\r\n    }\r\n\r\n    /**\r\n     * Returns the number of tokens minted by `owner`.\r\n     */\r\n    function _numberMinted(address owner) internal view returns (uint256) {\r\n        return (_packedAddressData[owner] \u003e\u003e BITPOS_NUMBER_MINTED) \u0026 BITMASK_ADDRESS_DATA_ENTRY;\r\n    }\r\n\r\n    /**\r\n     * Returns the number of tokens burned by or on behalf of `owner`.\r\n     */\r\n    function _numberBurned(address owner) internal view returns (uint256) {\r\n        return (_packedAddressData[owner] \u003e\u003e BITPOS_NUMBER_BURNED) \u0026 BITMASK_ADDRESS_DATA_ENTRY;\r\n    }\r\n\r\n    /**\r\n     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).\r\n     */\r\n    function _getAux(address owner) internal view returns (uint64) {\r\n        return uint64(_packedAddressData[owner] \u003e\u003e BITPOS_AUX);\r\n    }\r\n\r\n    /**\r\n     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).\r\n     * If there are multiple variables, please pack them into a uint64.\r\n     */\r\n    function _setAux(address owner, uint64 aux) internal {\r\n        uint256 packed = _packedAddressData[owner];\r\n        uint256 auxCasted;\r\n        assembly { // Cast aux without masking.\r\n            auxCasted := aux\r\n        }\r\n        packed = (packed \u0026 BITMASK_AUX_COMPLEMENT) | (auxCasted \u003c\u003c BITPOS_AUX);\r\n        _packedAddressData[owner] = packed;\r\n    }\r\n\r\n    /**\r\n     * Returns the packed ownership data of `tokenId`.\r\n     */\r\n    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {\r\n        uint256 curr = tokenId;\r\n\r\n        unchecked {\r\n            if (_startTokenId() \u003c= curr)\r\n                if (curr \u003c _currentIndex) {\r\n                    uint256 packed = _packedOwnerships[curr];\r\n                    // If not burned.\r\n                    if (packed \u0026 BITMASK_BURNED == 0) {\r\n                        // Invariant:\r\n                        // There will always be an ownership that has an address and is not burned\r\n                        // before an ownership that does not have an address and is not burned.\r\n                        // Hence, curr will not underflow.\r\n                        //\r\n                        // We can directly compare the packed value.\r\n                        // If the address is zero, packed is zero.\r\n                        while (packed == 0) {\r\n                            packed = _packedOwnerships[--curr];\r\n                        }\r\n                        return packed;\r\n                    }\r\n                }\r\n        }\r\n        revert OwnerQueryForNonexistentToken();\r\n    }\r\n\r\n    /**\r\n     * Returns the unpacked `TokenOwnership` struct from `packed`.\r\n     */\r\n    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {\r\n        ownership.addr = address(uint160(packed));\r\n        ownership.startTimestamp = uint64(packed \u003e\u003e BITPOS_START_TIMESTAMP);\r\n        ownership.burned = packed \u0026 BITMASK_BURNED != 0;\r\n    }\r\n\r\n    /**\r\n     * Returns the unpacked `TokenOwnership` struct at `index`.\r\n     */\r\n    function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {\r\n        return _unpackedOwnership(_packedOwnerships[index]);\r\n    }\r\n\r\n    /**\r\n     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\r\n     */\r\n    function _initializeOwnershipAt(uint256 index) internal {\r\n        if (_packedOwnerships[index] == 0) {\r\n            _packedOwnerships[index] = _packedOwnershipOf(index);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gas spent here starts off proportional to the maximum mint batch size.\r\n     * It gradually moves to O(1) as tokens get transferred around in the collection over time.\r\n     */\r\n    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {\r\n        return _unpackedOwnership(_packedOwnershipOf(tokenId));\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-ownerOf}.\r\n     */\r\n    function ownerOf(uint256 tokenId) public view override returns (address) {\r\n        return address(uint160(_packedOwnershipOf(tokenId)));\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721Metadata-name}.\r\n     */\r\n    function name() public view virtual override returns (string memory) {\r\n        return _name;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721Metadata-symbol}.\r\n     */\r\n    function symbol() public view virtual override returns (string memory) {\r\n        return _symbol;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721Metadata-tokenURI}.\r\n     */\r\n    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\r\n        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\r\n\r\n        string memory baseURI = _baseURI();\r\n        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : \u0027\u0027;\r\n    }\r\n\r\n    /**\r\n     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\r\n     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\r\n     * by default, can be overriden in child contracts.\r\n     */\r\n    function _baseURI() internal view virtual returns (string memory) {\r\n        return \u0027\u0027;\r\n    }\r\n\r\n    /**\r\n     * @dev Casts the address to uint256 without masking.\r\n     */\r\n    function _addressToUint256(address value) private pure returns (uint256 result) {\r\n        assembly {\r\n            result := value\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Casts the boolean to uint256 without branching.\r\n     */\r\n    function _boolToUint256(bool value) private pure returns (uint256 result) {\r\n        assembly {\r\n            result := value\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-approve}.\r\n     */\r\n    function approve(address to, uint256 tokenId) public override {\r\n        address owner = address(uint160(_packedOwnershipOf(tokenId)));\r\n        if (to == owner) revert ApprovalToCurrentOwner();\r\n\r\n        if (_msgSenderERC721A() != owner)\r\n            if (!isApprovedForAll(owner, _msgSenderERC721A())) {\r\n                revert ApprovalCallerNotOwnerNorApproved();\r\n            }\r\n\r\n        _tokenApprovals[tokenId] = to;\r\n        emit Approval(owner, to, tokenId);\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-getApproved}.\r\n     */\r\n    function getApproved(uint256 tokenId) public view override returns (address) {\r\n        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\r\n\r\n        return _tokenApprovals[tokenId];\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-setApprovalForAll}.\r\n     */\r\n    function setApprovalForAll(address operator, bool approved) public virtual override {\r\n        if (operator == _msgSenderERC721A()) revert ApproveToCaller();\r\n\r\n        _operatorApprovals[_msgSenderERC721A()][operator] = approved;\r\n        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-isApprovedForAll}.\r\n     */\r\n    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\r\n        return _operatorApprovals[owner][operator];\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-transferFrom}.\r\n     */\r\n    function transferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId\r\n    ) public virtual override {\r\n        _transfer(from, to, tokenId);\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-safeTransferFrom}.\r\n     */\r\n    function safeTransferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId\r\n    ) public virtual override {\r\n        safeTransferFrom(from, to, tokenId, \u0027\u0027);\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC721-safeTransferFrom}.\r\n     */\r\n    function safeTransferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId,\r\n        bytes memory _data\r\n    ) public virtual override {\r\n        _transfer(from, to, tokenId);\r\n        if (to.code.length != 0)\r\n            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\r\n                revert TransferToNonERC721ReceiverImplementer();\r\n            }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns whether `tokenId` exists.\r\n     *\r\n     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\r\n     *\r\n     * Tokens start existing when they are minted (`_mint`),\r\n     */\r\n    function _exists(uint256 tokenId) internal view returns (bool) {\r\n        return\r\n            _startTokenId() \u003c= tokenId \u0026\u0026\r\n            tokenId \u003c _currentIndex \u0026\u0026 // If within bounds,\r\n            _packedOwnerships[tokenId] \u0026 BITMASK_BURNED == 0; // and not burned.\r\n    }\r\n\r\n    /**\r\n     * @dev Equivalent to `_safeMint(to, quantity, \u0027\u0027)`.\r\n     */\r\n    function _safeMint(address to, uint256 quantity) internal {\r\n        _safeMint(to, quantity, \u0027\u0027);\r\n    }\r\n\r\n    /**\r\n     * @dev Safely mints `quantity` tokens and transfers them to `to`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - If `to` refers to a smart contract, it must implement\r\n     *   {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\r\n     * - `quantity` must be greater than 0.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function _safeMint(\r\n        address to,\r\n        uint256 quantity,\r\n        bytes memory _data\r\n    ) internal {\r\n        uint256 startTokenId = _currentIndex;\r\n        if (to == address(0)) revert MintToZeroAddress();\r\n        if (quantity == 0) revert MintZeroQuantity();\r\n\r\n        _beforeTokenTransfers(address(0), to, startTokenId, quantity);\r\n\r\n        // Overflows are incredibly unrealistic.\r\n        // balance or numberMinted overflow if current value of either + quantity \u003e 1.8e19 (2**64) - 1\r\n        // updatedIndex overflows if _currentIndex + quantity \u003e 1.2e77 (2**256) - 1\r\n        unchecked {\r\n            // Updates:\r\n            // - `balance += quantity`.\r\n            // - `numberMinted += quantity`.\r\n            //\r\n            // We can directly add to the balance and number minted.\r\n            _packedAddressData[to] += quantity * ((1 \u003c\u003c BITPOS_NUMBER_MINTED) | 1);\r\n\r\n            // Updates:\r\n            // - `address` to the owner.\r\n            // - `startTimestamp` to the timestamp of minting.\r\n            // - `burned` to `false`.\r\n            // - `nextInitialized` to `quantity == 1`.\r\n            _packedOwnerships[startTokenId] =\r\n                _addressToUint256(to) |\r\n                (block.timestamp \u003c\u003c BITPOS_START_TIMESTAMP) |\r\n                (_boolToUint256(quantity == 1) \u003c\u003c BITPOS_NEXT_INITIALIZED);\r\n\r\n            uint256 updatedIndex = startTokenId;\r\n            uint256 end = updatedIndex + quantity;\r\n\r\n            if (to.code.length != 0) {\r\n                do {\r\n                    emit Transfer(address(0), to, updatedIndex);\r\n                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {\r\n                        revert TransferToNonERC721ReceiverImplementer();\r\n                    }\r\n                } while (updatedIndex \u003c end);\r\n                // Reentrancy protection\r\n                if (_currentIndex != startTokenId) revert();\r\n            } else {\r\n                do {\r\n                    emit Transfer(address(0), to, updatedIndex++);\r\n                } while (updatedIndex \u003c end);\r\n            }\r\n            _currentIndex = updatedIndex;\r\n        }\r\n        _afterTokenTransfers(address(0), to, startTokenId, quantity);\r\n    }\r\n\r\n    /**\r\n     * @dev Mints `quantity` tokens and transfers them to `to`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `to` cannot be the zero address.\r\n     * - `quantity` must be greater than 0.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function _mint(address to, uint256 quantity) internal {\r\n        uint256 startTokenId = _currentIndex;\r\n        if (to == address(0)) revert MintToZeroAddress();\r\n        if (quantity == 0) revert MintZeroQuantity();\r\n\r\n        _beforeTokenTransfers(address(0), to, startTokenId, quantity);\r\n\r\n        // Overflows are incredibly unrealistic.\r\n        // balance or numberMinted overflow if current value of either + quantity \u003e 1.8e19 (2**64) - 1\r\n        // updatedIndex overflows if _currentIndex + quantity \u003e 1.2e77 (2**256) - 1\r\n        unchecked {\r\n            // Updates:\r\n            // - `balance += quantity`.\r\n            // - `numberMinted += quantity`.\r\n            //\r\n            // We can directly add to the balance and number minted.\r\n            _packedAddressData[to] += quantity * ((1 \u003c\u003c BITPOS_NUMBER_MINTED) | 1);\r\n\r\n            // Updates:\r\n            // - `address` to the owner.\r\n            // - `startTimestamp` to the timestamp of minting.\r\n            // - `burned` to `false`.\r\n            // - `nextInitialized` to `quantity == 1`.\r\n            _packedOwnerships[startTokenId] =\r\n                _addressToUint256(to) |\r\n                (block.timestamp \u003c\u003c BITPOS_START_TIMESTAMP) |\r\n                (_boolToUint256(quantity == 1) \u003c\u003c BITPOS_NEXT_INITIALIZED);\r\n\r\n            uint256 updatedIndex = startTokenId;\r\n            uint256 end = updatedIndex + quantity;\r\n\r\n            do {\r\n                emit Transfer(address(0), to, updatedIndex++);\r\n            } while (updatedIndex \u003c end);\r\n\r\n            _currentIndex = updatedIndex;\r\n        }\r\n        _afterTokenTransfers(address(0), to, startTokenId, quantity);\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers `tokenId` from `from` to `to`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `to` cannot be the zero address.\r\n     * - `tokenId` token must be owned by `from`.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function _transfer(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId\r\n    ) private {\r\n        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\r\n\r\n        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();\r\n\r\n        bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\r\n            isApprovedForAll(from, _msgSenderERC721A()) ||\r\n            getApproved(tokenId) == _msgSenderERC721A());\r\n\r\n        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\r\n        if (to == address(0)) revert TransferToZeroAddress();\r\n\r\n        _beforeTokenTransfers(from, to, tokenId, 1);\r\n\r\n        // Clear approvals from the previous owner.\r\n        delete _tokenApprovals[tokenId];\r\n\r\n        // Underflow of the sender\u0027s balance is impossible because we check for\r\n        // ownership above and the recipient\u0027s balance can\u0027t realistically overflow.\r\n        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.\r\n        unchecked {\r\n            // We can directly increment and decrement the balances.\r\n            --_packedAddressData[from]; // Updates: `balance -= 1`.\r\n            ++_packedAddressData[to]; // Updates: `balance += 1`.\r\n\r\n            // Updates:\r\n            // - `address` to the next owner.\r\n            // - `startTimestamp` to the timestamp of transfering.\r\n            // - `burned` to `false`.\r\n            // - `nextInitialized` to `true`.\r\n            _packedOwnerships[tokenId] =\r\n                _addressToUint256(to) |\r\n                (block.timestamp \u003c\u003c BITPOS_START_TIMESTAMP) |\r\n                BITMASK_NEXT_INITIALIZED;\r\n\r\n            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\r\n            if (prevOwnershipPacked \u0026 BITMASK_NEXT_INITIALIZED == 0) {\r\n                uint256 nextTokenId = tokenId + 1;\r\n                // If the next slot\u0027s address is zero and not burned (i.e. packed value is zero).\r\n                if (_packedOwnerships[nextTokenId] == 0) {\r\n                    // If the next slot is within bounds.\r\n                    if (nextTokenId != _currentIndex) {\r\n                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\r\n                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        emit Transfer(from, to, tokenId);\r\n        _afterTokenTransfers(from, to, tokenId, 1);\r\n    }\r\n\r\n    /**\r\n     * @dev Equivalent to `_burn(tokenId, false)`.\r\n     */\r\n    function _burn(uint256 tokenId) internal virtual {\r\n        _burn(tokenId, false);\r\n    }\r\n\r\n    /**\r\n     * @dev Destroys `tokenId`.\r\n     * The approval is cleared when the token is burned.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `tokenId` must exist.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\r\n        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\r\n\r\n        address from = address(uint160(prevOwnershipPacked));\r\n\r\n        if (approvalCheck) {\r\n            bool isApprovedOrOwner = (_msgSenderERC721A() == from ||\r\n                isApprovedForAll(from, _msgSenderERC721A()) ||\r\n                getApproved(tokenId) == _msgSenderERC721A());\r\n\r\n            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\r\n        }\r\n\r\n        _beforeTokenTransfers(from, address(0), tokenId, 1);\r\n\r\n        // Clear approvals from the previous owner.\r\n        delete _tokenApprovals[tokenId];\r\n\r\n        // Underflow of the sender\u0027s balance is impossible because we check for\r\n        // ownership above and the recipient\u0027s balance can\u0027t realistically overflow.\r\n        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.\r\n        unchecked {\r\n            // Updates:\r\n            // - `balance -= 1`.\r\n            // - `numberBurned += 1`.\r\n            //\r\n            // We can directly decrement the balance, and increment the number burned.\r\n            // This is equivalent to `packed -= 1; packed += 1 \u003c\u003c BITPOS_NUMBER_BURNED;`.\r\n            _packedAddressData[from] += (1 \u003c\u003c BITPOS_NUMBER_BURNED) - 1;\r\n\r\n            // Updates:\r\n            // - `address` to the last owner.\r\n            // - `startTimestamp` to the timestamp of burning.\r\n            // - `burned` to `true`.\r\n            // - `nextInitialized` to `true`.\r\n            _packedOwnerships[tokenId] =\r\n                _addressToUint256(from) |\r\n                (block.timestamp \u003c\u003c BITPOS_START_TIMESTAMP) |\r\n                BITMASK_BURNED | \r\n                BITMASK_NEXT_INITIALIZED;\r\n\r\n            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\r\n            if (prevOwnershipPacked \u0026 BITMASK_NEXT_INITIALIZED == 0) {\r\n                uint256 nextTokenId = tokenId + 1;\r\n                // If the next slot\u0027s address is zero and not burned (i.e. packed value is zero).\r\n                if (_packedOwnerships[nextTokenId] == 0) {\r\n                    // If the next slot is within bounds.\r\n                    if (nextTokenId != _currentIndex) {\r\n                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\r\n                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        emit Transfer(from, address(0), tokenId);\r\n        _afterTokenTransfers(from, address(0), tokenId, 1);\r\n\r\n        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.\r\n        unchecked {\r\n            _burnCounter++;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.\r\n     *\r\n     * @param from address representing the previous owner of the given token ID\r\n     * @param to target address that will receive the tokens\r\n     * @param tokenId uint256 ID of the token to be transferred\r\n     * @param _data bytes optional data to send along with the call\r\n     * @return bool whether the call correctly returned the expected magic value\r\n     */\r\n    function _checkContractOnERC721Received(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId,\r\n        bytes memory _data\r\n    ) private returns (bool) {\r\n        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (\r\n            bytes4 retval\r\n        ) {\r\n            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;\r\n        } catch (bytes memory reason) {\r\n            if (reason.length == 0) {\r\n                revert TransferToNonERC721ReceiverImplementer();\r\n            } else {\r\n                assembly {\r\n                    revert(add(32, reason), mload(reason))\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.\r\n     * And also called before burning one token.\r\n     *\r\n     * startTokenId - the first token id to be transferred\r\n     * quantity - the amount to be transferred\r\n     *\r\n     * Calling conditions:\r\n     *\r\n     * - When `from` and `to` are both non-zero, `from`\u0027s `tokenId` will be\r\n     * transferred to `to`.\r\n     * - When `from` is zero, `tokenId` will be minted for `to`.\r\n     * - When `to` is zero, `tokenId` will be burned by `from`.\r\n     * - `from` and `to` are never both zero.\r\n     */\r\n    function _beforeTokenTransfers(\r\n        address from,\r\n        address to,\r\n        uint256 startTokenId,\r\n        uint256 quantity\r\n    ) internal virtual {}\r\n\r\n    /**\r\n     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes\r\n     * minting.\r\n     * And also called after one token has been burned.\r\n     *\r\n     * startTokenId - the first token id to be transferred\r\n     * quantity - the amount to be transferred\r\n     *\r\n     * Calling conditions:\r\n     *\r\n     * - When `from` and `to` are both non-zero, `from`\u0027s `tokenId` has been\r\n     * transferred to `to`.\r\n     * - When `from` is zero, `tokenId` has been minted for `to`.\r\n     * - When `to` is zero, `tokenId` has been burned by `from`.\r\n     * - `from` and `to` are never both zero.\r\n     */\r\n    function _afterTokenTransfers(\r\n        address from,\r\n        address to,\r\n        uint256 startTokenId,\r\n        uint256 quantity\r\n    ) internal virtual {}\r\n\r\n    /**\r\n     * @dev Returns the message sender (defaults to `msg.sender`).\r\n     *\r\n     * If you are writing GSN compatible contracts, you need to override this function.\r\n     */\r\n    function _msgSenderERC721A() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n\r\n    /**\r\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\r\n     */\r\n    function _toString(uint256 value) internal pure returns (string memory ptr) {\r\n        assembly {\r\n            // The maximum value of a uint256 contains 78 digits (1 byte per digit), \r\n            // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.\r\n            // We will need 1 32-byte word to store the length, \r\n            // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.\r\n            ptr := add(mload(0x40), 128)\r\n            // Update the free memory pointer to allocate.\r\n            mstore(0x40, ptr)\r\n\r\n            // Cache the end of the memory to calculate the length later.\r\n            let end := ptr\r\n\r\n            // We write the string from the rightmost digit to the leftmost digit.\r\n            // The following is essentially a do-while loop that also handles the zero case.\r\n            // Costs a bit more than early returning for the zero case,\r\n            // but cheaper in terms of deployment and overall runtime costs.\r\n            for { \r\n                // Initialize and perform the first pass without check.\r\n                let temp := value\r\n                // Move the pointer 1 byte leftwards to point to an empty character slot.\r\n                ptr := sub(ptr, 1)\r\n                // Write the character to the pointer. 48 is the ASCII index of \u00270\u0027.\r\n                mstore8(ptr, add(48, mod(temp, 10)))\r\n                temp := div(temp, 10)\r\n            } temp { \r\n                // Keep dividing `temp` until zero.\r\n                temp := div(temp, 10)\r\n            } { // Body of the for loop.\r\n                ptr := sub(ptr, 1)\r\n                mstore8(ptr, add(48, mod(temp, 10)))\r\n            }\r\n            \r\n            let length := sub(end, ptr)\r\n            // Move the pointer 32 bytes leftwards to make room for the length.\r\n            ptr := sub(ptr, 32)\r\n            // Store the length.\r\n            mstore(ptr, length)\r\n        }\r\n    }\r\n}"},"ERC721AQueryable.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// ERC721A Contracts v4.0.0\r\n// Creator: Chiru Labs\r\n\r\npragma solidity ^0.8.4;\r\n\r\nimport \u0027./IERC721AQueryable.sol\u0027;\r\nimport \u0027./ERC721A.sol\u0027;\r\n\r\n/**\r\n * @title ERC721A Queryable\r\n * @dev ERC721A subclass with convenience query functions.\r\n */\r\nabstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {\r\n    /**\r\n     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\r\n     *\r\n     * If the `tokenId` is out of bounds:\r\n     *   - `addr` = `address(0)`\r\n     *   - `startTimestamp` = `0`\r\n     *   - `burned` = `false`\r\n     *\r\n     * If the `tokenId` is burned:\r\n     *   - `addr` = `\u003cAddress of owner before token was burned\u003e`\r\n     *   - `startTimestamp` = `\u003cTimestamp when token was burned\u003e`\r\n     *   - `burned = `true`\r\n     *\r\n     * Otherwise:\r\n     *   - `addr` = `\u003cAddress of owner\u003e`\r\n     *   - `startTimestamp` = `\u003cTimestamp of start of ownership\u003e`\r\n     *   - `burned = `false`\r\n     */\r\n    function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) {\r\n        TokenOwnership memory ownership;\r\n        if (tokenId \u003c _startTokenId() || tokenId \u003e= _nextTokenId()) {\r\n            return ownership;\r\n        }\r\n        ownership = _ownershipAt(tokenId);\r\n        if (ownership.burned) {\r\n            return ownership;\r\n        }\r\n        return _ownershipOf(tokenId);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\r\n     * See {ERC721AQueryable-explicitOwnershipOf}\r\n     */\r\n    function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) {\r\n        unchecked {\r\n            uint256 tokenIdsLength = tokenIds.length;\r\n            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);\r\n            for (uint256 i; i != tokenIdsLength; ++i) {\r\n                ownerships[i] = explicitOwnershipOf(tokenIds[i]);\r\n            }\r\n            return ownerships;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns an array of token IDs owned by `owner`,\r\n     * in the range [`start`, `stop`)\r\n     * (i.e. `start \u003c= tokenId \u003c stop`).\r\n     *\r\n     * This function allows for tokens to be queried if the collection\r\n     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `start` \u003c `stop`\r\n     */\r\n    function tokensOfOwnerIn(\r\n        address owner,\r\n        uint256 start,\r\n        uint256 stop\r\n    ) external view override returns (uint256[] memory) {\r\n        unchecked {\r\n            if (start \u003e= stop) revert InvalidQueryRange();\r\n            uint256 tokenIdsIdx;\r\n            uint256 stopLimit = _nextTokenId();\r\n            // Set `start = max(start, _startTokenId())`.\r\n            if (start \u003c _startTokenId()) {\r\n                start = _startTokenId();\r\n            }\r\n            // Set `stop = min(stop, stopLimit)`.\r\n            if (stop \u003e stopLimit) {\r\n                stop = stopLimit;\r\n            }\r\n            uint256 tokenIdsMaxLength = balanceOf(owner);\r\n            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,\r\n            // to cater for cases where `balanceOf(owner)` is too big.\r\n            if (start \u003c stop) {\r\n                uint256 rangeLength = stop - start;\r\n                if (rangeLength \u003c tokenIdsMaxLength) {\r\n                    tokenIdsMaxLength = rangeLength;\r\n                }\r\n            } else {\r\n                tokenIdsMaxLength = 0;\r\n            }\r\n            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);\r\n            if (tokenIdsMaxLength == 0) {\r\n                return tokenIds;\r\n            }\r\n            // We need to call `explicitOwnershipOf(start)`,\r\n            // because the slot at `start` may not be initialized.\r\n            TokenOwnership memory ownership = explicitOwnershipOf(start);\r\n            address currOwnershipAddr;\r\n            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.\r\n            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.\r\n            if (!ownership.burned) {\r\n                currOwnershipAddr = ownership.addr;\r\n            }\r\n            for (uint256 i = start; i != stop \u0026\u0026 tokenIdsIdx != tokenIdsMaxLength; ++i) {\r\n                ownership = _ownershipAt(i);\r\n                if (ownership.burned) {\r\n                    continue;\r\n                }\r\n                if (ownership.addr != address(0)) {\r\n                    currOwnershipAddr = ownership.addr;\r\n                }\r\n                if (currOwnershipAddr == owner) {\r\n                    tokenIds[tokenIdsIdx++] = i;\r\n                }\r\n            }\r\n            // Downsize the array to fit.\r\n            assembly {\r\n                mstore(tokenIds, tokenIdsIdx)\r\n            }\r\n            return tokenIds;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns an array of token IDs owned by `owner`.\r\n     *\r\n     * This function scans the ownership mapping and is O(totalSupply) in complexity.\r\n     * It is meant to be called off-chain.\r\n     *\r\n     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\r\n     * multiple smaller scans if the collection is large enough to cause\r\n     * an out-of-gas error (10K pfp collections should be fine).\r\n     */\r\n    function tokensOfOwner(address owner) external view override returns (uint256[] memory) {\r\n        unchecked {\r\n            uint256 tokenIdsIdx;\r\n            address currOwnershipAddr;\r\n            uint256 tokenIdsLength = balanceOf(owner);\r\n            uint256[] memory tokenIds = new uint256[](tokenIdsLength);\r\n            TokenOwnership memory ownership;\r\n            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {\r\n                ownership = _ownershipAt(i);\r\n                if (ownership.burned) {\r\n                    continue;\r\n                }\r\n                if (ownership.addr != address(0)) {\r\n                    currOwnershipAddr = ownership.addr;\r\n                }\r\n                if (currOwnershipAddr == owner) {\r\n                    tokenIds[tokenIdsIdx++] = i;\r\n                }\r\n            }\r\n            return tokenIds;\r\n        }\r\n    }\r\n}"},"IERC721A.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// ERC721A Contracts v4.0.0\r\n// Creator: Chiru Labs\r\n\r\npragma solidity ^0.8.4;\r\n\r\n/**\r\n * @dev Interface of an ERC721A compliant contract.\r\n */\r\ninterface IERC721A {\r\n    /**\r\n     * The caller must own the token or be an approved operator.\r\n     */\r\n    error ApprovalCallerNotOwnerNorApproved();\r\n\r\n    /**\r\n     * The token does not exist.\r\n     */\r\n    error ApprovalQueryForNonexistentToken();\r\n\r\n    /**\r\n     * The caller cannot approve to their own address.\r\n     */\r\n    error ApproveToCaller();\r\n\r\n    /**\r\n     * The caller cannot approve to the current owner.\r\n     */\r\n    error ApprovalToCurrentOwner();\r\n\r\n    /**\r\n     * Cannot query the balance for the zero address.\r\n     */\r\n    error BalanceQueryForZeroAddress();\r\n\r\n    /**\r\n     * Cannot mint to the zero address.\r\n     */\r\n    error MintToZeroAddress();\r\n\r\n    /**\r\n     * The quantity of tokens minted must be more than zero.\r\n     */\r\n    error MintZeroQuantity();\r\n\r\n    /**\r\n     * The token does not exist.\r\n     */\r\n    error OwnerQueryForNonexistentToken();\r\n\r\n    /**\r\n     * The caller must own the token or be an approved operator.\r\n     */\r\n    error TransferCallerNotOwnerNorApproved();\r\n\r\n    /**\r\n     * The token must be owned by `from`.\r\n     */\r\n    error TransferFromIncorrectOwner();\r\n\r\n    /**\r\n     * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.\r\n     */\r\n    error TransferToNonERC721ReceiverImplementer();\r\n\r\n    /**\r\n     * Cannot transfer to the zero address.\r\n     */\r\n    error TransferToZeroAddress();\r\n\r\n    /**\r\n     * The token does not exist.\r\n     */\r\n    error URIQueryForNonexistentToken();\r\n\r\n    struct TokenOwnership {\r\n        // The address of the owner.\r\n        address addr;\r\n        // Keeps track of the start time of ownership with minimal overhead for tokenomics.\r\n        uint64 startTimestamp;\r\n        // Whether the token has been burned.\r\n        bool burned;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the total amount of tokens stored by the contract.\r\n     *\r\n     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.\r\n     */\r\n    function totalSupply() external view returns (uint256);\r\n\r\n    // ==============================\r\n    //            IERC165\r\n    // ==============================\r\n\r\n    /**\r\n     * @dev Returns true if this contract implements the interface defined by\r\n     * `interfaceId`. See the corresponding\r\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\r\n     * to learn more about how these ids are created.\r\n     *\r\n     * This function call must use less than 30 000 gas.\r\n     */\r\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\r\n\r\n    // ==============================\r\n    //            IERC721\r\n    // ==============================\r\n\r\n    /**\r\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\r\n     */\r\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\r\n\r\n    /**\r\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\r\n     */\r\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\r\n\r\n    /**\r\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\r\n     */\r\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\r\n\r\n    /**\r\n     * @dev Returns the number of tokens in ``owner``\u0027s account.\r\n     */\r\n    function balanceOf(address owner) external view returns (uint256 balance);\r\n\r\n    /**\r\n     * @dev Returns the owner of the `tokenId` token.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `tokenId` must exist.\r\n     */\r\n    function ownerOf(uint256 tokenId) external view returns (address owner);\r\n\r\n    /**\r\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `from` cannot be the zero address.\r\n     * - `to` cannot be the zero address.\r\n     * - `tokenId` token must exist and be owned by `from`.\r\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\r\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function safeTransferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId,\r\n        bytes calldata data\r\n    ) external;\r\n\r\n    /**\r\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\r\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `from` cannot be the zero address.\r\n     * - `to` cannot be the zero address.\r\n     * - `tokenId` token must exist and be owned by `from`.\r\n     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\r\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function safeTransferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId\r\n    ) external;\r\n\r\n    /**\r\n     * @dev Transfers `tokenId` token from `from` to `to`.\r\n     *\r\n     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `from` cannot be the zero address.\r\n     * - `to` cannot be the zero address.\r\n     * - `tokenId` token must be owned by `from`.\r\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 tokenId\r\n    ) external;\r\n\r\n    /**\r\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\r\n     * The approval is cleared when the token is transferred.\r\n     *\r\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The caller must own the token or be an approved operator.\r\n     * - `tokenId` must exist.\r\n     *\r\n     * Emits an {Approval} event.\r\n     */\r\n    function approve(address to, uint256 tokenId) external;\r\n\r\n    /**\r\n     * @dev Approve or remove `operator` as an operator for the caller.\r\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The `operator` cannot be the caller.\r\n     *\r\n     * Emits an {ApprovalForAll} event.\r\n     */\r\n    function setApprovalForAll(address operator, bool _approved) external;\r\n\r\n    /**\r\n     * @dev Returns the account approved for `tokenId` token.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `tokenId` must exist.\r\n     */\r\n    function getApproved(uint256 tokenId) external view returns (address operator);\r\n\r\n    /**\r\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\r\n     *\r\n     * See {setApprovalForAll}\r\n     */\r\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\r\n\r\n    // ==============================\r\n    //        IERC721Metadata\r\n    // ==============================\r\n\r\n    /**\r\n     * @dev Returns the token collection name.\r\n     */\r\n    function name() external view returns (string memory);\r\n\r\n    /**\r\n     * @dev Returns the token collection symbol.\r\n     */\r\n    function symbol() external view returns (string memory);\r\n\r\n    /**\r\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\r\n     */\r\n    function tokenURI(uint256 tokenId) external view returns (string memory);\r\n}"},"IERC721AQueryable.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// ERC721A Contracts v4.0.0\r\n// Creator: Chiru Labs\r\n\r\npragma solidity ^0.8.4;\r\n\r\nimport \u0027./IERC721A.sol\u0027;\r\n\r\n/**\r\n * @dev Interface of an ERC721AQueryable compliant contract.\r\n */\r\ninterface IERC721AQueryable is IERC721A {\r\n    /**\r\n     * Invalid query range (`start` \u003e= `stop`).\r\n     */\r\n    error InvalidQueryRange();\r\n\r\n    /**\r\n     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\r\n     *\r\n     * If the `tokenId` is out of bounds:\r\n     *   - `addr` = `address(0)`\r\n     *   - `startTimestamp` = `0`\r\n     *   - `burned` = `false`\r\n     *\r\n     * If the `tokenId` is burned:\r\n     *   - `addr` = `\u003cAddress of owner before token was burned\u003e`\r\n     *   - `startTimestamp` = `\u003cTimestamp when token was burned\u003e`\r\n     *   - `burned = `true`\r\n     *\r\n     * Otherwise:\r\n     *   - `addr` = `\u003cAddress of owner\u003e`\r\n     *   - `startTimestamp` = `\u003cTimestamp of start of ownership\u003e`\r\n     *   - `burned = `false`\r\n     */\r\n    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);\r\n\r\n    /**\r\n     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\r\n     * See {ERC721AQueryable-explicitOwnershipOf}\r\n     */\r\n    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);\r\n\r\n    /**\r\n     * @dev Returns an array of token IDs owned by `owner`,\r\n     * in the range [`start`, `stop`)\r\n     * (i.e. `start \u003c= tokenId \u003c stop`).\r\n     *\r\n     * This function allows for tokens to be queried if the collection\r\n     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `start` \u003c `stop`\r\n     */\r\n    function tokensOfOwnerIn(\r\n        address owner,\r\n        uint256 start,\r\n        uint256 stop\r\n    ) external view returns (uint256[] memory);\r\n\r\n    /**\r\n     * @dev Returns an array of token IDs owned by `owner`.\r\n     *\r\n     * This function scans the ownership mapping and is O(totalSupply) in complexity.\r\n     * It is meant to be called off-chain.\r\n     *\r\n     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\r\n     * multiple smaller scans if the collection is large enough to cause\r\n     * an out-of-gas error (10K pfp collections should be fine).\r\n     */\r\n    function tokensOfOwner(address owner) external view returns (uint256[] memory);\r\n}"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\r\n\r\npragma solidity ^0.8.0;\r\n\r\nimport \"./Context.sol\";\r\n\r\n/**\r\n * @dev Contract module which provides a basic access control mechanism, where\r\n * there is an account (an owner) that can be granted exclusive access to\r\n * specific functions.\r\n *\r\n * By default, the owner account will be the one that deploys the contract. This\r\n * can later be changed with {transferOwnership}.\r\n *\r\n * This module is used through inheritance. It will make available the modifier\r\n * `onlyOwner`, which can be applied to your functions to restrict their use to\r\n * the owner.\r\n */\r\nabstract contract Ownable is Context {\r\n    address private _owner;\r\n\r\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n    /**\r\n     * @dev Initializes the contract setting the deployer as the initial owner.\r\n     */\r\n    constructor() {\r\n        _transferOwnership(_msgSender());\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the address of the current owner.\r\n     */\r\n    function owner() public view virtual returns (address) {\r\n        return _owner;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than the owner.\r\n     */\r\n    modifier onlyOwner() {\r\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Leaves the contract without owner. It will not be possible to call\r\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\r\n     *\r\n     * NOTE: Renouncing ownership will leave the contract without an owner,\r\n     * thereby removing any functionality that is only available to the owner.\r\n     */\r\n    function renounceOwnership() public virtual onlyOwner {\r\n        _transferOwnership(address(0));\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n     * Can only be called by the current owner.\r\n     */\r\n    function transferOwnership(address newOwner) public virtual onlyOwner {\r\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n        _transferOwnership(newOwner);\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n     * Internal function without access restriction.\r\n     */\r\n    function _transferOwnership(address newOwner) internal virtual {\r\n        address oldOwner = _owner;\r\n        _owner = newOwner;\r\n        emit OwnershipTransferred(oldOwner, newOwner);\r\n    }\r\n}"}}