creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/clones/ERC1155SeaDropCloneFactory.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { ERC1155SeaDropCloneable } from \"./ERC1155SeaDropCloneable.sol\";\n\nimport { ERC1155SeaDropConfigurer } from \"../lib/ERC1155SeaDropConfigurer.sol\";\n\nimport { Clones } from \"@openzeppelin/contracts/proxy/Clones.sol\";\n\n/**\n * @title  ERC1155SeaDropCloneFactory\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A factory contract that deploys ERC1155 token contracts\n *         that can mint as Seaport contract offerers.\n */\ncontract ERC1155SeaDropCloneFactory {\n    address public immutable seaport;\n    address public immutable configurer;\n    address public immutable cloneableImplementation;\n\n    constructor(address allowedSeaport) {\n        seaport = allowedSeaport;\n\n        ERC1155SeaDropConfigurer config = new ERC1155SeaDropConfigurer();\n        configurer = address(config);\n\n        ERC1155SeaDropCloneable impl = new ERC1155SeaDropCloneable();\n        impl.initialize(configurer, seaport, \"\", \"\", address(this));\n        cloneableImplementation = address(impl);\n    }\n\n    function createClone(\n        string memory name,\n        string memory symbol,\n        bytes32 salt\n    ) external returns (address instance) {\n        // Derive a pseudo-random salt, so clone addresses don't collide\n        // across chains.\n        bytes32 cloneSalt = keccak256(\n            abi.encodePacked(salt, blockhash(block.number))\n        );\n\n        instance = Clones.cloneDeterministic(\n            cloneableImplementation,\n            cloneSalt\n        );\n        ERC1155SeaDropCloneable(instance).initialize(\n            configurer,\n            seaport,\n            name,\n            symbol,\n            msg.sender\n        );\n    }\n}\n"
      },
      "src/clones/ERC1155SeaDropCloneable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    ERC1155SeaDropContractOffererCloneable\n} from \"./ERC1155SeaDropContractOffererCloneable.sol\";\n\n/**\n * @title  ERC1155SeaDropCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A cloneable ERC1155 token contract that can mint as a\n *         Seaport contract offerer.\n */\ncontract ERC1155SeaDropCloneable is ERC1155SeaDropContractOffererCloneable {\n    /**\n     * @notice Initialize the token contract.\n     *\n     * @param allowedConfigurer The address of the contract allowed to\n     *                          implementation code. Also contains SeaDrop\n     *                          implementation code.\n     * @param allowedSeaport    The address of the Seaport contract allowed to\n     *                          interact.\n     * @param name_             The name of the token.\n     * @param symbol_           The symbol of the token.\n     */\n    function initialize(\n        address allowedConfigurer,\n        address allowedSeaport,\n        string memory name_,\n        string memory symbol_,\n        address initialOwner\n    ) public initializer {\n        // Initialize ownership.\n        _initializeOwner(initialOwner);\n\n        // Initialize ERC1155SeaDropContractOffererCloneable.\n        __ERC1155SeaDropContractOffererCloneable_init(\n            allowedConfigurer,\n            allowedSeaport,\n            name_,\n            symbol_\n        );\n    }\n\n    /**\n     * @dev Auto-approve the conduit after mint or transfer.\n     *\n     * @custom:param from    The address to transfer from.\n     * @param        to      The address to transfer to.\n     * @custom:param ids     The token ids to transfer.\n     * @custom:param amounts The quantities to transfer.\n     * @custom:param data    The data to pass if receiver is a contract.\n     */\n    function _afterTokenTransfer(\n        address /* from */,\n        address to,\n        uint256[] memory /* ids */,\n        uint256[] memory /* amounts */,\n        bytes memory /* data */\n    ) internal virtual override {\n        // Auto-approve the conduit.\n        if (to != address(0) && !isApprovedForAll(to, _CONDUIT)) {\n            _setApprovalForAll(to, _CONDUIT, true);\n        }\n    }\n\n    /**\n     * @dev Override this function to return true if `_afterTokenTransfer` is\n     *      used. The is to help the compiler avoid producing dead bytecode.\n     */\n    function _useAfterTokenTransfer()\n        internal\n        view\n        virtual\n        override\n        returns (bool)\n    {\n        return true;\n    }\n\n    /**\n     * @notice Burns a token, restricted to the owner or approved operator,\n     *         and must have sufficient balance.\n     *\n     * @param from   The address to burn from.\n     * @param id     The token id to burn.\n     * @param amount The amount to burn.\n     */\n    function burn(address from, uint256 id, uint256 amount) external {\n        // Burn the token.\n        _burn(msg.sender, from, id, amount);\n    }\n\n    /**\n     * @notice Burns a batch of tokens, restricted to the owner or\n     *         approved operator, and must have sufficient balance.\n     *\n     * @param from    The address to burn from.\n     * @param ids     The token ids to burn.\n     * @param amounts The amounts to burn per token id.\n     */\n    function batchBurn(\n        address from,\n        uint256[] calldata ids,\n        uint256[] calldata amounts\n    ) external {\n        // Burn the tokens.\n        _batchBurn(msg.sender, from, ids, amounts);\n    }\n}\n"
      },
      "src/lib/ERC1155SeaDropConfigurer.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    ERC1155SeaDropContractOffererImplementation\n} from \"./ERC1155SeaDropContractOffererImplementation.sol\";\n\nimport { PublicDrop, MultiConfigureStruct } from \"./ERC1155SeaDropStructs.sol\";\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\nimport {\n    IERC1155ContractMetadata\n} from \"../interfaces/IERC1155ContractMetadata.sol\";\n\nimport { IERC1155SeaDrop } from \"../interfaces/IERC1155SeaDrop.sol\";\n\nimport { IERC173 } from \"../interfaces/IERC173.sol\";\n\n/**\n * @title  ERC1155SeaDropConfigurer\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A helper contract to configure parameters for ERC1155SeaDrop.\n */\ncontract ERC1155SeaDropConfigurer is\n    ERC1155SeaDropContractOffererImplementation\n{\n    /**\n     * @notice Revert with an error if the sender is not the owner\n     *         of the token contract.\n     */\n    error Unauthorized();\n\n    /**\n     * @dev Reverts if the sender is not the owner of the token.\n     *\n     *      This is used as a function instead of a modifier\n     *      to save contract space when used multiple times.\n     */\n    function _onlyOwner(address token) internal view {\n        if (msg.sender != IERC173(token).owner()) {\n            revert Unauthorized();\n        }\n    }\n\n    /**\n     * @notice Configure multiple properties at a time.\n     *\n     *         Only the owner of the token can use this function.\n     *\n     *         Note: The individual configure methods should be used\n     *         to unset or reset any properties to zero, as this method\n     *         will ignore zero-value properties in the config struct.\n     *\n     * @param token  The ERC1155SeaDrop contract address.\n     * @param config The configuration struct.\n     */\n    function multiConfigure(\n        address token,\n        MultiConfigureStruct calldata config\n    ) external {\n        // Ensure the sender is the owner of the token.\n        _onlyOwner(token);\n\n        if (config.maxSupplyTokenIds.length != 0) {\n            if (\n                config.maxSupplyTokenIds.length !=\n                config.maxSupplyAmounts.length\n            ) {\n                revert MaxSupplyMismatch();\n            }\n            for (uint256 i = 0; i < config.maxSupplyTokenIds.length; ) {\n                IERC1155ContractMetadata(token).setMaxSupply(\n                    config.maxSupplyTokenIds[i],\n                    config.maxSupplyAmounts[i]\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (bytes(config.baseURI).length != 0) {\n            IERC1155ContractMetadata(token).setBaseURI(config.baseURI);\n        }\n        if (bytes(config.contractURI).length != 0) {\n            IERC1155ContractMetadata(token).setContractURI(config.contractURI);\n        }\n        if (config.provenanceHash != bytes32(0)) {\n            IERC1155ContractMetadata(token).setProvenanceHash(\n                config.provenanceHash\n            );\n        }\n        if (\n            _cast(config.royaltyReceiver != address(0)) &\n                _cast(config.royaltyBps != 0) ==\n            1\n        ) {\n            IERC1155ContractMetadata(token).setDefaultRoyalty(\n                config.royaltyReceiver,\n                config.royaltyBps\n            );\n        }\n\n        if (config.publicDrops.length != 0) {\n            if (config.publicDrops.length != config.publicDropsIndexes.length) {\n                revert PublicDropsMismatch();\n            }\n            for (uint256 i = 0; i < config.publicDrops.length; ) {\n                IERC1155SeaDrop(address(token)).updatePublicDrop(\n                    config.publicDrops[i],\n                    config.publicDropsIndexes[i]\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (bytes(config.dropURI).length != 0) {\n            IERC1155SeaDrop(address(token)).updateDropURI(config.dropURI);\n        }\n        if (config.allowListData.merkleRoot != bytes32(0)) {\n            IERC1155SeaDrop(address(token)).updateAllowList(\n                config.allowListData\n            );\n        }\n        if (config.creatorPayouts.length != 0) {\n            IERC1155SeaDrop(address(token)).updateCreatorPayouts(\n                config.creatorPayouts\n            );\n        }\n        if (config.allowedFeeRecipients.length != 0) {\n            for (uint256 i = 0; i < config.allowedFeeRecipients.length; ) {\n                IERC1155SeaDrop(address(token)).updateAllowedFeeRecipient(\n                    config.allowedFeeRecipients[i],\n                    true\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.disallowedFeeRecipients.length != 0) {\n            for (uint256 i = 0; i < config.disallowedFeeRecipients.length; ) {\n                IERC1155SeaDrop(address(token)).updateAllowedFeeRecipient(\n                    config.disallowedFeeRecipients[i],\n                    false\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.allowedPayers.length != 0) {\n            for (uint256 i = 0; i < config.allowedPayers.length; ) {\n                IERC1155SeaDrop(address(token)).updatePayer(\n                    config.allowedPayers[i],\n                    true\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.disallowedPayers.length != 0) {\n            for (uint256 i = 0; i < config.disallowedPayers.length; ) {\n                IERC1155SeaDrop(address(token)).updatePayer(\n                    config.disallowedPayers[i],\n                    false\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.allowedSigners.length != 0) {\n            for (uint256 i = 0; i < config.allowedSigners.length; ) {\n                IERC1155SeaDrop(address(token)).updateSigner(\n                    config.allowedSigners[i],\n                    true\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.disallowedSigners.length != 0) {\n            for (uint256 i = 0; i < config.disallowedSigners.length; ) {\n                IERC1155SeaDrop(address(token)).updateSigner(\n                    config.disallowedSigners[i],\n                    false\n                );\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n        if (config.mintTokenIds.length != 0) {\n            if (config.mintTokenIds.length != config.mintAmounts.length) {\n                revert MintAmountsMismatch();\n            }\n            IERC1155SeaDrop(token).multiConfigureMint(\n                config.mintRecipient,\n                config.mintTokenIds,\n                config.mintAmounts\n            );\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/proxy/Clones.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.19;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n    /**\n     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n     *\n     * This function uses the create opcode, which should never revert.\n     */\n    function clone(address implementation) internal returns (address instance) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n            // of the `implementation` address with the bytecode before the address.\n            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n            instance := create(0, 0x09, 0x37)\n        }\n        require(instance != address(0), \"ERC1167: create failed\");\n    }\n\n    /**\n     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n     *\n     * This function uses the create2 opcode and a `salt` to deterministically deploy\n     * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n     * the clones cannot be deployed twice at the same address.\n     */\n    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n            // of the `implementation` address with the bytecode before the address.\n            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n            instance := create2(0, 0x09, 0x37, salt)\n        }\n        require(instance != address(0), \"ERC1167: create2 failed\");\n    }\n\n    /**\n     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n     */\n    function predictDeterministicAddress(\n        address implementation,\n        bytes32 salt,\n        address deployer\n    ) internal pure returns (address predicted) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(add(ptr, 0x38), deployer)\n            mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n            mstore(add(ptr, 0x14), implementation)\n            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n            mstore(add(ptr, 0x58), salt)\n            mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n            predicted := keccak256(add(ptr, 0x43), 0x55)\n        }\n    }\n\n    /**\n     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n     */\n    function predictDeterministicAddress(\n        address implementation,\n        bytes32 salt\n    ) internal view returns (address predicted) {\n        return predictDeterministicAddress(implementation, salt, address(this));\n    }\n}\n"
      },
      "src/clones/ERC1155SeaDropContractOffererCloneable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { IERC1155SeaDrop } from \"../interfaces/IERC1155SeaDrop.sol\";\n\nimport { ISeaDropToken } from \"../interfaces/ISeaDropToken.sol\";\n\nimport {\n    ERC1155ContractMetadataCloneable\n} from \"./ERC1155ContractMetadataCloneable.sol\";\n\nimport {\n    ERC1155SeaDropContractOffererStorage\n} from \"../lib/ERC1155SeaDropContractOffererStorage.sol\";\n\nimport {\n    ERC1155SeaDropErrorsAndEvents\n} from \"../lib/ERC1155SeaDropErrorsAndEvents.sol\";\n\nimport { PublicDrop } from \"../lib//ERC1155SeaDropStructs.sol\";\n\nimport { AllowListData } from \"../lib/SeaDropStructs.sol\";\n\nimport {\n    ERC1155ConduitPreapproved\n} from \"../lib/ERC1155ConduitPreapproved.sol\";\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\nimport { SpentItem } from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    ContractOffererInterface\n} from \"seaport-types/src/interfaces/ContractOffererInterface.sol\";\n\nimport {\n    IERC165\n} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title  ERC1155SeaDropContractOffererCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A cloneable ERC1155 token contract that can mint as a\n *         Seaport contract offerer.\n */\ncontract ERC1155SeaDropContractOffererCloneable is\n    ERC1155ContractMetadataCloneable,\n    ERC1155SeaDropErrorsAndEvents\n{\n    using ERC1155SeaDropContractOffererStorage for ERC1155SeaDropContractOffererStorage.Layout;\n\n    /**\n     * @notice Initialize the token contract.\n     *\n     * @param allowedConfigurer The address of the contract allowed to\n     *                          configure parameters. Also contains SeaDrop\n     *                          implementation code.\n     * @param allowedSeaport    The address of the Seaport contract allowed to\n     *                          interact.\n     * @param name_             The name of the token.\n     * @param symbol_           The symbol of the token.\n     */\n    function __ERC1155SeaDropContractOffererCloneable_init(\n        address allowedConfigurer,\n        address allowedSeaport,\n        string memory name_,\n        string memory symbol_\n    ) internal onlyInitializing {\n        // Set the allowed Seaport to interact with this contract.\n        if (allowedSeaport == address(0)) {\n            revert AllowedSeaportCannotBeZeroAddress();\n        }\n        ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n            allowedSeaport\n        ] = true;\n\n        // Set the allowed Seaport enumeration.\n        address[] memory enumeratedAllowedSeaport = new address[](1);\n        enumeratedAllowedSeaport[0] = allowedSeaport;\n        ERC1155SeaDropContractOffererStorage\n            .layout()\n            ._enumeratedAllowedSeaport = enumeratedAllowedSeaport;\n\n        // Emit an event noting the contract deployment.\n        emit SeaDropTokenDeployed(SEADROP_TOKEN_TYPE.ERC1155_CLONE);\n\n        // Initialize ERC1155ContractMetadataCloneable.\n        __ERC1155ContractMetadataCloneable_init(\n            allowedConfigurer,\n            name_,\n            symbol_\n        );\n    }\n\n    /**\n     * @notice The fallback function is used as a dispatcher for SeaDrop\n     *         methods.\n     */\n    fallback(bytes calldata) external returns (bytes memory output) {\n        // Get the function selector.\n        bytes4 selector = msg.sig;\n\n        // Get the rest of the msg data after the selector.\n        bytes calldata data = msg.data[4:];\n\n        // Determine if we should forward the call to the implementation\n        // contract with SeaDrop logic.\n        bool callSeaDropImplementation = selector ==\n            ISeaDropToken.updateAllowedSeaport.selector ||\n            selector == ISeaDropToken.updateDropURI.selector ||\n            selector == ISeaDropToken.updateAllowList.selector ||\n            selector == ISeaDropToken.updateCreatorPayouts.selector ||\n            selector == ISeaDropToken.updatePayer.selector ||\n            selector == ISeaDropToken.updateAllowedFeeRecipient.selector ||\n            selector == ISeaDropToken.updateSigner.selector ||\n            selector == IERC1155SeaDrop.updatePublicDrop.selector ||\n            selector == ContractOffererInterface.previewOrder.selector ||\n            selector == ContractOffererInterface.generateOrder.selector ||\n            selector == ContractOffererInterface.getSeaportMetadata.selector ||\n            selector == IERC1155SeaDrop.getPublicDrop.selector ||\n            selector == IERC1155SeaDrop.getPublicDropIndexes.selector ||\n            selector == ISeaDropToken.getAllowedSeaport.selector ||\n            selector == ISeaDropToken.getCreatorPayouts.selector ||\n            selector == ISeaDropToken.getAllowListMerkleRoot.selector ||\n            selector == ISeaDropToken.getAllowedFeeRecipients.selector ||\n            selector == ISeaDropToken.getSigners.selector ||\n            selector == ISeaDropToken.getDigestIsUsed.selector ||\n            selector == ISeaDropToken.getPayers.selector;\n\n        // Determine if we should require only the owner or configurer calling.\n        bool requireOnlyOwnerOrConfigurer = selector ==\n            ISeaDropToken.updateAllowedSeaport.selector ||\n            selector == ISeaDropToken.updateDropURI.selector ||\n            selector == ISeaDropToken.updateAllowList.selector ||\n            selector == ISeaDropToken.updateCreatorPayouts.selector ||\n            selector == ISeaDropToken.updatePayer.selector ||\n            selector == ISeaDropToken.updateAllowedFeeRecipient.selector ||\n            selector == IERC1155SeaDrop.updatePublicDrop.selector;\n\n        if (callSeaDropImplementation) {\n            // For update calls, ensure the sender is only the owner\n            // or configurer contract.\n            if (requireOnlyOwnerOrConfigurer) {\n                _onlyOwnerOrConfigurer();\n            } else if (selector == ISeaDropToken.updateSigner.selector) {\n                // For updateSigner, a signer can disallow themselves.\n                // Get the signer parameter.\n                address signer = address(bytes20(data[12:32]));\n                // If the signer is not allowed, ensure sender is only owner\n                // or configurer.\n                if (\n                    msg.sender != signer ||\n                    (msg.sender == signer &&\n                        !ERC1155SeaDropContractOffererStorage\n                            .layout()\n                            ._allowedSigners[signer])\n                ) {\n                    _onlyOwnerOrConfigurer();\n                }\n            }\n\n            // Forward the call to the implementation contract.\n            (bool success, bytes memory returnedData) = _CONFIGURER\n                .delegatecall(msg.data);\n\n            // Require that the call was successful.\n            if (!success) {\n                // Bubble up the revert reason.\n                assembly {\n                    revert(add(32, returnedData), mload(returnedData))\n                }\n            }\n\n            // If the call was to generateOrder, mint the tokens.\n            if (selector == ContractOffererInterface.generateOrder.selector) {\n                _mintOrder(data);\n            }\n\n            // Return the data from the delegate call.\n            return returnedData;\n        } else if (selector == IERC1155SeaDrop.getMintStats.selector) {\n            // Get the minter and token id.\n            (address minter, uint256 tokenId) = abi.decode(\n                data,\n                (address, uint256)\n            );\n\n            // Get the mint stats.\n            (\n                uint256 minterNumMinted,\n                uint256 minterNumMintedForTokenId,\n                uint256 totalMintedForTokenId,\n                uint256 maxSupply\n            ) = _getMintStats(minter, tokenId);\n\n            // Encode the return data.\n            return\n                abi.encode(\n                    minterNumMinted,\n                    minterNumMintedForTokenId,\n                    totalMintedForTokenId,\n                    maxSupply\n                );\n        } else if (selector == ContractOffererInterface.ratifyOrder.selector) {\n            // This function is a no-op, nothing additional needs to happen here.\n            // Utilize assembly to efficiently return the ratifyOrder magic value.\n            assembly {\n                mstore(0, 0xf4dd92ce)\n                return(0x1c, 32)\n            }\n        } else if (selector == ISeaDropToken.configurer.selector) {\n            // Return the configurer contract.\n            return abi.encode(_CONFIGURER);\n        } else if (selector == IERC1155SeaDrop.multiConfigureMint.selector) {\n            // Ensure only the owner or configurer can call this function.\n            _onlyOwnerOrConfigurer();\n\n            // Mint the tokens.\n            _multiConfigureMint(data);\n        } else {\n            // Revert if the function selector is not supported.\n            revert UnsupportedFunctionSelector(selector);\n        }\n    }\n\n    /**\n     * @notice Returns a set of mint stats for the address.\n     *         This assists in enforcing maxSupply, maxTotalMintableByWallet,\n     *         and maxTokenSupplyForStage checks.\n     *\n     * @dev    NOTE: Implementing contracts should always update these numbers\n     *         before transferring any tokens with _safeMint() to mitigate\n     *         consequences of malicious onERC1155Received() hooks.\n     *\n     * @param minter  The minter address.\n     * @param tokenId The token id to return the stats for.\n     */\n    function _getMintStats(\n        address minter,\n        uint256 tokenId\n    )\n        internal\n        view\n        returns (\n            uint256 minterNumMinted,\n            uint256 minterNumMintedForTokenId,\n            uint256 totalMintedForTokenId,\n            uint256 maxSupply\n        )\n    {\n        // Put the token supply on the stack.\n        TokenSupply storage tokenSupply = _tokenSupply[tokenId];\n\n        // Assign the return values.\n        totalMintedForTokenId = tokenSupply.totalMinted;\n        maxSupply = tokenSupply.maxSupply;\n        minterNumMinted = _totalMintedByUser[minter];\n        minterNumMintedForTokenId = _totalMintedByUserPerToken[minter][tokenId];\n    }\n\n    /**\n     * @dev Handle ERC-1155 safeTransferFrom. If \"from\" is this contract,\n     *      the sender can only be Seaport or the conduit.\n     *\n     * @param from   The address to transfer from.\n     * @param to     The address to transfer to.\n     * @param id     The token id to transfer.\n     * @param amount The amount of tokens to transfer.\n     * @param data   The data to pass to the onERC1155Received hook.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes calldata data\n    ) public virtual override {\n        if (from == address(this)) {\n            // Only Seaport or the conduit can use this function\n            // when \"from\" is this contract.\n            if (\n                msg.sender != _CONDUIT &&\n                !ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n                    msg.sender\n                ]\n            ) {\n                revert InvalidCallerOnlyAllowedSeaport(msg.sender);\n            }\n            return;\n        }\n\n        ERC1155._safeTransfer(_by(), from, to, id, amount, data);\n    }\n\n    /**\n     * @notice Returns whether the interface is supported.\n     *\n     * @param interfaceId The interface id to check against.\n     */\n    function supportsInterface(\n        bytes4 interfaceId\n    )\n        public\n        view\n        virtual\n        override(ERC1155ContractMetadataCloneable)\n        returns (bool)\n    {\n        return\n            interfaceId == type(IERC1155SeaDrop).interfaceId ||\n            interfaceId == type(ContractOffererInterface).interfaceId ||\n            interfaceId == 0x2e778efc || // SIP-5 (getSeaportMetadata)\n            // ERC1155ContractMetadata returns supportsInterface true for\n            //     IERC1155ContractMetadata, ERC-4906, ERC-2981\n            // ERC1155A returns supportsInterface true for\n            //     ERC165, ERC1155, ERC1155MetadataURI\n            ERC1155ContractMetadataCloneable.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Internal function to mint tokens during a generateOrder call\n     *      from Seaport.\n     *\n     * @param data The original transaction calldata, without the selector.\n     */\n    function _mintOrder(bytes calldata data) internal {\n        // Decode fulfiller, minimumReceived, and context from calldata.\n        (\n            address fulfiller,\n            SpentItem[] memory minimumReceived,\n            ,\n            bytes memory context\n        ) = abi.decode(data, (address, SpentItem[], SpentItem[], bytes));\n\n        // Assign the minter from context[22:42]. We validate context has the\n        // correct minimum length in the implementation's `_decodeOrder`.\n        address minter;\n        assembly {\n            minter := shr(96, mload(add(add(context, 0x20), 22)))\n        }\n\n        // If the minter is the zero address, set it to the fulfiller.\n        if (minter == address(0)) {\n            minter = fulfiller;\n        }\n\n        // Set the token ids and quantities.\n        uint256 minimumReceivedLength = minimumReceived.length;\n        uint256[] memory tokenIds = new uint256[](minimumReceivedLength);\n        uint256[] memory quantities = new uint256[](minimumReceivedLength);\n        for (uint256 i = 0; i < minimumReceivedLength; ) {\n            tokenIds[i] = minimumReceived[i].identifier;\n            quantities[i] = minimumReceived[i].amount;\n            unchecked {\n                ++i;\n            }\n        }\n\n        // Mint the tokens.\n        _batchMint(minter, tokenIds, quantities, \"\");\n    }\n\n    /**\n     * @dev Internal function to mint tokens during a multiConfigureMint call\n     *      from the configurer contract.\n     *\n     * @param data The original transaction calldata, without the selector.\n     */\n    function _multiConfigureMint(bytes calldata data) internal {\n        // Decode the calldata.\n        (\n            address recipient,\n            uint256[] memory tokenIds,\n            uint256[] memory amounts\n        ) = abi.decode(data, (address, uint256[], uint256[]));\n\n        _batchMint(recipient, tokenIds, amounts, \"\");\n    }\n}\n"
      },
      "src/lib/ERC1155SeaDropContractOffererImplementation.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    ERC1155SeaDropContractOffererStorage\n} from \"./ERC1155SeaDropContractOffererStorage.sol\";\n\nimport {\n    MintDetails,\n    MintParams,\n    PublicDrop\n} from \"./ERC1155SeaDropStructs.sol\";\n\nimport {\n    ERC1155SeaDropErrorsAndEvents\n} from \"./ERC1155SeaDropErrorsAndEvents.sol\";\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\nimport { IERC1155SeaDrop } from \"../interfaces/IERC1155SeaDrop.sol\";\n\nimport { ISeaDropToken } from \"../interfaces/ISeaDropToken.sol\";\n\nimport { IDelegationRegistry } from \"../interfaces/IDelegationRegistry.sol\";\n\nimport { ItemType } from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    ReceivedItem,\n    SpentItem,\n    Schema\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { ECDSA } from \"solady/src/utils/ECDSA.sol\";\n\n/**\n * @title  ERC1155SeaDropContractOffererImplementation\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A helper contract that contains the implementation logic for\n *         ERC1155SeaDropContractOfferer, to help reduce contract size\n *         on the token contract itself.\n */\ncontract ERC1155SeaDropContractOffererImplementation is\n    ERC1155SeaDropErrorsAndEvents\n{\n    using ERC1155SeaDropContractOffererStorage for ERC1155SeaDropContractOffererStorage.Layout;\n\n    /// @notice The delegation registry.\n    IDelegationRegistry public constant DELEGATION_REGISTRY =\n        IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B);\n\n    /// @notice The original address of this contract, to ensure that it can\n    ///         only be called into with delegatecall.\n    address internal immutable _originalImplementation = address(this);\n\n    /// @notice Internal constants for EIP-712: Typed structured\n    ///         data hashing and signing\n    bytes32 internal constant _SIGNED_MINT_TYPEHASH =\n        // prettier-ignore\n        keccak256(\n            \"SignedMint(\"\n                \"address minter,\"\n                \"address feeRecipient,\"\n                \"MintParams mintParams,\"\n                \"uint256 salt\"\n            \")\"\n            \"MintParams(\"\n                \"uint256 startPrice,\"\n                \"uint256 endPrice,\"\n                \"uint256 startTime,\"\n                \"uint256 endTime,\"\n                \"address paymentToken,\"\n                \"uint256 fromTokenId,\"\n                \"uint256 toTokenId,\"\n                \"uint256 maxTotalMintableByWallet,\"\n                \"uint256 maxTotalMintableByWalletPerToken,\"\n                \"uint256 maxTokenSupplyForStage,\"\n                \"uint256 dropStageIndex,\"\n                \"uint256 feeBps,\"\n                \"bool restrictFeeRecipients\"\n            \")\"\n        );\n    bytes32 internal constant _MINT_PARAMS_TYPEHASH =\n        // prettier-ignore\n        keccak256(\n            \"MintParams(\"\n                \"uint256 startPrice,\"\n                \"uint256 endPrice,\"\n                \"uint256 startTime,\"\n                \"uint256 endTime,\"\n                \"address paymentToken,\"\n                \"uint256 fromTokenId,\"\n                \"uint256 toTokenId,\"\n                \"uint256 maxTotalMintableByWallet,\"\n                \"uint256 maxTotalMintableByWalletPerToken,\"\n                \"uint256 maxTokenSupplyForStage,\"\n                \"uint256 dropStageIndex,\"\n                \"uint256 feeBps,\"\n                \"bool restrictFeeRecipients\"\n            \")\"\n        );\n    bytes32 internal constant _EIP_712_DOMAIN_TYPEHASH =\n        // prettier-ignore\n        keccak256(\n            \"EIP712Domain(\"\n                \"string name,\"\n                \"string version,\"\n                \"uint256 chainId,\"\n                \"address verifyingContract\"\n            \")\"\n        );\n    bytes32 internal constant _NAME_HASH = keccak256(\"ERC1155SeaDrop\");\n    bytes32 internal constant _VERSION_HASH = keccak256(\"2.0\");\n\n    /**\n     * @notice Constant for an unlimited `maxTokenSupplyForStage`.\n     *         Used in `mintPublic` where no `maxTokenSupplyForStage`\n     *         is stored in the `PublicDrop` struct.\n     */\n    uint256 internal constant _UNLIMITED_MAX_TOKEN_SUPPLY_FOR_STAGE =\n        type(uint256).max;\n\n    /**\n     * @dev Constructor for contract deployment.\n     */\n    constructor() {}\n\n    /**\n     * @notice The fallback function is used as a dispatcher for SeaDrop\n     *         methods.\n     */\n    fallback(bytes calldata) external returns (bytes memory output) {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Get the function selector.\n        bytes4 selector = msg.sig;\n\n        // Get the rest of the msg data after the selector.\n        bytes calldata data = msg.data[4:];\n\n        if (selector == IERC1155SeaDrop.getPublicDrop.selector) {\n            // Get the public drop index.\n            uint256 publicDropIndex = uint256(bytes32(data[:32]));\n\n            // Return the public drop.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage.layout()._publicDrops[\n                        publicDropIndex\n                    ]\n                );\n        } else if (selector == IERC1155SeaDrop.getPublicDropIndexes.selector) {\n            // Return the public drop indexes.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._enumeratedPublicDropIndexes\n                );\n        } else if (selector == ISeaDropToken.getAllowedSeaport.selector) {\n            // Return the allowed Seaport.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._enumeratedAllowedSeaport\n                );\n        } else if (selector == ISeaDropToken.getCreatorPayouts.selector) {\n            // Return the creator payouts.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._creatorPayouts\n                );\n        } else if (selector == ISeaDropToken.getAllowListMerkleRoot.selector) {\n            // Return the creator payouts.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._allowListMerkleRoot\n                );\n        } else if (selector == ISeaDropToken.getAllowedFeeRecipients.selector) {\n            // Return the allowed fee recipients.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._enumeratedFeeRecipients\n                );\n        } else if (selector == ISeaDropToken.getSigners.selector) {\n            // Return the allowed signers.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._enumeratedSigners\n                );\n        } else if (selector == ISeaDropToken.getDigestIsUsed.selector) {\n            // Get the digest.\n            bytes32 digest = bytes32(data[0:32]);\n\n            // Return if the digest is used.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage.layout()._usedDigests[\n                        digest\n                    ]\n                );\n        } else if (selector == ISeaDropToken.getPayers.selector) {\n            // Return the allowed signers.\n            return\n                abi.encode(\n                    ERC1155SeaDropContractOffererStorage\n                        .layout()\n                        ._enumeratedPayers\n                );\n        } else {\n            // Revert if the function selector is not supported.\n            revert UnsupportedFunctionSelector(selector);\n        }\n    }\n\n    /**\n     * @notice Returns the metadata for this contract offerer.\n     *\n     * @return name    The name of the contract offerer.\n     * @return schemas The schemas supported by the contract offerer.\n     */\n    function getSeaportMetadata()\n        external\n        pure\n        returns (\n            string memory name,\n            Schema[] memory schemas // map to Seaport Improvement Proposal IDs\n        )\n    {\n        name = \"ERC1155SeaDrop\";\n        schemas = new Schema[](1);\n        schemas[0].id = 12;\n\n        // Encode the SIP-12 substandards.\n        uint256[] memory substandards = new uint256[](3);\n        substandards[0] = 0;\n        substandards[1] = 1;\n        substandards[2] = 2;\n        schemas[0].metadata = abi.encode(substandards);\n    }\n\n    /**\n     * @notice Implementation function to emit an event to notify update of\n     *         the drop URI.\n     *\n     *         Do not use this method directly.\n     *\n     * @param dropURI The new drop URI.\n     */\n    function updateDropURI(string calldata dropURI) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Emit an event with the update.\n        emit DropURIUpdated(dropURI);\n    }\n\n    /**\n     * @notice Implementation function to update the public drop data and\n     *         emit an event.\n     *\n     *         Do not use this method directly.\n     *\n     * @param publicDrop The public drop data.\n     * @param index      The index of the public drop.\n     */\n    function updatePublicDrop(\n        PublicDrop calldata publicDrop,\n        uint256 index\n    ) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Revert if the fee basis points is greater than 10_000.\n        if (publicDrop.feeBps > 10_000) {\n            revert InvalidFeeBps(publicDrop.feeBps);\n        }\n\n        // Revert if the startTime is past the endTime.\n        if (publicDrop.startTime > publicDrop.endTime) {\n            revert InvalidStartAndEndTime(\n                publicDrop.startTime,\n                publicDrop.endTime\n            );\n        }\n\n        // Revert if the fromTokenId is greater than the toTokenId.\n        if (publicDrop.fromTokenId > publicDrop.toTokenId) {\n            revert InvalidFromAndToTokenId(\n                publicDrop.fromTokenId,\n                publicDrop.toTokenId\n            );\n        }\n\n        // Use maxTotalMintableByWallet != 0 as a signal that this update should\n        // add or update the drop stage, otherwise we will be removing.\n        bool addOrUpdateDropStage = publicDrop.maxTotalMintableByWallet != 0;\n\n        // Get pointers to the token gated drop data and enumerated addresses.\n        PublicDrop\n            storage existingDropStageData = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._publicDrops[index];\n        uint256[]\n            storage enumeratedIndexes = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._enumeratedPublicDropIndexes;\n\n        // Stage struct packs to two slots, so load it\n        // as a uint256; if it is 0, it is empty.\n        bool dropStageDoesNotExist;\n        assembly {\n            dropStageDoesNotExist := iszero(\n                or(\n                    sload(existingDropStageData.slot),\n                    sload(add(existingDropStageData.slot, 1))\n                )\n            )\n        }\n\n        if (addOrUpdateDropStage) {\n            ERC1155SeaDropContractOffererStorage.layout()._publicDrops[\n                index\n            ] = publicDrop;\n            // Add to enumeration if it does not exist already.\n            if (dropStageDoesNotExist) {\n                enumeratedIndexes.push(index);\n            }\n        } else {\n            // Check we are not deleting a drop stage that does not exist.\n            if (dropStageDoesNotExist) {\n                revert PublicDropStageNotPresent();\n            }\n            // Clear storage slot and remove from enumeration.\n            delete ERC1155SeaDropContractOffererStorage.layout()._publicDrops[\n                index\n            ];\n            _removeFromEnumeration(index, enumeratedIndexes);\n        }\n\n        // Emit an event with the update.\n        emit PublicDropUpdated(publicDrop, index);\n    }\n\n    /**\n     * @notice Implementation function to update the allow list merkle root\n     *         for the nft contract and emit an event.\n     *\n     *         Do not use this method directly.\n     *\n     * @param allowListData The allow list data.\n     */\n    function updateAllowList(AllowListData calldata allowListData) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Put the previous root on the stack to use for the event.\n        bytes32 prevRoot = ERC1155SeaDropContractOffererStorage\n            .layout()\n            ._allowListMerkleRoot;\n\n        // Update the merkle root.\n        ERC1155SeaDropContractOffererStorage\n            .layout()\n            ._allowListMerkleRoot = allowListData.merkleRoot;\n\n        // Emit an event with the update.\n        emit AllowListUpdated(\n            prevRoot,\n            allowListData.merkleRoot,\n            allowListData.publicKeyURIs,\n            allowListData.allowListURI\n        );\n    }\n\n    /**\n     * @dev Implementation function to generate a mint order with the required\n     *      consideration items.\n     *\n     *      Do not use this method directly.\n     *\n     * @param fulfiller              The address of the fulfiller.\n     * @param minimumReceived        The minimum items that the caller must\n     *                               receive. To specify a range of ERC-1155\n     *                               tokens, use a null address ERC-1155 with\n     *                               the amount as the quantity.\n     * @custom:param maximumSpent    Maximum items the caller is willing to\n     *                               spend. Must meet or exceed the requirement.\n     * @param context                Context of the order according to SIP-12,\n     *                               containing the mint parameters.\n     *\n     * @return offer         An array containing the offer items.\n     * @return consideration An array containing the consideration items.\n     */\n    function generateOrder(\n        address fulfiller,\n        SpentItem[] calldata minimumReceived,\n        SpentItem[] calldata /* maximumSpent */,\n        bytes calldata context // encoded based on the schemaID\n    )\n        external\n        returns (SpentItem[] memory offer, ReceivedItem[] memory consideration)\n    {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Only an allowed Seaport can call this function.\n        if (\n            !ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n                msg.sender\n            ]\n        ) {\n            revert InvalidCallerOnlyAllowedSeaport(msg.sender);\n        }\n\n        // Derive the offer and consideration with effects.\n        (offer, consideration) = _createOrder(\n            fulfiller,\n            minimumReceived,\n            context,\n            true\n        );\n    }\n\n    /**\n     * @dev Implementation view function to preview a mint order.\n     *\n     *      Do not use this method directly.\n     *\n     * @custom:param caller       The address of the caller (e.g. Seaport).\n     * @param fulfiller           The address of the fulfiller.\n     * @param minimumReceived     The minimum items that the caller must\n     *                            receive.\n     * @custom:param maximumSpent Maximum items the caller is willing to spend.\n     *                            Must meet or exceed the requirement.\n     * @param context             Context of the order according to SIP-12,\n     *                            containing the mint parameters.\n     *\n     * @return offer         An array containing the offer items.\n     * @return consideration An array containing the consideration items.\n     */\n    function previewOrder(\n        address /* caller */,\n        address fulfiller,\n        SpentItem[] calldata minimumReceived,\n        SpentItem[] calldata /* maximumSpent */,\n        bytes calldata context\n    )\n        external\n        view\n        returns (SpentItem[] memory offer, ReceivedItem[] memory consideration)\n    {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // To avoid the solidity compiler complaining about calling a non-view\n        // function here (_createOrder), we will cast it as a view and use it.\n        // This is okay because we are not modifying any state when passing\n        // withEffects=false.\n        function(address, SpentItem[] calldata, bytes calldata, bool)\n            internal\n            view\n            returns (SpentItem[] memory, ReceivedItem[] memory) fn;\n        function(address, SpentItem[] calldata, bytes calldata, bool)\n            internal\n            returns (\n                SpentItem[] memory,\n                ReceivedItem[] memory\n            ) fn2 = _createOrder;\n        assembly {\n            fn := fn2\n        }\n\n        // Derive the offer and consideration without effects.\n        (offer, consideration) = fn(fulfiller, minimumReceived, context, false);\n    }\n\n    /**\n     * @dev Decodes an order and returns the offer and substandard version.\n     *\n     * @param minimumReceived The minimum items that the caller must\n     *                        receive.\n     * @param context         Context of the order according to SIP-12.\n     */\n    function _decodeOrder(\n        SpentItem[] calldata minimumReceived,\n        bytes calldata context\n    ) internal view returns (uint8 substandard) {\n        // Declare an error buffer; first check minimumReceived is not length\n        // zero and every minimumReceived has this address for token.\n        uint256 errorBuffer;\n        uint256 minimumReceivedLength = minimumReceived.length;\n        errorBuffer |= _castAndInvert(minimumReceivedLength > 0);\n        for (uint256 i = 0; i < minimumReceivedLength; ) {\n            errorBuffer |=\n                _castAndInvert(\n                    minimumReceived[i].itemType == ItemType.ERC1155\n                ) |\n                _castAndInvert(minimumReceived[i].token == address(this));\n            unchecked {\n                ++i;\n            }\n        }\n\n        // Set the substandard version.\n        substandard = uint8(context[1]);\n\n        // Next, check for SIP-6 version byte.\n        errorBuffer |= _castAndInvert(context[0] == bytes1(0x00)) << 1;\n\n        // Next, check for supported substandard.\n        errorBuffer |= _castAndInvert(substandard < 3) << 2;\n\n        // Next, check for correct context length. Minimum is 43 bytes\n        // (version byte, substandard byte, feeRecipient, minter,\n        //  publicDropIndex OR other substandard mint params)\n        unchecked {\n            errorBuffer |= _castAndInvert(context.length > 42) << 3;\n        }\n\n        // Handle decoding errors.\n        if (errorBuffer != 0) {\n            uint8 version = uint8(context[0]);\n\n            // We'll first revert with SIP-6 errors to follow spec.\n            // (`UnsupportedExtraDataVersion` and `InvalidExtraDataEncoding`)\n            if (errorBuffer << 254 != 0) {\n                revert UnsupportedExtraDataVersion(version);\n            } else if (errorBuffer << 252 != 0) {\n                revert InvalidExtraDataEncoding(version);\n            } else if (errorBuffer << 253 != 0) {\n                revert InvalidSubstandard(substandard);\n            } else {\n                // errorBuffer << 255 != 0\n                revert MustSpecifyERC1155ConsiderationItemForSeaDropMint();\n            }\n        }\n    }\n\n    /**\n     * @dev Creates an order with the required mint payment.\n     *\n     * @param fulfiller           The fulfiller of the order.\n     * @param minimumReceived     The minimum items that the caller must\n     *                            receive.\n     * @param context             Context of the order according to SIP-12,\n     *                            containing the mint parameters.\n     * @param withEffects         Whether to apply state changes of the mint.\n     *\n     * @return offer         An array containing the offer items.\n     * @return consideration An array containing the consideration items.\n     */\n    function _createOrder(\n        address fulfiller,\n        SpentItem[] calldata minimumReceived,\n        bytes calldata context,\n        bool withEffects\n    )\n        internal\n        returns (SpentItem[] memory offer, ReceivedItem[] memory consideration)\n    {\n        // Derive the substandard version.\n        uint8 substandard = _decodeOrder(minimumReceived, context);\n\n        // The offer is the minimumReceived which is validated in `_decodeOrder`.\n        offer = minimumReceived;\n\n        // All substandards have feeRecipient and minter as first two params.\n        address feeRecipient = address(bytes20(context[2:22]));\n        address minter = address(bytes20(context[22:42]));\n\n        // If the minter is the zero address, set it to the fulfiller.\n        if (minter == address(0)) {\n            minter = fulfiller;\n        }\n\n        // Start compiling the MintDetails struct to avoid stack too deep.\n        uint256 minimumReceivedLength = minimumReceived.length;\n        MintDetails memory mintDetails = MintDetails({\n            feeRecipient: feeRecipient,\n            payer: fulfiller,\n            minter: minter,\n            tokenIds: new uint256[](minimumReceivedLength),\n            quantities: new uint256[](minimumReceivedLength),\n            withEffects: withEffects\n        });\n\n        // Set the token ids and quantities.\n        for (uint256 i = 0; i < minimumReceivedLength; ) {\n            mintDetails.tokenIds[i] = minimumReceived[i].identifier;\n            mintDetails.quantities[i] = minimumReceived[i].amount;\n            unchecked {\n                ++i;\n            }\n        }\n\n        if (substandard == 0) {\n            // 0: Public mint\n            uint8 publicDropIndex = uint8(bytes1(context[42:43]));\n            consideration = _mintPublic(mintDetails, publicDropIndex);\n        } else if (substandard == 1) {\n            // 1: Allow list mint\n            MintParams memory mintParams = abi.decode(\n                context[42:458],\n                (MintParams)\n            );\n            // Instead of putting the proof in memory, pass context and offset\n            // to use it directly from calldata.\n            consideration = _mintAllowList(\n                mintDetails,\n                mintParams,\n                context,\n                458\n            );\n        } else {\n            // substandard == 2\n            // 2: Signed mint\n            MintParams memory mintParams = abi.decode(\n                context[42:458],\n                (MintParams)\n            );\n            uint256 salt = uint256(bytes32(context[458:490]));\n            bytes32 signatureR = bytes32(context[490:522]);\n            bytes32 signatureVS = bytes32(context[522:554]);\n            consideration = _mintSigned(\n                mintDetails,\n                mintParams,\n                salt,\n                signatureR,\n                signatureVS\n            );\n        }\n    }\n\n    /**\n     * @notice Mint a public drop stage.\n     *\n     * @param mintDetails     The mint details.\n     * @param publicDropIndex The public drop index to mint.\n     */\n    function _mintPublic(\n        MintDetails memory mintDetails,\n        uint8 publicDropIndex\n    ) internal returns (ReceivedItem[] memory consideration) {\n        // Get the public drop.\n        PublicDrop memory publicDrop = ERC1155SeaDropContractOffererStorage\n            .layout()\n            ._publicDrops[publicDropIndex];\n\n        // Check that the tokenIds are within the range of the stage.\n        _checkTokenIds(\n            mintDetails.tokenIds,\n            publicDrop.fromTokenId,\n            publicDrop.toTokenId\n        );\n\n        // Check the number of mints are available\n        // and reduce quantity if needed..\n        uint256 totalQuantity = _checkMintQuantities(\n            mintDetails.tokenIds,\n            mintDetails.quantities,\n            mintDetails.minter,\n            publicDrop.maxTotalMintableByWallet,\n            publicDrop.maxTotalMintableByWalletPerToken,\n            _UNLIMITED_MAX_TOKEN_SUPPLY_FOR_STAGE\n        );\n\n        // Check that the stage is active and calculate the current price.\n        uint256 currentPrice = _currentPrice(\n            publicDrop.startTime,\n            publicDrop.endTime,\n            publicDrop.startPrice,\n            publicDrop.endPrice\n        );\n\n        // Validate the mint parameters.\n        // If passed withEffects=true, emits an event for analytics.\n        consideration = _validateMint(\n            mintDetails,\n            totalQuantity,\n            currentPrice,\n            publicDrop.paymentToken,\n            publicDrop.feeBps,\n            publicDropIndex,\n            publicDrop.restrictFeeRecipients\n        );\n    }\n\n    /**\n     * @notice Mint an allow list drop stage.\n     *\n     * @param mintDetails  The mint details.\n     * @param mintParams   The mint parameters.\n     * @param context      The context of the order.\n     * @param proofOffsetInContext The offset of the proof in the context.\n     */\n    function _mintAllowList(\n        MintDetails memory mintDetails,\n        MintParams memory mintParams,\n        bytes calldata context,\n        uint256 proofOffsetInContext\n    ) internal returns (ReceivedItem[] memory consideration) {\n        // Verify the proof.\n        if (\n            !_verifyProof(\n                context,\n                proofOffsetInContext,\n                ERC1155SeaDropContractOffererStorage\n                    .layout()\n                    ._allowListMerkleRoot,\n                keccak256(abi.encode(mintDetails.minter, mintParams))\n            )\n        ) {\n            revert InvalidProof();\n        }\n\n        // Check that the tokenIds are within the range of the stage.\n        _checkTokenIds(\n            mintDetails.tokenIds,\n            mintParams.fromTokenId,\n            mintParams.toTokenId\n        );\n\n        // Check the number of mints are available.\n        uint256 totalQuantity = _checkMintQuantities(\n            mintDetails.tokenIds,\n            mintDetails.quantities,\n            mintDetails.minter,\n            mintParams.maxTotalMintableByWallet,\n            mintParams.maxTotalMintableByWalletPerToken,\n            mintParams.maxTokenSupplyForStage\n        );\n\n        // Check that the stage is active and calculate the current price.\n        uint256 currentPrice = _currentPrice(\n            mintParams.startTime,\n            mintParams.endTime,\n            mintParams.startPrice,\n            mintParams.endPrice\n        );\n\n        // Validate the mint parameters.\n        // If passed withEffects=true, emits an event for analytics.\n        consideration = _validateMint(\n            mintDetails,\n            totalQuantity,\n            currentPrice,\n            mintParams.paymentToken,\n            mintParams.feeBps,\n            mintParams.dropStageIndex,\n            mintParams.restrictFeeRecipients\n        );\n    }\n\n    /**\n     * @notice Mint with a server-side signature.\n     *         Note that a signature can only be used once.\n     *\n     * @param mintDetails  The mint details.\n     * @param mintParams   The mint parameters.\n     * @param salt         The salt for the signed mint.\n     * @param signatureR   The server-side signature `r` value.\n     * @param signatureVS  The server-side signature `vs` value.\n     */\n    function _mintSigned(\n        MintDetails memory mintDetails,\n        MintParams memory mintParams,\n        uint256 salt,\n        bytes32 signatureR,\n        bytes32 signatureVS\n    ) internal returns (ReceivedItem[] memory consideration) {\n        // Get the digest to verify the EIP-712 signature.\n        bytes32 digest = _getDigest(\n            mintDetails.minter,\n            mintDetails.feeRecipient,\n            mintParams,\n            salt\n        );\n\n        // Ensure the digest has not already been used.\n        if (\n            ERC1155SeaDropContractOffererStorage.layout()._usedDigests[digest]\n        ) {\n            revert SignatureAlreadyUsed();\n        } else if (mintDetails.withEffects) {\n            // Mark the digest as used.\n            ERC1155SeaDropContractOffererStorage.layout()._usedDigests[\n                digest\n            ] = true;\n        }\n\n        // Check that the tokenId is within the range of the stage.\n        _checkTokenIds(\n            mintDetails.tokenIds,\n            mintParams.fromTokenId,\n            mintParams.toTokenId\n        );\n\n        // Check the number of mints are available.\n        uint256 totalQuantity = _checkMintQuantities(\n            mintDetails.tokenIds,\n            mintDetails.quantities,\n            mintDetails.minter,\n            mintParams.maxTotalMintableByWallet,\n            mintParams.maxTotalMintableByWalletPerToken,\n            mintParams.maxTokenSupplyForStage\n        );\n\n        // Check that the stage is active and calculate the current price.\n        uint256 currentPrice = _currentPrice(\n            mintParams.startTime,\n            mintParams.endTime,\n            mintParams.startPrice,\n            mintParams.endPrice\n        );\n\n        // Validate the mint parameters.\n        // If passed withEffects=true, emits an event for analytics.\n        consideration = _validateMint(\n            mintDetails,\n            totalQuantity,\n            currentPrice,\n            mintParams.paymentToken,\n            mintParams.feeBps,\n            mintParams.dropStageIndex,\n            mintParams.restrictFeeRecipients\n        );\n\n        // Use the recover method to see what address was used to create\n        // the signature on this data.\n        // Note that if the digest doesn't exactly match what was signed we'll\n        // get a random recovered address.\n        address recoveredAddress = ECDSA.recover(\n            digest,\n            signatureR,\n            signatureVS\n        );\n        if (\n            !ERC1155SeaDropContractOffererStorage.layout()._allowedSigners[\n                recoveredAddress\n            ]\n        ) {\n            revert ECDSA.InvalidSignature();\n        }\n    }\n\n    /**\n     * @dev Validates a mint, reverting if the mint is invalid.\n     *      If withEffects=true, sets mint recipient and emits an event.\n     *\n     * @param mintDetails           The mint details.\n     * @param totalQuantity         The total quantity of tokens to mint.\n     * @param currentPrice          The current price of the stage.\n     * @param paymentToken          The payment token.\n     * @param feeBps                The fee basis points.\n     * @param dropStageIndex        The drop stage index.\n     * @param restrictFeeRecipients Whether to restrict fee recipients.\n     */\n    function _validateMint(\n        MintDetails memory mintDetails,\n        uint256 totalQuantity,\n        uint256 currentPrice,\n        address paymentToken,\n        uint256 feeBps,\n        uint256 dropStageIndex,\n        bool restrictFeeRecipients\n    ) internal returns (ReceivedItem[] memory consideration) {\n        // Check the payer is allowed.\n        _checkPayerIsAllowed(mintDetails.payer, mintDetails.minter);\n\n        // Check that the fee recipient is allowed if restricted.\n        _checkFeeRecipientIsAllowed(\n            mintDetails.feeRecipient,\n            restrictFeeRecipients\n        );\n\n        // Set the required consideration items.\n        consideration = _requiredConsideration(\n            mintDetails.feeRecipient,\n            feeBps,\n            totalQuantity,\n            currentPrice,\n            paymentToken\n        );\n\n        // Apply the state changes of the mint.\n        if (mintDetails.withEffects) {\n            // Emit an event for the mint, for analytics.\n            emit SeaDropMint(mintDetails.payer, dropStageIndex);\n        }\n    }\n\n    /**\n     * @dev Internal view function to derive the current price of a stage\n     *      based on the the starting price and ending price. If the start\n     *      and end prices differ, the current price will be interpolated on\n     *      a linear basis.\n     *\n     *      Since this function is only used for consideration items, it will\n     *      round up.\n     *\n     * @param startTime  The starting time of the stage.\n     * @param endTime    The end time of the stage.\n     * @param startPrice The starting price of the stage.\n     * @param endPrice   The ending price of the stage.\n     *\n     * @return price The current price.\n     */\n    function _currentPrice(\n        uint256 startTime,\n        uint256 endTime,\n        uint256 startPrice,\n        uint256 endPrice\n    ) internal view returns (uint256 price) {\n        // Check that the drop stage has started and not ended.\n        // This ensures that the startTime is not greater than the current\n        // block timestamp and endTime is greater than the current block\n        // timestamp. If this condition is not upheld `duration`, `elapsed`,\n        // and `remaining` variables will underflow.\n        _checkActive(startTime, endTime);\n\n        // Return the price if startPrice == endPrice.\n        if (startPrice == endPrice) {\n            return endPrice;\n        }\n\n        // Declare variables to derive in the subsequent unchecked scope.\n        uint256 duration;\n        uint256 elapsed;\n        uint256 remaining;\n\n        // Skip underflow checks as startTime <= block.timestamp < endTime.\n        unchecked {\n            // Derive the duration for the stage and place it on the stack.\n            duration = endTime - startTime;\n\n            // Derive time elapsed since the stage started & place on stack.\n            elapsed = block.timestamp - startTime;\n\n            // Derive time remaining until stage expires and place on stack.\n            remaining = duration - elapsed;\n        }\n\n        // Aggregate new amounts weighted by time with rounding factor.\n        uint256 totalBeforeDivision = ((startPrice * remaining) +\n            (endPrice * elapsed));\n\n        // Use assembly to combine operations and skip divide-by-zero check.\n        assembly {\n            // Multiply by iszero(iszero(totalBeforeDivision)) to ensure\n            // amount is set to zero if totalBeforeDivision is zero,\n            // as intermediate overflow can occur if it is zero.\n            price := mul(\n                iszero(iszero(totalBeforeDivision)),\n                // Subtract 1 from the numerator and add 1 to the result\n                // to get the proper rounding direction to round up.\n                // Division is performed with no zero check as duration\n                // cannot be zero as long as startTime < endTime.\n                add(div(sub(totalBeforeDivision, 1), duration), 1)\n            )\n        }\n    }\n\n    /**\n     * @notice Check that the token ids are within the stage range.\n     *\n     * @param tokenIds    The token ids.\n     * @param fromTokenId The drop stage start token id\n     * @param toTokenId   The drop stage end token id.\n     */\n    function _checkTokenIds(\n        uint256[] memory tokenIds,\n        uint256 fromTokenId,\n        uint256 toTokenId\n    ) internal pure {\n        uint256 tokenIdsLength = tokenIds.length;\n        for (uint256 i = 0; i < tokenIdsLength; ) {\n            if (\n                _cast(tokenIds[i] < fromTokenId) |\n                    _cast(tokenIds[i] > toTokenId) ==\n                1\n            ) {\n                // Revert if the token id is not within range.\n                revert TokenIdNotWithinDropStageRange(\n                    tokenIds[i],\n                    fromTokenId,\n                    toTokenId\n                );\n            }\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    /**\n     * @notice Check that the drop stage is active.\n     *\n     * @param startTime The drop stage start time.\n     * @param endTime   The drop stage end time.\n     */\n    function _checkActive(uint256 startTime, uint256 endTime) internal view {\n        // Define a variable if the drop stage is inactive.\n        bool inactive;\n\n        // Using the same check for time boundary from Seaport.\n        // startTime <= block.timestamp < endTime\n        assembly {\n            inactive := or(\n                iszero(gt(endTime, timestamp())),\n                gt(startTime, timestamp())\n            )\n        }\n\n        // Revert if the drop stage is not active.\n        if (inactive) {\n            revert NotActive(block.timestamp, startTime, endTime);\n        }\n    }\n\n    /**\n     * @notice Check that the fee recipient is allowed.\n     *\n     * @param feeRecipient          The fee recipient.\n     * @param restrictFeeRecipients If the fee recipients are restricted.\n     */\n    function _checkFeeRecipientIsAllowed(\n        address feeRecipient,\n        bool restrictFeeRecipients\n    ) internal view {\n        // Ensure the fee recipient is not the zero address.\n        if (feeRecipient == address(0)) {\n            revert FeeRecipientCannotBeZeroAddress();\n        }\n\n        // Revert if the fee recipient is restricted and not allowed.\n        if (restrictFeeRecipients)\n            if (\n                !ERC1155SeaDropContractOffererStorage\n                    .layout()\n                    ._allowedFeeRecipients[feeRecipient]\n            ) {\n                revert FeeRecipientNotAllowed(feeRecipient);\n            }\n    }\n\n    /**\n     * @notice Check that the payer is allowed when not the minter.\n     *\n     * @param payer The payer.\n     * @param minter The minter.\n     */\n    function _checkPayerIsAllowed(address payer, address minter) internal view {\n        if (\n            // Note: not using _cast pattern here to short-circuit\n            // and skip loading the allowed payers or delegation registry.\n            payer != minter &&\n            !ERC1155SeaDropContractOffererStorage.layout()._allowedPayers[\n                payer\n            ] &&\n            !DELEGATION_REGISTRY.checkDelegateForAll(payer, minter)\n        ) {\n            revert PayerNotAllowed(payer);\n        }\n    }\n\n    /**\n     * @notice Check that the wallet is allowed to mint the desired quantities.\n     *\n     * @param tokenIds                 The token ids.\n     * @param quantities               The number of tokens to mint per token id.\n     * @param minter                   The mint recipient.\n     * @param maxTotalMintableByWallet The max allowed mints per wallet.\n     * @param maxTotalMintableByWalletPerToken The max allowed mints per wallet per token.\n     * @param maxTokenSupplyForStage   The max token supply for the drop stage.\n     */\n    function _checkMintQuantities(\n        uint256[] memory tokenIds,\n        uint256[] memory quantities,\n        address minter,\n        uint256 maxTotalMintableByWallet,\n        uint256 maxTotalMintableByWalletPerToken,\n        uint256 maxTokenSupplyForStage\n    ) internal view returns (uint256 totalQuantity) {\n        // Put the token ids length on the stack.\n        uint256 tokenIdsLength = tokenIds.length;\n\n        // Define an array of seenTokenIds to ensure there are no duplicates.\n        uint256[] memory seenTokenIds = new uint256[](tokenIdsLength);\n        uint256 seenTokenIdsCurrentLength;\n\n        for (uint256 i = 0; i < tokenIdsLength; ) {\n            // Put the tokenId and quantity on the stack.\n            uint256 tokenId = tokenIds[i];\n            uint256 quantity = quantities[i];\n\n            // Revert if the offer contains duplicate token ids.\n            for (uint256 j = 0; j < seenTokenIdsCurrentLength; ) {\n                if (tokenId == seenTokenIds[j]) {\n                    revert OfferContainsDuplicateTokenId(tokenId);\n                }\n                unchecked {\n                    ++j;\n                }\n            }\n\n            // Add to seen token ids.\n            seenTokenIds[i] = tokenId;\n            seenTokenIdsCurrentLength += 1;\n\n            // Add to total mint quantity.\n            totalQuantity += quantity;\n\n            // Check the mint quantities.\n            _checkMintQuantity(\n                tokenId,\n                quantity,\n                // Only check totalQuantity on the last iteration.\n                i == tokenIdsLength - 1 ? totalQuantity : 0,\n                minter,\n                maxTotalMintableByWallet,\n                maxTotalMintableByWalletPerToken,\n                maxTokenSupplyForStage\n            );\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    /**\n     * @notice Check that the wallet is allowed to mint the desired quantity.\n     *\n     * @param tokenId                  The token id.\n     * @param quantity                 The number of tokens to mint.\n     * @param totalQuantity            When provided as a nonzero value ensures\n     *                                 doesn't exceed maxTotalMintableByWallet.\n     * @param minter                   The mint recipient.\n     * @param maxTotalMintableByWallet The max allowed mints per wallet.\n     * @param maxTotalMintableByWalletPerToken The max allowed mints per wallet per token.\n     * @param maxTokenSupplyForStage   The max token supply for the drop stage.\n     */\n    function _checkMintQuantity(\n        uint256 tokenId,\n        uint256 quantity,\n        uint256 totalQuantity,\n        address minter,\n        uint256 maxTotalMintableByWallet,\n        uint256 maxTotalMintableByWalletPerToken,\n        uint256 maxTokenSupplyForStage\n    ) internal view {\n        // Get the mint stats from the token contract.\n        (\n            uint256 minterNumMinted,\n            uint256 minterNumMintedForTokenId,\n            uint256 totalMintedForTokenId,\n            uint256 maxSupply\n        ) = IERC1155SeaDrop(address(this)).getMintStats(minter, tokenId);\n\n        // Ensure mint quantity doesn't exceed maxTotalMintableByWalletPerToken.\n        if (\n            quantity + minterNumMintedForTokenId >\n            maxTotalMintableByWalletPerToken\n        ) {\n            revert MintQuantityExceedsMaxMintedPerWalletForTokenId(\n                tokenId,\n                quantity + minterNumMinted,\n                maxTotalMintableByWalletPerToken\n            );\n        }\n\n        // Ensure mint quantity doesn't exceed maxSupply.\n        if (quantity + totalMintedForTokenId > maxSupply) {\n            revert MintQuantityExceedsMaxSupply(\n                quantity + totalMintedForTokenId,\n                maxSupply\n            );\n        }\n\n        // Ensure mint quantity doesn't exceed maxTokenSupplyForStage.\n        if (quantity + totalMintedForTokenId > maxTokenSupplyForStage) {\n            revert MintQuantityExceedsMaxTokenSupplyForStage(\n                quantity + totalMintedForTokenId,\n                maxTokenSupplyForStage\n            );\n        }\n\n        // If totalQuantity is provided, ensure it doesn't exceed maxTotalMintableByWallet.\n        if (totalQuantity != 0) {\n            // Ensure total mint quantity doesn't exceed maxTotalMintableByWallet.\n            if (totalQuantity + minterNumMinted > maxTotalMintableByWallet) {\n                revert MintQuantityExceedsMaxMintedPerWallet(\n                    totalQuantity + minterNumMinted,\n                    maxTotalMintableByWallet\n                );\n            }\n        } else {\n            // Otherwise, just check the quantity.\n            // Ensure mint quantity doesn't exceed maxTotalMintableByWallet.\n            if (quantity + minterNumMinted > maxTotalMintableByWallet) {\n                revert MintQuantityExceedsMaxMintedPerWallet(\n                    quantity + minterNumMinted,\n                    maxTotalMintableByWallet\n                );\n            }\n        }\n    }\n\n    /**\n     * @notice Derive the required consideration items for the mint,\n     *         includes the fee recipient and creator payouts.\n     *\n     * @param feeRecipient The fee recipient.\n     * @param feeBps       The fee basis points.\n     * @param quantity     The total number of tokens to mint.\n     * @param currentPrice The current price of each token.\n     * @param paymentToken The payment token.\n     */\n    function _requiredConsideration(\n        address feeRecipient,\n        uint256 feeBps,\n        uint256 quantity,\n        uint256 currentPrice,\n        address paymentToken\n    ) internal view returns (ReceivedItem[] memory receivedItems) {\n        // If the mint price is zero, return early as there\n        // are no required consideration items.\n        if (currentPrice == 0) {\n            return new ReceivedItem[](0);\n        }\n\n        // Revert if the fee basis points are greater than 10_000.\n        if (feeBps > 10_000) {\n            revert InvalidFeeBps(feeBps);\n        }\n\n        // Set the itemType.\n        ItemType itemType = paymentToken == address(0)\n            ? ItemType.NATIVE\n            : ItemType.ERC20;\n\n        // Put the total mint price on the stack.\n        uint256 totalPrice = quantity * currentPrice;\n\n        // Get the fee amount.\n        // Note that the fee amount is rounded down in favor of the creator.\n        uint256 feeAmount = (totalPrice * feeBps) / 10_000;\n\n        // Get the creator payout amount.\n        // Fee amount is <= totalPrice per above.\n        uint256 payoutAmount;\n        unchecked {\n            payoutAmount = totalPrice - feeAmount;\n        }\n\n        // Put the creator payouts on the stack.\n        CreatorPayout[]\n            storage creatorPayouts = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._creatorPayouts;\n\n        // Put the length of total creator payouts on the stack.\n        uint256 creatorPayoutsLength = creatorPayouts.length;\n\n        // Revert if the creator payouts are not set.\n        if (creatorPayoutsLength == 0) {\n            revert CreatorPayoutsNotSet();\n        }\n\n        // Put the start index including the fee on the stack.\n        uint256 startIndexWithFee = feeAmount != 0 ? 1 : 0;\n\n        // Initialize the returned array with the correct length.\n        receivedItems = new ReceivedItem[](\n            startIndexWithFee + (payoutAmount != 0 ? creatorPayoutsLength : 0)\n        );\n\n        // Add a consideration item for the fee recipient.\n        if (feeAmount != 0) {\n            receivedItems[0] = ReceivedItem({\n                itemType: itemType,\n                token: paymentToken,\n                identifier: uint256(0),\n                amount: feeAmount,\n                recipient: payable(feeRecipient)\n            });\n        }\n\n        // Add a consideration item for each creator payout.\n        if (payoutAmount != 0) {\n            for (uint256 i = 0; i < creatorPayoutsLength; ) {\n                // Put the creator payout on the stack.\n                CreatorPayout memory creatorPayout = creatorPayouts[i];\n\n                // Get the creator payout amount.\n                // Note that the payout amount is rounded down.\n                uint256 creatorPayoutAmount = (payoutAmount *\n                    creatorPayout.basisPoints) / 10_000;\n\n                receivedItems[startIndexWithFee + i] = ReceivedItem({\n                    itemType: itemType,\n                    token: paymentToken,\n                    identifier: uint256(0),\n                    amount: creatorPayoutAmount,\n                    recipient: payable(creatorPayout.payoutAddress)\n                });\n\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Internal view function to derive the EIP-712 domain separator.\n     *\n     * @return The derived domain separator.\n     */\n    function _deriveDomainSeparator() internal view returns (bytes32) {\n        // prettier-ignore\n        return keccak256(\n            abi.encode(\n                _EIP_712_DOMAIN_TYPEHASH,\n                _NAME_HASH,\n                _VERSION_HASH,\n                block.chainid,\n                address(this)\n            )\n        );\n    }\n\n    /**\n     * @notice Implementation function to update the allowed Seaport contracts.\n     *\n     *         Do not use this method directly.\n     *\n     * @param allowedSeaport The allowed Seaport addresses.\n     */\n    function updateAllowedSeaport(address[] calldata allowedSeaport) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Put the lengths on the stack for more efficient access.\n        uint256 allowedSeaportLength = allowedSeaport.length;\n        uint256 enumeratedAllowedSeaportLength = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._enumeratedAllowedSeaport\n                .length;\n\n        // Reset the old mapping.\n        for (uint256 i = 0; i < enumeratedAllowedSeaportLength; ) {\n            ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n                ERC1155SeaDropContractOffererStorage\n                    .layout()\n                    ._enumeratedAllowedSeaport[i]\n            ] = false;\n            unchecked {\n                ++i;\n            }\n        }\n\n        // Set the new mapping for allowed Seaport contracts.\n        for (uint256 i = 0; i < allowedSeaportLength; ) {\n            // Ensure the allowed Seaport address is not the zero address.\n            if (allowedSeaport[i] == address(0)) {\n                revert AllowedSeaportCannotBeZeroAddress();\n            }\n\n            ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n                allowedSeaport[i]\n            ] = true;\n            unchecked {\n                ++i;\n            }\n        }\n\n        // Set the enumeration.\n        ERC1155SeaDropContractOffererStorage\n            .layout()\n            ._enumeratedAllowedSeaport = allowedSeaport;\n\n        // Emit an event for the update.\n        emit AllowedSeaportUpdated(allowedSeaport);\n    }\n\n    /**\n     * @notice Updates the creator payouts and emits an event.\n     *         The basis points must add up to 10_000 exactly.\n     *\n     * @param creatorPayouts The creator payout address and basis points.\n     */\n    function updateCreatorPayouts(\n        CreatorPayout[] calldata creatorPayouts\n    ) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        // Reset the creator payout array.\n        delete ERC1155SeaDropContractOffererStorage.layout()._creatorPayouts;\n\n        // Track the total basis points.\n        uint256 totalBasisPoints;\n\n        // Put the total creator payouts length on the stack.\n        uint256 creatorPayoutsLength = creatorPayouts.length;\n\n        // Revert if no creator payouts were provided.\n        if (creatorPayoutsLength == 0) {\n            revert CreatorPayoutsNotSet();\n        }\n\n        for (uint256 i; i < creatorPayoutsLength; ) {\n            // Get the creator payout.\n            CreatorPayout memory creatorPayout = creatorPayouts[i];\n\n            // Ensure the creator payout address is not the zero address.\n            if (creatorPayout.payoutAddress == address(0)) {\n                revert CreatorPayoutAddressCannotBeZeroAddress();\n            }\n\n            // Ensure the basis points are not zero.\n            if (creatorPayout.basisPoints == 0) {\n                revert CreatorPayoutBasisPointsCannotBeZero();\n            }\n\n            // Add to the total basis points.\n            totalBasisPoints += creatorPayout.basisPoints;\n\n            // Push to storage.\n            ERC1155SeaDropContractOffererStorage.layout()._creatorPayouts.push(\n                creatorPayout\n            );\n\n            unchecked {\n                ++i;\n            }\n        }\n\n        // Ensure the total basis points equals 10_000 exactly.\n        if (totalBasisPoints != 10_000) {\n            revert InvalidCreatorPayoutTotalBasisPoints(totalBasisPoints);\n        }\n\n        // Emit an event with the update.\n        emit CreatorPayoutsUpdated(creatorPayouts);\n    }\n\n    /**\n     * @notice Updates the allowed fee recipient and emits an event.\n     *\n     * @param feeRecipient The fee recipient.\n     * @param allowed      If the fee recipient is allowed.\n     */\n    function updateAllowedFeeRecipient(\n        address feeRecipient,\n        bool allowed\n    ) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        if (feeRecipient == address(0)) {\n            revert FeeRecipientCannotBeZeroAddress();\n        }\n\n        // Track the enumerated storage.\n        address[]\n            storage enumeratedStorage = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._enumeratedFeeRecipients;\n        mapping(address => bool)\n            storage feeRecipientsMap = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._allowedFeeRecipients;\n\n        if (allowed) {\n            if (feeRecipientsMap[feeRecipient]) {\n                revert DuplicateFeeRecipient();\n            }\n            feeRecipientsMap[feeRecipient] = true;\n            enumeratedStorage.push(feeRecipient);\n        } else {\n            if (!feeRecipientsMap[feeRecipient]) {\n                revert FeeRecipientNotPresent();\n            }\n            delete ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._allowedFeeRecipients[feeRecipient];\n            _asAddressArray(_removeFromEnumeration)(\n                feeRecipient,\n                enumeratedStorage\n            );\n        }\n\n        // Emit an event with the update.\n        emit AllowedFeeRecipientUpdated(feeRecipient, allowed);\n    }\n\n    /**\n     * @notice Updates the allowed server-side signer and emits an event.\n     *\n     * @param signer  The signer to update.\n     * @param allowed Whether the signer is allowed.\n     */\n    function updateSigner(address signer, bool allowed) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        if (signer == address(0)) {\n            revert SignerCannotBeZeroAddress();\n        }\n\n        // Track the enumerated storage.\n        address[]\n            storage enumeratedStorage = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._enumeratedSigners;\n        mapping(address => bool)\n            storage signersMap = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._allowedSigners;\n\n        if (allowed) {\n            if (signersMap[signer]) {\n                revert DuplicateSigner();\n            }\n            signersMap[signer] = true;\n            enumeratedStorage.push(signer);\n        } else {\n            if (!signersMap[signer]) {\n                revert SignerNotPresent();\n            }\n            delete ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._allowedSigners[signer];\n            _asAddressArray(_removeFromEnumeration)(signer, enumeratedStorage);\n        }\n\n        // Emit an event with the update.\n        emit SignerUpdated(signer, allowed);\n    }\n\n    /**\n     * @notice Updates the allowed payer and emits an event.\n     *\n     * @param payer   The payer to add or remove.\n     * @param allowed Whether to add or remove the payer.\n     */\n    function updatePayer(address payer, bool allowed) external {\n        // Ensure this contract is only called into with delegatecall.\n        _onlyDelegateCalled();\n\n        if (payer == address(0)) {\n            revert PayerCannotBeZeroAddress();\n        }\n\n        // Track the enumerated storage.\n        address[]\n            storage enumeratedStorage = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._enumeratedPayers;\n        mapping(address => bool)\n            storage payersMap = ERC1155SeaDropContractOffererStorage\n                .layout()\n                ._allowedPayers;\n\n        if (allowed) {\n            if (payersMap[payer]) {\n                revert DuplicatePayer();\n            }\n            payersMap[payer] = true;\n            enumeratedStorage.push(payer);\n        } else {\n            if (!payersMap[payer]) {\n                revert PayerNotPresent();\n            }\n            delete ERC1155SeaDropContractOffererStorage.layout()._allowedPayers[\n                payer\n            ];\n            _asAddressArray(_removeFromEnumeration)(payer, enumeratedStorage);\n        }\n\n        // Emit an event with the update.\n        emit PayerUpdated(payer, allowed);\n    }\n\n    /**\n     * @notice Verify an EIP-712 signature by recreating the data structure\n     *         that we signed on the client side, and then using that to recover\n     *         the address that signed the signature for this data.\n     *\n     * @param minter       The mint recipient.\n     * @param feeRecipient The fee recipient.\n     * @param mintParams   The mint params.\n     * @param salt         The salt for the signed mint.\n     */\n    function _getDigest(\n        address minter,\n        address feeRecipient,\n        MintParams memory mintParams,\n        uint256 salt\n    ) internal view returns (bytes32 digest) {\n        // Put mintParams back on the stack to avoid stack too deep.\n        MintParams memory mintParams_ = mintParams;\n\n        bytes32 mintParamsHashStruct = keccak256(\n            abi.encode(\n                _MINT_PARAMS_TYPEHASH,\n                mintParams_.startPrice,\n                mintParams_.endPrice,\n                mintParams_.startTime,\n                mintParams_.endTime,\n                mintParams_.paymentToken,\n                mintParams_.fromTokenId,\n                mintParams_.toTokenId,\n                mintParams_.maxTotalMintableByWallet,\n                mintParams_.maxTotalMintableByWalletPerToken,\n                mintParams_.maxTokenSupplyForStage,\n                mintParams_.dropStageIndex,\n                mintParams_.feeBps,\n                mintParams_.restrictFeeRecipients\n            )\n        );\n        digest = keccak256(\n            bytes.concat(\n                bytes2(0x1901),\n                _deriveDomainSeparator(),\n                keccak256(\n                    abi.encode(\n                        _SIGNED_MINT_TYPEHASH,\n                        minter,\n                        feeRecipient,\n                        mintParamsHashStruct,\n                        salt\n                    )\n                )\n            )\n        );\n    }\n\n    /**\n     * @notice Internal utility function to remove a uint256 from a supplied\n     *         enumeration.\n     *\n     * @param toRemove    The uint256 to remove.\n     * @param enumeration The enumerated uint256s to parse.\n     */\n    function _removeFromEnumeration(\n        uint256 toRemove,\n        uint256[] storage enumeration\n    ) internal {\n        // Cache the length.\n        uint256 enumerationLength = enumeration.length;\n        for (uint256 i = 0; i < enumerationLength; ) {\n            // Check if the enumerated element is the one we are deleting.\n            if (enumeration[i] == toRemove) {\n                // Swap with the last element.\n                enumeration[i] = enumeration[enumerationLength - 1];\n                // Delete the (now duplicated) last element.\n                enumeration.pop();\n                // Exit the loop.\n                break;\n            }\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    /**\n     * @notice Internal utility function to cast uint types to address\n     *         to dedupe the need for multiple implementations of\n     *         `_removeFromEnumeration`.\n     *\n     * @param fnIn The fn with uint input.\n     *\n     * @return fnOut The fn with address input.\n     */\n    function _asAddressArray(\n        function(uint256, uint256[] storage) internal fnIn\n    )\n        internal\n        pure\n        returns (function(address, address[] storage) internal fnOut)\n    {\n        assembly {\n            fnOut := fnIn\n        }\n    }\n\n    /**\n     * @dev Returns whether `leaf` exists in the Merkle tree with `root`,\n     *      given `proof`.\n     *\n     *      Original function from solady called `verifyCalldata`, modified\n     *      to use an offset from the context calldata to avoid expanding\n     *      memory.\n     */\n    function _verifyProof(\n        bytes calldata context,\n        uint256 proofOffsetInContext,\n        bytes32 root,\n        bytes32 leaf\n    ) internal pure returns (bool isValid) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if sub(context.length, proofOffsetInContext) {\n                // Initialize `offset` to the offset of `proof` in the calldata.\n                let offset := add(context.offset, proofOffsetInContext)\n                let end := add(\n                    offset,\n                    sub(context.length, proofOffsetInContext)\n                )\n                // Iterate over proof elements to compute root hash.\n                // prettier-ignore\n                for {} 1 {} {\n                    // Slot of `leaf` in scratch space.\n                    // If the condition is true: 0x20, otherwise: 0x00.\n                    let scratch := shl(5, gt(leaf, calldataload(offset)))\n                    // Store elements to hash contiguously in scratch space.\n                    // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.\n                    mstore(scratch, leaf)\n                    mstore(xor(scratch, 0x20), calldataload(offset))\n                    // Reuse `leaf` to store the hash to reduce stack operations.\n                    leaf := keccak256(0x00, 0x40)\n                    offset := add(offset, 0x20)\n                    if iszero(lt(offset, end)) {\n                        break\n                    }\n                }\n            }\n            isValid := eq(leaf, root)\n        }\n    }\n\n    /**\n     * @dev Internal view function to revert if this implementation contract is\n     *      called without delegatecall.\n     */\n    function _onlyDelegateCalled() internal view {\n        if (address(this) == _originalImplementation) {\n            revert OnlyDelegateCalled();\n        }\n    }\n\n    /**\n     * @dev Internal pure function to revert with a provided reason.\n     *      If no reason is provided, reverts with no message.\n     */\n    function _revertWithReason(bytes memory data) internal pure {\n        // Bubble up the revert reason.\n        assembly {\n            revert(add(32, data), mload(data))\n        }\n    }\n\n    /**\n     * @dev Internal pure function to cast a `bool` value to a `uint256` value,\n     *      then invert to match Unix style where 0 signifies success.\n     *\n     * @param b The `bool` value to cast.\n     *\n     * @return u The `uint256` value.\n     */\n    function _castAndInvert(bool b) internal pure returns (uint256 u) {\n        assembly {\n            u := iszero(b)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to cast a `bool` value to a `uint256` value.\n     *\n     * @param b The `bool` value to cast.\n     *\n     * @return u The `uint256` value.\n     */\n    function _cast(bool b) internal pure returns (uint256 u) {\n        assembly {\n            u := b\n        }\n    }\n}\n"
      },
      "src/lib/ERC1155SeaDropStructs.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\n/**\n * @notice A struct defining public drop data.\n *         Designed to fit efficiently in two storage slots.\n *\n * @param startPrice               The start price per token. (Up to 1.2m\n *                                 of native token, e.g. ETH, MATIC)\n * @param endPrice                 The end price per token. If this differs\n *                                 from startPrice, the current price will\n *                                 be calculated based on the current time.\n * @param startTime                The start time, ensure this is not zero.\n * @param endTime                  The end time, ensure this is not zero.\n * @param restrictFeeRecipients    If false, allow any fee recipient;\n *                                 if true, check fee recipient is allowed.\n * @param paymentToken             The payment token address. Null for\n *                                 native token.\n * @param fromTokenId              The start token id for the stage.\n * @param toTokenId                The end token id for the stage.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n *                                 allowed. (The limit for this field is\n *                                 2^16 - 1)\n * @param maxTotalMintableByWalletPerToken Maximum total number of mints a user\n *                                 is allowed for the token id. (The limit for\n *                                 this field is 2^16 - 1)\n * @param feeBps                   Fee out of 10_000 basis points to be\n *                                 collected.\n */\nstruct PublicDrop {\n    // slot 1\n    uint80 startPrice; // 80/512 bits\n    uint80 endPrice; // 160/512 bits\n    uint40 startTime; // 200/512 bits\n    uint40 endTime; // 240/512 bits\n    bool restrictFeeRecipients; // 248/512 bits\n    // uint8 unused;\n\n    // slot 2\n    address paymentToken; // 408/512 bits\n    uint24 fromTokenId; // 432/512 bits\n    uint24 toTokenId; // 456/512 bits\n    uint16 maxTotalMintableByWallet; // 472/512 bits\n    uint16 maxTotalMintableByWalletPerToken; // 488/512 bits\n    uint16 feeBps; // 504/512 bits\n}\n\n/**\n * @notice A struct defining mint params for an allow list.\n *         An allow list leaf will be composed of `msg.sender` and\n *         the following params.\n *\n *         Note: Since feeBps is encoded in the leaf, backend should ensure\n *         that feeBps is acceptable before generating a proof.\n *\n * @param startPrice               The start price per token. (Up to 1.2m\n *                                 of native token, e.g. ETH, MATIC)\n * @param endPrice                 The end price per token. If this differs\n *                                 from startPrice, the current price will\n *                                 be calculated based on the current time.\n * @param startTime                The start time, ensure this is not zero.\n * @param endTime                  The end time, ensure this is not zero.\n * @param paymentToken             The payment token for the mint. Null for\n *                                 native token.\n * @param fromTokenId              The start token id for the stage.\n * @param toTokenId                The end token id for the stage.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n *                                 allowed.\n * @param maxTotalMintableByWalletPerToken Maximum total number of mints a user\n *                                 is allowed for the token id.\n * @param maxTokenSupplyForStage   The limit of token supply this stage can\n *                                 mint within.\n * @param dropStageIndex           The drop stage index to emit with the event\n *                                 for analytical purposes. This should be\n *                                 non-zero since the public mint emits with\n *                                 index zero.\n * @param feeBps                   Fee out of 10_000 basis points to be\n *                                 collected.\n * @param restrictFeeRecipients    If false, allow any fee recipient;\n *                                 if true, check fee recipient is allowed.\n */\nstruct MintParams {\n    uint256 startPrice;\n    uint256 endPrice;\n    uint256 startTime;\n    uint256 endTime;\n    address paymentToken;\n    uint256 fromTokenId;\n    uint256 toTokenId;\n    uint256 maxTotalMintableByWallet;\n    uint256 maxTotalMintableByWalletPerToken;\n    uint256 maxTokenSupplyForStage;\n    uint256 dropStageIndex; // non-zero\n    uint256 feeBps;\n    bool restrictFeeRecipients;\n}\n\n/**\n * @dev Struct containing internal SeaDrop implementation logic\n *      mint details to avoid stack too deep.\n *\n * @param feeRecipient The fee recipient.\n * @param payer        The payer of the mint.\n * @param minter       The mint recipient.\n * @param tokenIds     The tokenIds to mint.\n * @param quantities   The number of tokens to mint per tokenId.\n * @param withEffects  Whether to apply state changes of the mint.\n */\nstruct MintDetails {\n    address feeRecipient;\n    address payer;\n    address minter;\n    uint256[] tokenIds;\n    uint256[] quantities;\n    bool withEffects;\n}\n\n/**\n * @notice A struct to configure multiple contract options in one transaction.\n */\nstruct MultiConfigureStruct {\n    uint256[] maxSupplyTokenIds;\n    uint256[] maxSupplyAmounts;\n    string baseURI;\n    string contractURI;\n    PublicDrop[] publicDrops;\n    uint256[] publicDropsIndexes;\n    string dropURI;\n    AllowListData allowListData;\n    CreatorPayout[] creatorPayouts;\n    bytes32 provenanceHash;\n    address[] allowedFeeRecipients;\n    address[] disallowedFeeRecipients;\n    address[] allowedPayers;\n    address[] disallowedPayers;\n    // Server-signed\n    address[] allowedSigners;\n    address[] disallowedSigners;\n    // ERC-2981\n    address royaltyReceiver;\n    uint96 royaltyBps;\n    // Mint\n    address mintRecipient;\n    uint256[] mintTokenIds;\n    uint256[] mintAmounts;\n}\n"
      },
      "src/lib/SeaDropStructs.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/**\n * @notice A struct defining a creator payout address and basis points.\n *\n * @param payoutAddress The payout address.\n * @param basisPoints   The basis points to pay out to the creator.\n *                      The total creator payouts must equal 10_000 bps.\n */\nstruct CreatorPayout {\n    address payoutAddress;\n    uint16 basisPoints;\n}\n\n/**\n * @notice A struct defining allow list data (for minting an allow list).\n *\n * @param merkleRoot    The merkle root for the allow list.\n * @param publicKeyURIs If the allowListURI is encrypted, a list of URIs\n *                      pointing to the public keys. Empty if unencrypted.\n * @param allowListURI  The URI for the allow list.\n */\nstruct AllowListData {\n    bytes32 merkleRoot;\n    string[] publicKeyURIs;\n    string allowListURI;\n}\n"
      },
      "src/interfaces/IERC1155ContractMetadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\ninterface IERC1155ContractMetadata is ISeaDropTokenContractMetadata {\n    /**\n     * @dev A struct representing the supply info for a token id,\n     *      packed into one storage slot.\n     *\n     * @param maxSupply   The max supply for the token id.\n     * @param totalSupply The total token supply for the token id.\n     *                    Subtracted when an item is burned.\n     * @param totalMinted The total number of tokens minted for the token id.\n     */\n    struct TokenSupply {\n        uint64 maxSupply; // 64/256 bits\n        uint64 totalSupply; // 128/256 bits\n        uint64 totalMinted; // 192/256 bits\n    }\n\n    /**\n     * @dev Emit an event when the max token supply for a token id is updated.\n     */\n    event MaxSupplyUpdated(uint256 tokenId, uint256 newMaxSupply);\n\n    /**\n     * @dev Revert with an error if the mint quantity exceeds the max token\n     *      supply.\n     */\n    error MintExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n    /**\n     * @notice Sets the max supply for a token id and emits an event.\n     *\n     * @param tokenId      The token id to set the max supply for.\n     * @param newMaxSupply The new max supply to set.\n     */\n    function setMaxSupply(uint256 tokenId, uint256 newMaxSupply) external;\n\n    /**\n     * @notice Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @notice Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @notice Returns the max token supply for a token id.\n     */\n    function maxSupply(uint256 tokenId) external view returns (uint256);\n\n    /**\n     * @notice Returns the total supply for a token id.\n     */\n    function totalSupply(uint256 tokenId) external view returns (uint256);\n\n    /**\n     * @notice Returns the total minted for a token id.\n     */\n    function totalMinted(uint256 tokenId) external view returns (uint256);\n}\n"
      },
      "src/interfaces/IERC1155SeaDrop.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { ISeaDropToken } from \"./ISeaDropToken.sol\";\n\nimport { PublicDrop } from \"../lib/ERC1155SeaDropStructs.sol\";\n\n/**\n * @dev A helper interface to get and set parameters for ERC1155SeaDrop.\n *      The token does not expose these methods as part of its external\n *      interface to optimize contract size, but does implement them.\n */\ninterface IERC1155SeaDrop is ISeaDropToken {\n    /**\n     * @notice Update the SeaDrop public drop parameters at a given index.\n     *\n     * @param publicDrop The new public drop parameters.\n     * @param index      The public drop index.\n     */\n    function updatePublicDrop(\n        PublicDrop calldata publicDrop,\n        uint256 index\n    ) external;\n\n    /**\n     * @notice Returns the public drop stage parameters at a given index.\n     *\n     * @param index The index of the public drop stage.\n     */\n    function getPublicDrop(\n        uint256 index\n    ) external view returns (PublicDrop memory);\n\n    /**\n     * @notice Returns the public drop indexes.\n     */\n    function getPublicDropIndexes() external view returns (uint256[] memory);\n\n    /**\n     * @notice Returns a set of mint stats for the address.\n     *         This assists SeaDrop in enforcing maxSupply,\n     *         maxTotalMintableByWallet, maxTotalMintableByWalletPerToken,\n     *         and maxTokenSupplyForStage checks.\n     *\n     * @dev    NOTE: Implementing contracts should always update these numbers\n     *         before transferring any tokens with _safeMint() to mitigate\n     *         consequences of malicious onERC1155Received() hooks.\n     *\n     * @param minter  The minter address.\n     * @param tokenId The token id to return stats for.\n     */\n    function getMintStats(\n        address minter,\n        uint256 tokenId\n    )\n        external\n        view\n        returns (\n            uint256 minterNumMinted,\n            uint256 minterNumMintedForTokenId,\n            uint256 totalMintedForTokenId,\n            uint256 maxSupply\n        );\n\n    /**\n     * @notice This function is only allowed to be called by the configurer\n     *         contract as a way to batch mints and configuration in one tx.\n     *\n     * @param recipient The address to receive the mints.\n     * @param tokenIds  The tokenIds to mint.\n     * @param amounts   The amounts to mint.\n     */\n    function multiConfigureMint(\n        address recipient,\n        uint256[] calldata tokenIds,\n        uint256[] calldata amounts\n    ) external;\n}\n"
      },
      "src/interfaces/IERC173.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\ninterface IERC173 {\n    /// @notice Returns the address of the owner.\n    function owner() external view returns (address);\n}\n"
      },
      "src/interfaces/ISeaDropToken.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\nimport { AllowListData, CreatorPayout } from \"../lib/SeaDropStructs.sol\";\n\n/**\n * @dev A helper base interface for IERC721SeaDrop and IERC1155SeaDrop.\n *      The token does not expose these methods as part of its external\n *      interface to optimize contract size, but does implement them.\n */\ninterface ISeaDropToken is ISeaDropTokenContractMetadata {\n    /**\n     * @notice Update the SeaDrop allowed Seaport contracts privileged to mint.\n     *         Only the owner can use this function.\n     *\n     * @param allowedSeaport The allowed Seaport addresses.\n     */\n    function updateAllowedSeaport(address[] calldata allowedSeaport) external;\n\n    /**\n     * @notice Update the SeaDrop allowed fee recipient.\n     *         Only the owner can use this function.\n     *\n     * @param feeRecipient The new fee recipient.\n     * @param allowed      Whether the fee recipient is allowed.\n     */\n    function updateAllowedFeeRecipient(\n        address feeRecipient,\n        bool allowed\n    ) external;\n\n    /**\n     * @notice Update the SeaDrop creator payout addresses.\n     *         The total basis points must add up to exactly 10_000.\n     *         Only the owner can use this function.\n     *\n     * @param creatorPayouts The new creator payouts.\n     */\n    function updateCreatorPayouts(\n        CreatorPayout[] calldata creatorPayouts\n    ) external;\n\n    /**\n     * @notice Update the SeaDrop drop URI.\n     *         Only the owner can use this function.\n     *\n     * @param dropURI The new drop URI.\n     */\n    function updateDropURI(string calldata dropURI) external;\n\n    /**\n     * @notice Update the SeaDrop allow list data.\n     *         Only the owner can use this function.\n     *\n     * @param allowListData The new allow list data.\n     */\n    function updateAllowList(AllowListData calldata allowListData) external;\n\n    /**\n     * @notice Update the SeaDrop allowed payers.\n     *         Only the owner can use this function.\n     *\n     * @param payer   The payer to update.\n     * @param allowed Whether the payer is allowed.\n     */\n    function updatePayer(address payer, bool allowed) external;\n\n    /**\n     * @notice Update the SeaDrop allowed signer.\n     *         Only the owner can use this function.\n     *         An allowed signer can also disallow themselves.\n     *\n     * @param signer  The signer to update.\n     * @param allowed Whether the signer is allowed.\n     */\n    function updateSigner(address signer, bool allowed) external;\n\n    /**\n     * @notice Get the SeaDrop allowed Seaport contracts privileged to mint.\n     */\n    function getAllowedSeaport() external view returns (address[] memory);\n\n    /**\n     * @notice Returns the SeaDrop creator payouts.\n     */\n    function getCreatorPayouts() external view returns (CreatorPayout[] memory);\n\n    /**\n     * @notice Returns the SeaDrop allow list merkle root.\n     */\n    function getAllowListMerkleRoot() external view returns (bytes32);\n\n    /**\n     * @notice Returns the SeaDrop allowed fee recipients.\n     */\n    function getAllowedFeeRecipients() external view returns (address[] memory);\n\n    /**\n     * @notice Returns the SeaDrop allowed signers.\n     */\n    function getSigners() external view returns (address[] memory);\n\n    /**\n     * @notice Returns if the signed digest has been used.\n     *\n     * @param digest The digest hash.\n     */\n    function getDigestIsUsed(bytes32 digest) external view returns (bool);\n\n    /**\n     * @notice Returns the SeaDrop allowed payers.\n     */\n    function getPayers() external view returns (address[] memory);\n\n    /**\n     * @notice Returns the configurer contract.\n     */\n    function configurer() external view returns (address);\n}\n"
      },
      "src/clones/ERC1155ContractMetadataCloneable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n    IERC1155ContractMetadata\n} from \"../interfaces/IERC1155ContractMetadata.sol\";\n\nimport {\n    ERC1155ConduitPreapproved\n} from \"../lib/ERC1155ConduitPreapproved.sol\";\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\nimport { ERC2981 } from \"solady/src/tokens/ERC2981.sol\";\n\nimport { Ownable } from \"solady/src/auth/Ownable.sol\";\n\nimport {\n    Initializable\n} from \"@openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @title  ERC1155ContractMetadataCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A cloneable token contract that extends ERC-1155\n *         with additional metadata and ownership capabilities.\n */\ncontract ERC1155ContractMetadataCloneable is\n    ERC1155ConduitPreapproved,\n    ERC2981,\n    Ownable,\n    IERC1155ContractMetadata,\n    Initializable\n{\n    /// @notice A struct containing the token supply info per token id.\n    mapping(uint256 => TokenSupply) _tokenSupply;\n\n    /// @notice The total number of tokens minted by address.\n    mapping(address => uint256) _totalMintedByUser;\n\n    /// @notice The total number of tokens minted per token id by address.\n    mapping(address => mapping(uint256 => uint256)) _totalMintedByUserPerToken;\n\n    /// @notice The name of the token.\n    string internal _name;\n\n    /// @notice The symbol of the token.\n    string internal _symbol;\n\n    /// @notice The base URI for token metadata.\n    string internal _baseURI;\n\n    /// @notice The contract URI for contract metadata.\n    string internal _contractURI;\n\n    /// @notice The provenance hash for guaranteeing metadata order\n    ///         for random reveals.\n    bytes32 internal _provenanceHash;\n\n    /// @notice The allowed contract that can configure SeaDrop parameters.\n    address internal _CONFIGURER;\n\n    /**\n     * @dev Reverts if the sender is not the owner or the allowed\n     *      configurer contract.\n     *\n     *      This is used as a function instead of a modifier\n     *      to save contract space when used multiple times.\n     */\n    function _onlyOwnerOrConfigurer() internal view {\n        if (msg.sender != _CONFIGURER && msg.sender != owner()) {\n            revert Unauthorized();\n        }\n    }\n\n    /**\n     * @notice Deploy the token contract.\n     *\n     * @param allowedConfigurer The address of the contract allowed to\n     *                          configure parameters. Also contains SeaDrop\n     *                          implementation code.\n     * @param name_             The name of the token.\n     * @param symbol_           The symbol of the token.\n     */\n    function __ERC1155ContractMetadataCloneable_init(\n        address allowedConfigurer,\n        string memory name_,\n        string memory symbol_\n    ) internal onlyInitializing {\n        // Set the name of the token.\n        _name = name_;\n\n        // Set the symbol of the token.\n        _symbol = symbol_;\n\n        // Set the allowed configurer contract to interact with this contract.\n        _CONFIGURER = allowedConfigurer;\n    }\n\n    /**\n     * @notice Sets the base URI for the token metadata and emits an event.\n     *\n     * @param newBaseURI The new base URI to set.\n     */\n    function setBaseURI(string calldata newBaseURI) external override {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Set the new base URI.\n        _baseURI = newBaseURI;\n\n        // Emit an event with the update.\n        emit BatchMetadataUpdate(0, type(uint256).max);\n    }\n\n    /**\n     * @notice Sets the contract URI for contract metadata.\n     *\n     * @param newContractURI The new contract URI.\n     */\n    function setContractURI(string calldata newContractURI) external override {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Set the new contract URI.\n        _contractURI = newContractURI;\n\n        // Emit an event with the update.\n        emit ContractURIUpdated(newContractURI);\n    }\n\n    /**\n     * @notice Emit an event notifying metadata updates for\n     *         a range of token ids, according to EIP-4906.\n     *\n     * @param fromTokenId The start token id.\n     * @param toTokenId   The end token id.\n     */\n    function emitBatchMetadataUpdate(\n        uint256 fromTokenId,\n        uint256 toTokenId\n    ) external {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Emit an event with the update.\n        if (fromTokenId == toTokenId) {\n            // If only one token is being updated, use the event\n            // in the 1155 spec.\n            emit URI(uri(fromTokenId), fromTokenId);\n        } else {\n            emit BatchMetadataUpdate(fromTokenId, toTokenId);\n        }\n    }\n\n    /**\n     * @notice Sets the max token supply and emits an event.\n     *\n     * @param tokenId      The token id to set the max supply for.\n     * @param newMaxSupply The new max supply to set.\n     */\n    function setMaxSupply(uint256 tokenId, uint256 newMaxSupply) external {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Ensure the max supply does not exceed the maximum value of uint64,\n        // a limit due to the storage of bit-packed variables in TokenSupply,\n        if (newMaxSupply > 2 ** 64 - 1) {\n            revert CannotExceedMaxSupplyOfUint64(newMaxSupply);\n        }\n\n        // Set the new max supply.\n        _tokenSupply[tokenId].maxSupply = uint64(newMaxSupply);\n\n        // Emit an event with the update.\n        emit MaxSupplyUpdated(tokenId, newMaxSupply);\n    }\n\n    /**\n     * @notice Sets the provenance hash and emits an event.\n     *\n     *         The provenance hash is used for random reveals, which\n     *         is a hash of the ordered metadata to show it has not been\n     *         modified after mint started.\n     *\n     *         This function will revert if the provenance hash has already\n     *         been set, so be sure to carefully set it only once.\n     *\n     * @param newProvenanceHash The new provenance hash to set.\n     */\n    function setProvenanceHash(bytes32 newProvenanceHash) external {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Keep track of the old provenance hash for emitting with the event.\n        bytes32 oldProvenanceHash = _provenanceHash;\n\n        // Revert if the provenance hash has already been set.\n        if (oldProvenanceHash != bytes32(0)) {\n            revert ProvenanceHashCannotBeSetAfterAlreadyBeingSet();\n        }\n\n        // Set the new provenance hash.\n        _provenanceHash = newProvenanceHash;\n\n        // Emit an event with the update.\n        emit ProvenanceHashUpdated(oldProvenanceHash, newProvenanceHash);\n    }\n\n    /**\n     * @notice Sets the default royalty information.\n     *\n     * Requirements:\n     *\n     * - `receiver` cannot be the zero address.\n     * - `feeNumerator` cannot be greater than the fee denominator of 10_000 basis points.\n     */\n    function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {\n        // Ensure the sender is only the owner or configurer contract.\n        _onlyOwnerOrConfigurer();\n\n        // Set the default royalty.\n        // ERC2981 implementation ensures feeNumerator <= feeDenominator\n        // and receiver != address(0).\n        _setDefaultRoyalty(receiver, feeNumerator);\n\n        // Emit an event with the updated params.\n        emit RoyaltyInfoUpdated(receiver, feeNumerator);\n    }\n\n    /**\n     * @notice Returns the name of the token.\n     */\n    function name() external view returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @notice Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @notice Returns the base URI for token metadata.\n     */\n    function baseURI() external view override returns (string memory) {\n        return _baseURI;\n    }\n\n    /**\n     * @notice Returns the contract URI for contract metadata.\n     */\n    function contractURI() external view override returns (string memory) {\n        return _contractURI;\n    }\n\n    /**\n     * @notice Returns the max token supply for a token id.\n     */\n    function maxSupply(uint256 tokenId) external view returns (uint256) {\n        return _tokenSupply[tokenId].maxSupply;\n    }\n\n    /**\n     * @notice Returns the total supply for a token id.\n     */\n    function totalSupply(uint256 tokenId) external view returns (uint256) {\n        return _tokenSupply[tokenId].totalSupply;\n    }\n\n    /**\n     * @notice Returns the total minted for a token id.\n     */\n    function totalMinted(uint256 tokenId) external view returns (uint256) {\n        return _tokenSupply[tokenId].totalMinted;\n    }\n\n    /**\n     * @notice Returns the provenance hash.\n     *         The provenance hash is used for random reveals, which\n     *         is a hash of the ordered metadata to show it is unmodified\n     *         after mint has started.\n     */\n    function provenanceHash() external view override returns (bytes32) {\n        return _provenanceHash;\n    }\n\n    /**\n     * @notice Returns the URI for token metadata.\n     *\n     *         This implementation returns the same URI for *all* token types.\n     *         It relies on the token type ID substitution mechanism defined\n     *         in the EIP to replace {id} with the token id.\n     *\n     * @custom:param tokenId The token id to get the URI for.\n     */\n    function uri(\n        uint256 /* tokenId */\n    ) public view virtual override returns (string memory) {\n        // Return the base URI.\n        return _baseURI;\n    }\n\n    /**\n     * @notice Returns whether the interface is supported.\n     *\n     * @param interfaceId The interface id to check against.\n     */\n    function supportsInterface(\n        bytes4 interfaceId\n    ) public view virtual override(ERC1155, ERC2981) returns (bool) {\n        return\n            interfaceId == type(IERC1155ContractMetadata).interfaceId ||\n            interfaceId == 0x49064906 || // ERC-4906 (MetadataUpdate)\n            ERC2981.supportsInterface(interfaceId) ||\n            // ERC1155 returns supportsInterface true for\n            //     ERC165, ERC1155, ERC1155MetadataURI\n            ERC1155.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Adds to the internal counters for a mint.\n     *\n     * @param to     The address to mint to.\n     * @param id     The token id to mint.\n     * @param amount The quantity to mint.\n     * @param data   The data to pass if receiver is a contract.\n     */\n    function _mint(\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) internal virtual override {\n        // Increment mint counts.\n        _incrementMintCounts(to, id, amount);\n\n        ERC1155._mint(to, id, amount, data);\n    }\n\n    /**\n     * @dev Adds to the internal counters for a batch mint.\n     *\n     * @param to      The address to mint to.\n     * @param ids     The token ids to mint.\n     * @param amounts The quantities to mint.\n     * @param data    The data to pass if receiver is a contract.\n     */\n    function _batchMint(\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual override {\n        // Put ids length on the stack to save MLOADs.\n        uint256 idsLength = ids.length;\n\n        for (uint256 i = 0; i < idsLength; ) {\n            // Increment mint counts.\n            _incrementMintCounts(to, ids[i], amounts[i]);\n\n            unchecked {\n                ++i;\n            }\n        }\n\n        ERC1155._batchMint(to, ids, amounts, data);\n    }\n\n    /**\n     * @dev Subtracts from the internal counters for a burn.\n     *\n     * @param by     The address calling the burn.\n     * @param from   The address to burn from.\n     * @param id     The token id to burn.\n     * @param amount The amount to burn.\n     */\n    function _burn(\n        address by,\n        address from,\n        uint256 id,\n        uint256 amount\n    ) internal virtual override {\n        // Reduce the supply.\n        _reduceSupplyOnBurn(id, amount);\n\n        ERC1155._burn(by, from, id, amount);\n    }\n\n    /**\n     * @dev Subtracts from the internal counters for a batch burn.\n     *\n     * @param by      The address calling the burn.\n     * @param from    The address to burn from.\n     * @param ids     The token ids to burn.\n     * @param amounts The amounts to burn.\n     */\n    function _batchBurn(\n        address by,\n        address from,\n        uint256[] memory ids,\n        uint256[] memory amounts\n    ) internal virtual override {\n        // Put ids length on the stack to save MLOADs.\n        uint256 idsLength = ids.length;\n\n        for (uint256 i = 0; i < idsLength; ) {\n            // Reduce the supply.\n            _reduceSupplyOnBurn(ids[i], amounts[i]);\n\n            unchecked {\n                ++i;\n            }\n        }\n\n        ERC1155._batchBurn(by, from, ids, amounts);\n    }\n\n    function _reduceSupplyOnBurn(uint256 id, uint256 amount) internal {\n        // Get the current token supply.\n        TokenSupply storage tokenSupply = _tokenSupply[id];\n\n        // Reduce the totalSupply.\n        unchecked {\n            tokenSupply.totalSupply -= uint64(amount);\n        }\n    }\n\n    /**\n     * @dev Internal function to increment mint counts.\n     *\n     *      Note that this function does not check if the mint exceeds\n     *      maxSupply, which should be validated before this function is called.\n     *\n     * @param to     The address to mint to.\n     * @param id     The token id to mint.\n     * @param amount The quantity to mint.\n     */\n    function _incrementMintCounts(\n        address to,\n        uint256 id,\n        uint256 amount\n    ) internal {\n        // Get the current token supply.\n        TokenSupply storage tokenSupply = _tokenSupply[id];\n\n        if (tokenSupply.totalMinted + amount > tokenSupply.maxSupply) {\n            revert MintExceedsMaxSupply(\n                tokenSupply.totalMinted + amount,\n                tokenSupply.maxSupply\n            );\n        }\n\n        // Increment supply and number minted.\n        // Can be unchecked because maxSupply cannot be set to exceed uint64.\n        unchecked {\n            tokenSupply.totalSupply += uint64(amount);\n            tokenSupply.totalMinted += uint64(amount);\n\n            // Increment total minted by user.\n            _totalMintedByUser[to] += amount;\n\n            // Increment total minted by user per token.\n            _totalMintedByUserPerToken[to][id] += amount;\n        }\n    }\n}\n"
      },
      "src/lib/ERC1155SeaDropContractOffererStorage.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { PublicDrop } from \"./ERC1155SeaDropStructs.sol\";\n\nimport { CreatorPayout } from \"./SeaDropStructs.sol\";\n\nlibrary ERC1155SeaDropContractOffererStorage {\n    struct Layout {\n        /// @notice The allowed Seaport addresses that can mint.\n        mapping(address => bool) _allowedSeaport;\n        /// @notice The enumerated allowed Seaport addresses.\n        address[] _enumeratedAllowedSeaport;\n        /// @notice The public drop data.\n        mapping(uint256 => PublicDrop) _publicDrops;\n        /// @notice The enumerated public drop indexes.\n        uint256[] _enumeratedPublicDropIndexes;\n        /// @notice The creator payout addresses and basis points.\n        CreatorPayout[] _creatorPayouts;\n        /// @notice The allow list merkle root.\n        bytes32 _allowListMerkleRoot;\n        /// @notice The allowed fee recipients.\n        mapping(address => bool) _allowedFeeRecipients;\n        /// @notice The enumerated allowed fee recipients.\n        address[] _enumeratedFeeRecipients;\n        /// @notice The allowed server-side signers.\n        mapping(address => bool) _allowedSigners;\n        /// @notice The enumerated allowed signers.\n        address[] _enumeratedSigners;\n        /// @notice The used signature digests.\n        mapping(bytes32 => bool) _usedDigests;\n        /// @notice The allowed payers.\n        mapping(address => bool) _allowedPayers;\n        /// @notice The enumerated allowed payers.\n        address[] _enumeratedPayers;\n    }\n\n    bytes32 internal constant STORAGE_SLOT =\n        bytes32(\n            uint256(\n                keccak256(\"contracts.storage.ERC1155SeaDropContractOfferer\")\n            ) - 1\n        );\n\n    function layout() internal pure returns (Layout storage l) {\n        bytes32 slot = STORAGE_SLOT;\n        assembly {\n            l.slot := slot\n        }\n    }\n}\n"
      },
      "src/lib/ERC1155SeaDropErrorsAndEvents.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { PublicDrop } from \"./ERC1155SeaDropStructs.sol\";\n\nimport { SeaDropErrorsAndEvents } from \"./SeaDropErrorsAndEvents.sol\";\n\ninterface ERC1155SeaDropErrorsAndEvents is SeaDropErrorsAndEvents {\n    /**\n     * @dev Revert with an error if an empty PublicDrop is provided\n     *      for an already-empty public drop.\n     */\n    error PublicDropStageNotPresent();\n\n    /**\n     * @dev Revert with an error if the mint quantity exceeds the\n     *      max minted per wallet for a certain token id.\n     */\n    error MintQuantityExceedsMaxMintedPerWalletForTokenId(\n        uint256 tokenId,\n        uint256 total,\n        uint256 allowed\n    );\n\n    /**\n     * @dev Revert with an error if the target token id to mint is not within\n     *      the drop stage range.\n     */\n    error TokenIdNotWithinDropStageRange(\n        uint256 tokenId,\n        uint256 startTokenId,\n        uint256 endTokenId\n    );\n\n    /**\n     *  @notice Revert with an error if the number of maxSupplyAmounts doesn't\n     *          match the number of maxSupplyTokenIds.\n     */\n    error MaxSupplyMismatch();\n\n    /**\n     *  @notice Revert with an error if the number of mint tokenIds doesn't\n     *          match the number of mint amounts.\n     */\n    error MintAmountsMismatch();\n\n    /**\n     * @notice Revert with an error if the mint order offer contains\n     *         a duplicate tokenId.\n     */\n    error OfferContainsDuplicateTokenId(uint256 tokenId);\n\n    /**\n     * @dev Revert if the fromTokenId is greater than the toTokenId.\n     */\n    error InvalidFromAndToTokenId(uint256 fromTokenId, uint256 toTokenId);\n\n    /**\n     *  @notice Revert with an error if the number of publicDropIndexes doesn't\n     *          match the number of publicDrops.\n     */\n    error PublicDropsMismatch();\n\n    /**\n     * @dev An event with updated public drop data.\n     */\n    event PublicDropUpdated(PublicDrop publicDrop, uint256 index);\n}\n"
      },
      "src/lib/ERC1155ConduitPreapproved.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\n/**\n * @title  ERC1155ConduitPreapproved\n * @notice Solady's ERC1155 with the OpenSea conduit preapproved.\n */\nabstract contract ERC1155ConduitPreapproved is ERC1155 {\n    /// @dev The canonical OpenSea conduit.\n    address internal constant _CONDUIT =\n        0x1E0049783F008A0085193E00003D00cd54003c71;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes calldata data\n    ) public virtual override {\n        _safeTransfer(_by(), from, to, id, amount, data);\n    }\n\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] calldata ids,\n        uint256[] calldata amounts,\n        bytes calldata data\n    ) public virtual override {\n        _safeBatchTransfer(_by(), from, to, ids, amounts, data);\n    }\n\n    function isApprovedForAll(\n        address owner,\n        address operator\n    ) public view virtual override returns (bool) {\n        if (operator == _CONDUIT) return true;\n        return ERC1155.isApprovedForAll(owner, operator);\n    }\n\n    function _by() internal view returns (address result) {\n        assembly {\n            // `msg.sender == _CONDUIT ? address(0) : msg.sender`.\n            result := mul(iszero(eq(caller(), _CONDUIT)), caller())\n        }\n    }\n}\n"
      },
      "lib/solady/src/tokens/ERC1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC1155 implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/ERC1155.sol)\n///\n/// @dev Note:\n/// The ERC1155 standard allows for self-approvals.\n/// For performance, this implementation WILL NOT revert for such actions.\n/// Please add any checks with overrides if desired.\nabstract contract ERC1155 {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The lengths of the input arrays are not the same.\n    error ArrayLengthsMismatch();\n\n    /// @dev Cannot mint or transfer to the zero address.\n    error TransferToZeroAddress();\n\n    /// @dev The recipient's balance has overflowed.\n    error AccountBalanceOverflow();\n\n    /// @dev Insufficient balance.\n    error InsufficientBalance();\n\n    /// @dev Only the token owner or an approved account can manage the tokens.\n    error NotOwnerNorApproved();\n\n    /// @dev Cannot safely transfer to a contract that does not implement\n    /// the ERC1155Receiver interface.\n    error TransferToNonERC1155ReceiverImplementer();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                           EVENTS                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Emitted when `amount` of token `id` is transferred\n    /// from `from` to `to` by `operator`.\n    event TransferSingle(\n        address indexed operator,\n        address indexed from,\n        address indexed to,\n        uint256 id,\n        uint256 amount\n    );\n\n    /// @dev Emitted when `amounts` of token `ids` are transferred\n    /// from `from` to `to` by `operator`.\n    event TransferBatch(\n        address indexed operator,\n        address indexed from,\n        address indexed to,\n        uint256[] ids,\n        uint256[] amounts\n    );\n\n    /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.\n    event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);\n\n    /// @dev Emitted when the Uniform Resource Identifier (URI) for token `id`\n    /// is updated to `value`. This event is not used in the base contract.\n    /// You may need to emit this event depending on your URI logic.\n    ///\n    /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n    event URI(string value, uint256 indexed id);\n\n    /// @dev `keccak256(bytes(\"TransferSingle(address,address,address,uint256,uint256)\"))`.\n    uint256 private constant _TRANSFER_SINGLE_EVENT_SIGNATURE =\n        0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62;\n\n    /// @dev `keccak256(bytes(\"TransferBatch(address,address,address,uint256[],uint256[])\"))`.\n    uint256 private constant _TRANSFER_BATCH_EVENT_SIGNATURE =\n        0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb;\n\n    /// @dev `keccak256(bytes(\"ApprovalForAll(address,address,bool)\"))`.\n    uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =\n        0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          STORAGE                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The `ownerSlotSeed` of a given owner is given by.\n    /// ```\n    ///     let ownerSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))\n    /// ```\n    ///\n    /// The balance slot of `owner` is given by.\n    /// ```\n    ///     mstore(0x20, ownerSlotSeed)\n    ///     mstore(0x00, id)\n    ///     let balanceSlot := keccak256(0x00, 0x40)\n    /// ```\n    ///\n    /// The operator approval slot of `owner` is given by.\n    /// ```\n    ///     mstore(0x20, ownerSlotSeed)\n    ///     mstore(0x00, operator)\n    ///     let operatorApprovalSlot := keccak256(0x0c, 0x34)\n    /// ```\n    uint256 private constant _ERC1155_MASTER_SLOT_SEED = 0x9a31110384e0b0c9;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      ERC1155 METADATA                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the URI for token `id`.\n    ///\n    /// You can either return the same templated URI for all token IDs,\n    /// (e.g. \"https://example.com/api/{id}.json\"),\n    /// or return a unique URI for each `id`.\n    ///\n    /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n    function uri(uint256 id) public view virtual returns (string memory);\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          ERC1155                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the amount of `id` owned by `owner`.\n    function balanceOf(address owner, uint256 id) public view virtual returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n            mstore(0x14, owner)\n            mstore(0x00, id)\n            result := sload(keccak256(0x00, 0x40))\n        }\n    }\n\n    /// @dev Returns whether `operator` is approved to manage the tokens of `owner`.\n    function isApprovedForAll(address owner, address operator)\n        public\n        view\n        virtual\n        returns (bool result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n            mstore(0x14, owner)\n            mstore(0x00, operator)\n            result := sload(keccak256(0x0c, 0x34))\n        }\n    }\n\n    /// @dev Sets whether `operator` is approved to manage the tokens of the caller.\n    ///\n    /// Emits a {ApprovalForAll} event.\n    function setApprovalForAll(address operator, bool isApproved) public virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Convert to 0 or 1.\n            isApproved := iszero(iszero(isApproved))\n            // Update the `isApproved` for (`msg.sender`, `operator`).\n            mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n            mstore(0x14, caller())\n            mstore(0x00, operator)\n            sstore(keccak256(0x0c, 0x34), isApproved)\n            // Emit the {ApprovalForAll} event.\n            mstore(0x00, isApproved)\n            // forgefmt: disable-next-line\n            log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), shr(96, shl(96, operator)))\n        }\n    }\n\n    /// @dev Transfers `amount` of `id` from `from` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - `from` must have at least `amount` of `id`.\n    /// - If the caller is not `from`,\n    ///   it must be approved to manage the tokens of `from`.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {Transfer} event.\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes calldata data\n    ) public virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n            let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n            mstore(0x20, fromSlotSeed)\n            // Clear the upper 96 bits.\n            from := shr(96, fromSlotSeed)\n            to := shr(96, toSlotSeed)\n            // Revert if `to` is the zero address.\n            if iszero(to) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            // If the caller is not `from`, do the authorization check.\n            if iszero(eq(caller(), from)) {\n                mstore(0x00, caller())\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Subtract and store the updated balance of `from`.\n            {\n                mstore(0x00, id)\n                let fromBalanceSlot := keccak256(0x00, 0x40)\n                let fromBalance := sload(fromBalanceSlot)\n                if gt(amount, fromBalance) {\n                    mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(fromBalanceSlot, sub(fromBalance, amount))\n            }\n            // Increase and store the updated balance of `to`.\n            {\n                mstore(0x20, toSlotSeed)\n                let toBalanceSlot := keccak256(0x00, 0x40)\n                let toBalanceBefore := sload(toBalanceSlot)\n                let toBalanceAfter := add(toBalanceBefore, amount)\n                if lt(toBalanceAfter, toBalanceBefore) {\n                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(toBalanceSlot, toBalanceAfter)\n            }\n            // Emit a {TransferSingle} event.\n            mstore(0x20, amount)\n            log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, to)\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Do the {onERC1155Received} check if `to` is a smart contract.\n            if extcodesize(to) {\n                // Prepare the calldata.\n                let m := mload(0x40)\n                // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n                mstore(m, 0xf23a6e61)\n                mstore(add(m, 0x20), caller())\n                mstore(add(m, 0x40), from)\n                mstore(add(m, 0x60), id)\n                mstore(add(m, 0x80), amount)\n                mstore(add(m, 0xa0), 0xa0)\n                calldatacopy(add(m, 0xc0), sub(data.offset, 0x20), add(0x20, data.length))\n                // Revert if the call reverts.\n                if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, data.length), m, 0x20)) {\n                    if returndatasize() {\n                        // Bubble up the revert if the call reverts.\n                        returndatacopy(0x00, 0x00, returndatasize())\n                        revert(0x00, returndatasize())\n                    }\n                    mstore(m, 0)\n                }\n                // Load the returndata and compare it with the function selector.\n                if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n                    mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n        }\n    }\n\n    /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - `from` must have at least `amount` of `id`.\n    /// - `ids` and `amounts` must have the same length.\n    /// - If the caller is not `from`,\n    ///   it must be approved to manage the tokens of `from`.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {TransferBatch} event.\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] calldata ids,\n        uint256[] calldata amounts,\n        bytes calldata data\n    ) public virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, to, ids, amounts, data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(eq(ids.length, amounts.length)) {\n                mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n                revert(0x1c, 0x04)\n            }\n            let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n            let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n            mstore(0x20, fromSlotSeed)\n            // Clear the upper 96 bits.\n            from := shr(96, fromSlotSeed)\n            to := shr(96, toSlotSeed)\n            // Revert if `to` is the zero address.\n            if iszero(to) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            // If the caller is not `from`, do the authorization check.\n            if iszero(eq(caller(), from)) {\n                mstore(0x00, caller())\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Loop through all the `ids` and update the balances.\n            {\n                let end := shl(5, ids.length)\n                for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } {\n                    let amount := calldataload(add(amounts.offset, i))\n                    // Subtract and store the updated balance of `from`.\n                    {\n                        mstore(0x20, fromSlotSeed)\n                        mstore(0x00, calldataload(add(ids.offset, i)))\n                        let fromBalanceSlot := keccak256(0x00, 0x40)\n                        let fromBalance := sload(fromBalanceSlot)\n                        if gt(amount, fromBalance) {\n                            mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(fromBalanceSlot, sub(fromBalance, amount))\n                    }\n                    // Increase and store the updated balance of `to`.\n                    {\n                        mstore(0x20, toSlotSeed)\n                        let toBalanceSlot := keccak256(0x00, 0x40)\n                        let toBalanceBefore := sload(toBalanceSlot)\n                        let toBalanceAfter := add(toBalanceBefore, amount)\n                        if lt(toBalanceAfter, toBalanceBefore) {\n                            mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(toBalanceSlot, toBalanceAfter)\n                    }\n                }\n            }\n            // Emit a {TransferBatch} event.\n            {\n                let m := mload(0x40)\n                // Copy the `ids`.\n                mstore(m, 0x40)\n                let n := add(0x20, shl(5, ids.length))\n                let o := add(m, 0x40)\n                calldatacopy(o, sub(ids.offset, 0x20), n)\n                // Copy the `amounts`.\n                mstore(add(m, 0x20), add(0x40, n))\n                o := add(o, n)\n                n := add(0x20, shl(5, amounts.length))\n                calldatacopy(o, sub(amounts.offset, 0x20), n)\n                n := sub(add(o, n), m)\n                // Do the emit.\n                log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, to)\n            }\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransferCalldata(from, to, ids, amounts, data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Do the {onERC1155BatchReceived} check if `to` is a smart contract.\n            if extcodesize(to) {\n                let m := mload(0x40)\n                // Prepare the calldata.\n                // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n                mstore(m, 0xbc197c81)\n                mstore(add(m, 0x20), caller())\n                mstore(add(m, 0x40), from)\n                // Copy the `ids`.\n                mstore(add(m, 0x60), 0xa0)\n                let n := add(0x20, shl(5, ids.length))\n                let o := add(m, 0xc0)\n                calldatacopy(o, sub(ids.offset, 0x20), n)\n                // Copy the `amounts`.\n                let s := add(0xa0, n)\n                mstore(add(m, 0x80), s)\n                o := add(o, n)\n                n := add(0x20, shl(5, amounts.length))\n                calldatacopy(o, sub(amounts.offset, 0x20), n)\n                // Copy the `data`.\n                mstore(add(m, 0xa0), add(s, n))\n                o := add(o, n)\n                n := add(0x20, data.length)\n                calldatacopy(o, sub(data.offset, 0x20), n)\n                n := sub(add(o, n), add(m, 0x1c))\n                // Revert if the call reverts.\n                if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) {\n                    if returndatasize() {\n                        // Bubble up the revert if the call reverts.\n                        returndatacopy(0x00, 0x00, returndatasize())\n                        revert(0x00, returndatasize())\n                    }\n                    mstore(m, 0)\n                }\n                // Load the returndata and compare it with the function selector.\n                if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n                    mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n        }\n    }\n\n    /// @dev Returns the amounts of `ids` for `owners.\n    ///\n    /// Requirements:\n    /// - `owners` and `ids` must have the same length.\n    function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)\n        public\n        view\n        virtual\n        returns (uint256[] memory balances)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(eq(ids.length, owners.length)) {\n                mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n                revert(0x1c, 0x04)\n            }\n            balances := mload(0x40)\n            mstore(balances, ids.length)\n            let o := add(balances, 0x20)\n            let end := shl(5, ids.length)\n            mstore(0x40, add(end, o))\n            // Loop through all the `ids` and load the balances.\n            for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } {\n                let owner := calldataload(add(owners.offset, i))\n                mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner)))\n                mstore(0x00, calldataload(add(ids.offset, i)))\n                mstore(add(o, i), sload(keccak256(0x00, 0x40)))\n            }\n        }\n    }\n\n    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n    /// See: https://eips.ethereum.org/EIPS/eip-165\n    /// This function call must use less than 30000 gas.\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let s := shr(224, interfaceId)\n            // ERC165: 0x01ffc9a7, ERC1155: 0xd9b67a26, ERC1155MetadataURI: 0x0e89341c.\n            result := or(or(eq(s, 0x01ffc9a7), eq(s, 0xd9b67a26)), eq(s, 0x0e89341c))\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  INTERNAL MINT FUNCTIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Mints `amount` of `id` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {Transfer} event.\n    function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(address(0), to, _single(id), _single(amount), data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            let to_ := shl(96, to)\n            // Revert if `to` is the zero address.\n            if iszero(to_) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            // Increase and store the updated balance of `to`.\n            {\n                mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n                mstore(0x14, to)\n                mstore(0x00, id)\n                let toBalanceSlot := keccak256(0x00, 0x40)\n                let toBalanceBefore := sload(toBalanceSlot)\n                let toBalanceAfter := add(toBalanceBefore, amount)\n                if lt(toBalanceAfter, toBalanceBefore) {\n                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(toBalanceSlot, toBalanceAfter)\n            }\n            // Emit a {TransferSingle} event.\n            mstore(0x00, id)\n            mstore(0x20, amount)\n            log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(address(0), to, _single(id), _single(amount), data);\n        }\n        if (_hasCode(to)) _checkOnERC1155Received(address(0), to, id, amount, data);\n    }\n\n    /// @dev Mints `amounts` of `ids` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - `ids` and `amounts` must have the same length.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {TransferBatch} event.\n    function _batchMint(\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(address(0), to, ids, amounts, data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(eq(mload(ids), mload(amounts))) {\n                mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n                revert(0x1c, 0x04)\n            }\n            let to_ := shl(96, to)\n            // Revert if `to` is the zero address.\n            if iszero(to_) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            // Loop through all the `ids` and update the balances.\n            {\n                mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n                let end := shl(5, mload(ids))\n                for { let i := 0 } iszero(eq(i, end)) {} {\n                    i := add(i, 0x20)\n                    let amount := mload(add(amounts, i))\n                    // Increase and store the updated balance of `to`.\n                    {\n                        mstore(0x00, mload(add(ids, i)))\n                        let toBalanceSlot := keccak256(0x00, 0x40)\n                        let toBalanceBefore := sload(toBalanceSlot)\n                        let toBalanceAfter := add(toBalanceBefore, amount)\n                        if lt(toBalanceAfter, toBalanceBefore) {\n                            mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(toBalanceSlot, toBalanceAfter)\n                    }\n                }\n            }\n            // Emit a {TransferBatch} event.\n            {\n                let m := mload(0x40)\n                // Copy the `ids`.\n                mstore(m, 0x40)\n                let n := add(0x20, shl(5, mload(ids)))\n                let o := add(m, 0x40)\n                pop(staticcall(gas(), 4, ids, n, o, n))\n                // Copy the `amounts`.\n                mstore(add(m, 0x20), add(0x40, returndatasize()))\n                o := add(o, returndatasize())\n                n := add(0x20, shl(5, mload(amounts)))\n                pop(staticcall(gas(), 4, amounts, n, o, n))\n                n := sub(add(o, returndatasize()), m)\n                // Do the emit.\n                log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n            }\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(address(0), to, ids, amounts, data);\n        }\n        if (_hasCode(to)) _checkOnERC1155BatchReceived(address(0), to, ids, amounts, data);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  INTERNAL BURN FUNCTIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Equivalent to `_burn(address(0), from, id, amount)`.\n    function _burn(address from, uint256 id, uint256 amount) internal virtual {\n        _burn(address(0), from, id, amount);\n    }\n\n    /// @dev Destroys `amount` of `id` from `from`.\n    ///\n    /// Requirements:\n    /// - `from` must have at least `amount` of `id`.\n    /// - If `by` is not the zero address, it must be either `from`,\n    ///   or approved to manage the tokens of `from`.\n    ///\n    /// Emits a {Transfer} event.\n    function _burn(address by, address from, uint256 id, uint256 amount) internal virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, address(0), _single(id), _single(amount), \"\");\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            let from_ := shl(96, from)\n            mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n            // If `by` is not the zero address, and not equal to `from`,\n            // check if it is approved to manage all the tokens of `from`.\n            if iszero(or(iszero(shl(96, by)), eq(shl(96, by), from_))) {\n                mstore(0x00, by)\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Decrease and store the updated balance of `from`.\n            {\n                mstore(0x00, id)\n                let fromBalanceSlot := keccak256(0x00, 0x40)\n                let fromBalance := sload(fromBalanceSlot)\n                if gt(amount, fromBalance) {\n                    mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(fromBalanceSlot, sub(fromBalance, amount))\n            }\n            // Emit a {TransferSingle} event.\n            mstore(0x00, id)\n            mstore(0x20, amount)\n            log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, address(0), _single(id), _single(amount), \"\");\n        }\n    }\n\n    /// @dev Equivalent to `_batchBurn(address(0), from, ids, amounts)`.\n    function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts)\n        internal\n        virtual\n    {\n        _batchBurn(address(0), from, ids, amounts);\n    }\n\n    /// @dev Destroys `amounts` of `ids` from `from`.\n    ///\n    /// Requirements:\n    /// - `ids` and `amounts` must have the same length.\n    /// - `from` must have at least `amounts` of `ids`.\n    /// - If `by` is not the zero address, it must be either `from`,\n    ///   or approved to manage the tokens of `from`.\n    ///\n    /// Emits a {TransferBatch} event.\n    function _batchBurn(address by, address from, uint256[] memory ids, uint256[] memory amounts)\n        internal\n        virtual\n    {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, address(0), ids, amounts, \"\");\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(eq(mload(ids), mload(amounts))) {\n                mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n                revert(0x1c, 0x04)\n            }\n            let from_ := shl(96, from)\n            mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n            // If `by` is not the zero address, and not equal to `from`,\n            // check if it is approved to manage all the tokens of `from`.\n            let by_ := shl(96, by)\n            if iszero(or(iszero(by_), eq(by_, from_))) {\n                mstore(0x00, by)\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Loop through all the `ids` and update the balances.\n            {\n                let end := shl(5, mload(ids))\n                for { let i := 0 } iszero(eq(i, end)) {} {\n                    i := add(i, 0x20)\n                    let amount := mload(add(amounts, i))\n                    // Decrease and store the updated balance of `to`.\n                    {\n                        mstore(0x00, mload(add(ids, i)))\n                        let fromBalanceSlot := keccak256(0x00, 0x40)\n                        let fromBalance := sload(fromBalanceSlot)\n                        if gt(amount, fromBalance) {\n                            mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(fromBalanceSlot, sub(fromBalance, amount))\n                    }\n                }\n            }\n            // Emit a {TransferBatch} event.\n            {\n                let m := mload(0x40)\n                // Copy the `ids`.\n                mstore(m, 0x40)\n                let n := add(0x20, shl(5, mload(ids)))\n                let o := add(m, 0x40)\n                pop(staticcall(gas(), 4, ids, n, o, n))\n                // Copy the `amounts`.\n                mstore(add(m, 0x20), add(0x40, returndatasize()))\n                o := add(o, returndatasize())\n                n := add(0x20, shl(5, mload(amounts)))\n                pop(staticcall(gas(), 4, amounts, n, o, n))\n                n := sub(add(o, returndatasize()), m)\n                // Do the emit.\n                log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n            }\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, address(0), ids, amounts, \"\");\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                INTERNAL APPROVAL FUNCTIONS                 */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Approve or remove the `operator` as an operator for `by`,\n    /// without authorization checks.\n    ///\n    /// Emits a {ApprovalForAll} event.\n    function _setApprovalForAll(address by, address operator, bool isApproved) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Convert to 0 or 1.\n            isApproved := iszero(iszero(isApproved))\n            // Update the `isApproved` for (`by`, `operator`).\n            mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n            mstore(0x14, by)\n            mstore(0x00, operator)\n            sstore(keccak256(0x0c, 0x34), isApproved)\n            // Emit the {ApprovalForAll} event.\n            mstore(0x00, isApproved)\n            let m := shr(96, not(0))\n            log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, and(m, by), and(m, operator))\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                INTERNAL TRANSFER FUNCTIONS                 */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Equivalent to `_safeTransfer(address(0), from, to, id, amount, data)`.\n    function _safeTransfer(address from, address to, uint256 id, uint256 amount, bytes memory data)\n        internal\n        virtual\n    {\n        _safeTransfer(address(0), from, to, id, amount, data);\n    }\n\n    /// @dev Transfers `amount` of `id` from `from` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - `from` must have at least `amount` of `id`.\n    /// - If `by` is not the zero address, it must be either `from`,\n    ///   or approved to manage the tokens of `from`.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {Transfer} event.\n    function _safeTransfer(\n        address by,\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) internal virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            let from_ := shl(96, from)\n            let to_ := shl(96, to)\n            // Revert if `to` is the zero address.\n            if iszero(to_) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n            // If `by` is not the zero address, and not equal to `from`,\n            // check if it is approved to manage all the tokens of `from`.\n            let by_ := shl(96, by)\n            if iszero(or(iszero(by_), eq(by_, from_))) {\n                mstore(0x00, by)\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Subtract and store the updated balance of `from`.\n            {\n                mstore(0x00, id)\n                let fromBalanceSlot := keccak256(0x00, 0x40)\n                let fromBalance := sload(fromBalanceSlot)\n                if gt(amount, fromBalance) {\n                    mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(fromBalanceSlot, sub(fromBalance, amount))\n            }\n            // Increase and store the updated balance of `to`.\n            {\n                mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n                let toBalanceSlot := keccak256(0x00, 0x40)\n                let toBalanceBefore := sload(toBalanceSlot)\n                let toBalanceAfter := add(toBalanceBefore, amount)\n                if lt(toBalanceAfter, toBalanceBefore) {\n                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                    revert(0x1c, 0x04)\n                }\n                sstore(toBalanceSlot, toBalanceAfter)\n            }\n            // Emit a {TransferSingle} event.\n            mstore(0x20, amount)\n            // forgefmt: disable-next-line\n            log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n        }\n        if (_hasCode(to)) _checkOnERC1155Received(from, to, id, amount, data);\n    }\n\n    /// @dev Equivalent to `_safeBatchTransfer(address(0), from, to, ids, amounts, data)`.\n    function _safeBatchTransfer(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {\n        _safeBatchTransfer(address(0), from, to, ids, amounts, data);\n    }\n\n    /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n    ///\n    /// Requirements:\n    /// - `to` cannot be the zero address.\n    /// - `ids` and `amounts` must have the same length.\n    /// - `from` must have at least `amounts` of `ids`.\n    /// - If `by` is not the zero address, it must be either `from`,\n    ///   or approved to manage the tokens of `from`.\n    /// - If `to` refers to a smart contract, it must implement\n    ///   {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n    ///\n    /// Emits a {TransferBatch} event.\n    function _safeBatchTransfer(\n        address by,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {\n        if (_useBeforeTokenTransfer()) {\n            _beforeTokenTransfer(from, to, ids, amounts, data);\n        }\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(eq(mload(ids), mload(amounts))) {\n                mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n                revert(0x1c, 0x04)\n            }\n            let from_ := shl(96, from)\n            let to_ := shl(96, to)\n            // Revert if `to` is the zero address.\n            if iszero(to_) {\n                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, from_)\n            let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, to_)\n            mstore(0x20, fromSlotSeed)\n            // If `by` is not the zero address, and not equal to `from`,\n            // check if it is approved to manage all the tokens of `from`.\n            let by_ := shl(96, by)\n            if iszero(or(iszero(by_), eq(by_, from_))) {\n                mstore(0x00, by)\n                if iszero(sload(keccak256(0x0c, 0x34))) {\n                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            // Loop through all the `ids` and update the balances.\n            {\n                let end := shl(5, mload(ids))\n                for { let i := 0 } iszero(eq(i, end)) {} {\n                    i := add(i, 0x20)\n                    let amount := mload(add(amounts, i))\n                    // Subtract and store the updated balance of `from`.\n                    {\n                        mstore(0x20, fromSlotSeed)\n                        mstore(0x00, mload(add(ids, i)))\n                        let fromBalanceSlot := keccak256(0x00, 0x40)\n                        let fromBalance := sload(fromBalanceSlot)\n                        if gt(amount, fromBalance) {\n                            mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(fromBalanceSlot, sub(fromBalance, amount))\n                    }\n                    // Increase and store the updated balance of `to`.\n                    {\n                        mstore(0x20, toSlotSeed)\n                        let toBalanceSlot := keccak256(0x00, 0x40)\n                        let toBalanceBefore := sload(toBalanceSlot)\n                        let toBalanceAfter := add(toBalanceBefore, amount)\n                        if lt(toBalanceAfter, toBalanceBefore) {\n                            mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n                            revert(0x1c, 0x04)\n                        }\n                        sstore(toBalanceSlot, toBalanceAfter)\n                    }\n                }\n            }\n            // Emit a {TransferBatch} event.\n            {\n                let m := mload(0x40)\n                // Copy the `ids`.\n                mstore(m, 0x40)\n                let n := add(0x20, shl(5, mload(ids)))\n                let o := add(m, 0x40)\n                pop(staticcall(gas(), 4, ids, n, o, n))\n                // Copy the `amounts`.\n                mstore(add(m, 0x20), add(0x40, returndatasize()))\n                o := add(o, returndatasize())\n                n := add(0x20, shl(5, mload(amounts)))\n                pop(staticcall(gas(), 4, amounts, n, o, n))\n                n := sub(add(o, returndatasize()), m)\n                // Do the emit.\n                log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n            }\n        }\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, to, ids, amounts, data);\n        }\n        if (_hasCode(to)) _checkOnERC1155BatchReceived(from, to, ids, amounts, data);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                    HOOKS FOR OVERRIDING                    */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Override this function to return true if `_beforeTokenTransfer` is used.\n    /// The is to help the compiler avoid producing dead bytecode.\n    function _useBeforeTokenTransfer() internal view virtual returns (bool) {\n        return false;\n    }\n\n    /// @dev Hook that is called before any token transfer.\n    /// This includes minting and burning, as well as batched variants.\n    ///\n    /// The same hook is called on both single and batched variants.\n    /// For single transfers, the length of the `id` and `amount` arrays are 1.\n    function _beforeTokenTransfer(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {}\n\n    /// @dev Override this function to return true if `_afterTokenTransfer` is used.\n    /// The is to help the compiler avoid producing dead bytecode.\n    function _useAfterTokenTransfer() internal view virtual returns (bool) {\n        return false;\n    }\n\n    /// @dev Hook that is called after any token transfer.\n    /// This includes minting and burning, as well as batched variants.\n    ///\n    /// The same hook is called on both single and batched variants.\n    /// For single transfers, the length of the `id` and `amount` arrays are 1.\n    function _afterTokenTransfer(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {}\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      PRIVATE HELPERS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Helper for calling the `_afterTokenTransfer` hook.\n    /// The is to help the compiler avoid producing dead bytecode.\n    function _afterTokenTransferCalldata(\n        address from,\n        address to,\n        uint256[] calldata ids,\n        uint256[] calldata amounts,\n        bytes calldata data\n    ) private {\n        if (_useAfterTokenTransfer()) {\n            _afterTokenTransfer(from, to, ids, amounts, data);\n        }\n    }\n\n    /// @dev Returns if `a` has bytecode of non-zero length.\n    function _hasCode(address a) private view returns (bool result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := extcodesize(a) // Can handle dirty upper bits.\n        }\n    }\n\n    /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155Received} on `to`.\n    /// Reverts if the target does not support the function correctly.\n    function _checkOnERC1155Received(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) private {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Prepare the calldata.\n            let m := mload(0x40)\n            // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n            mstore(m, 0xf23a6e61)\n            mstore(add(m, 0x20), caller())\n            mstore(add(m, 0x40), shr(96, shl(96, from)))\n            mstore(add(m, 0x60), id)\n            mstore(add(m, 0x80), amount)\n            mstore(add(m, 0xa0), 0xa0)\n            let n := mload(data)\n            mstore(add(m, 0xc0), n)\n            if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xe0), n)) }\n            // Revert if the call reverts.\n            if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, n), m, 0x20)) {\n                if returndatasize() {\n                    // Bubble up the revert if the call reverts.\n                    returndatacopy(0x00, 0x00, returndatasize())\n                    revert(0x00, returndatasize())\n                }\n                mstore(m, 0)\n            }\n            // Load the returndata and compare it with the function selector.\n            if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n                mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155BatchReceived} on `to`.\n    /// Reverts if the target does not support the function correctly.\n    function _checkOnERC1155BatchReceived(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) private {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Prepare the calldata.\n            let m := mload(0x40)\n            // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n            mstore(m, 0xbc197c81)\n            mstore(add(m, 0x20), caller())\n            mstore(add(m, 0x40), shr(96, shl(96, from)))\n            // Copy the `ids`.\n            mstore(add(m, 0x60), 0xa0)\n            let n := add(0x20, shl(5, mload(ids)))\n            let o := add(m, 0xc0)\n            pop(staticcall(gas(), 4, ids, n, o, n))\n            // Copy the `amounts`.\n            let s := add(0xa0, returndatasize())\n            mstore(add(m, 0x80), s)\n            o := add(o, returndatasize())\n            n := add(0x20, shl(5, mload(amounts)))\n            pop(staticcall(gas(), 4, amounts, n, o, n))\n            // Copy the `data`.\n            mstore(add(m, 0xa0), add(s, returndatasize()))\n            o := add(o, returndatasize())\n            n := add(0x20, mload(data))\n            pop(staticcall(gas(), 4, data, n, o, n))\n            n := sub(add(o, returndatasize()), add(m, 0x1c))\n            // Revert if the call reverts.\n            if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) {\n                if returndatasize() {\n                    // Bubble up the revert if the call reverts.\n                    returndatacopy(0x00, 0x00, returndatasize())\n                    revert(0x00, returndatasize())\n                }\n                mstore(m, 0)\n            }\n            // Load the returndata and compare it with the function selector.\n            if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n                mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /// @dev Returns `x` in an array with a single element.\n    function _single(uint256 x) private pure returns (uint256[] memory result) {\n        assembly {\n            result := mload(0x40)\n            mstore(0x40, add(result, 0x40))\n            mstore(result, 1)\n            mstore(add(result, 0x20), x)\n        }\n    }\n}\n"
      },
      "lib/seaport/lib/seaport-types/src/lib/ConsiderationStructs.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    BasicOrderType,\n    ItemType,\n    OrderType,\n    Side\n} from \"./ConsiderationEnums.sol\";\n\nimport {\n    CalldataPointer,\n    MemoryPointer\n} from \"../helpers/PointerLibraries.sol\";\n\n/**\n * @dev An order contains eleven components: an offerer, a zone (or account that\n *      can cancel the order or restrict who can fulfill the order depending on\n *      the type), the order type (specifying partial fill support as well as\n *      restricted order status), the start and end time, a hash that will be\n *      provided to the zone when validating restricted orders, a salt, a key\n *      corresponding to a given conduit, a counter, and an arbitrary number of\n *      offer items that can be spent along with consideration items that must\n *      be received by their respective recipient.\n */\nstruct OrderComponents {\n    address offerer;\n    address zone;\n    OfferItem[] offer;\n    ConsiderationItem[] consideration;\n    OrderType orderType;\n    uint256 startTime;\n    uint256 endTime;\n    bytes32 zoneHash;\n    uint256 salt;\n    bytes32 conduitKey;\n    uint256 counter;\n}\n\n/**\n * @dev An offer item has five components: an item type (ETH or other native\n *      tokens, ERC20, ERC721, and ERC1155, as well as criteria-based ERC721 and\n *      ERC1155), a token address, a dual-purpose \"identifierOrCriteria\"\n *      component that will either represent a tokenId or a merkle root\n *      depending on the item type, and a start and end amount that support\n *      increasing or decreasing amounts over the duration of the respective\n *      order.\n */\nstruct OfferItem {\n    ItemType itemType;\n    address token;\n    uint256 identifierOrCriteria;\n    uint256 startAmount;\n    uint256 endAmount;\n}\n\n/**\n * @dev A consideration item has the same five components as an offer item and\n *      an additional sixth component designating the required recipient of the\n *      item.\n */\nstruct ConsiderationItem {\n    ItemType itemType;\n    address token;\n    uint256 identifierOrCriteria;\n    uint256 startAmount;\n    uint256 endAmount;\n    address payable recipient;\n}\n\n/**\n * @dev A spent item is translated from a utilized offer item and has four\n *      components: an item type (ETH or other native tokens, ERC20, ERC721, and\n *      ERC1155), a token address, a tokenId, and an amount.\n */\nstruct SpentItem {\n    ItemType itemType;\n    address token;\n    uint256 identifier;\n    uint256 amount;\n}\n\n/**\n * @dev A received item is translated from a utilized consideration item and has\n *      the same four components as a spent item, as well as an additional fifth\n *      component designating the required recipient of the item.\n */\nstruct ReceivedItem {\n    ItemType itemType;\n    address token;\n    uint256 identifier;\n    uint256 amount;\n    address payable recipient;\n}\n\n/**\n * @dev For basic orders involving ETH / native / ERC20 <=> ERC721 / ERC1155\n *      matching, a group of six functions may be called that only requires a\n *      subset of the usual order arguments. Note the use of a \"basicOrderType\"\n *      enum; this represents both the usual order type as well as the \"route\"\n *      of the basic order (a simple derivation function for the basic order\n *      type is `basicOrderType = orderType + (4 * basicOrderRoute)`.)\n */\nstruct BasicOrderParameters {\n    // calldata offset\n    address considerationToken; // 0x24\n    uint256 considerationIdentifier; // 0x44\n    uint256 considerationAmount; // 0x64\n    address payable offerer; // 0x84\n    address zone; // 0xa4\n    address offerToken; // 0xc4\n    uint256 offerIdentifier; // 0xe4\n    uint256 offerAmount; // 0x104\n    BasicOrderType basicOrderType; // 0x124\n    uint256 startTime; // 0x144\n    uint256 endTime; // 0x164\n    bytes32 zoneHash; // 0x184\n    uint256 salt; // 0x1a4\n    bytes32 offererConduitKey; // 0x1c4\n    bytes32 fulfillerConduitKey; // 0x1e4\n    uint256 totalOriginalAdditionalRecipients; // 0x204\n    AdditionalRecipient[] additionalRecipients; // 0x224\n    bytes signature; // 0x244\n    // Total length, excluding dynamic array data: 0x264 (580)\n}\n\n/**\n * @dev Basic orders can supply any number of additional recipients, with the\n *      implied assumption that they are supplied from the offered ETH (or other\n *      native token) or ERC20 token for the order.\n */\nstruct AdditionalRecipient {\n    uint256 amount;\n    address payable recipient;\n}\n\n/**\n * @dev The full set of order components, with the exception of the counter,\n *      must be supplied when fulfilling more sophisticated orders or groups of\n *      orders. The total number of original consideration items must also be\n *      supplied, as the caller may specify additional consideration items.\n */\nstruct OrderParameters {\n    address offerer; // 0x00\n    address zone; // 0x20\n    OfferItem[] offer; // 0x40\n    ConsiderationItem[] consideration; // 0x60\n    OrderType orderType; // 0x80\n    uint256 startTime; // 0xa0\n    uint256 endTime; // 0xc0\n    bytes32 zoneHash; // 0xe0\n    uint256 salt; // 0x100\n    bytes32 conduitKey; // 0x120\n    uint256 totalOriginalConsiderationItems; // 0x140\n    // offer.length                          // 0x160\n}\n\n/**\n * @dev Orders require a signature in addition to the other order parameters.\n */\nstruct Order {\n    OrderParameters parameters;\n    bytes signature;\n}\n\n/**\n * @dev Advanced orders include a numerator (i.e. a fraction to attempt to fill)\n *      and a denominator (the total size of the order) in addition to the\n *      signature and other order parameters. It also supports an optional field\n *      for supplying extra data; this data will be provided to the zone if the\n *      order type is restricted and the zone is not the caller, or will be\n *      provided to the offerer as context for contract order types.\n */\nstruct AdvancedOrder {\n    OrderParameters parameters;\n    uint120 numerator;\n    uint120 denominator;\n    bytes signature;\n    bytes extraData;\n}\n\n/**\n * @dev Orders can be validated (either explicitly via `validate`, or as a\n *      consequence of a full or partial fill), specifically cancelled (they can\n *      also be cancelled in bulk via incrementing a per-zone counter), and\n *      partially or fully filled (with the fraction filled represented by a\n *      numerator and denominator).\n */\nstruct OrderStatus {\n    bool isValidated;\n    bool isCancelled;\n    uint120 numerator;\n    uint120 denominator;\n}\n\n/**\n * @dev A criteria resolver specifies an order, side (offer vs. consideration),\n *      and item index. It then provides a chosen identifier (i.e. tokenId)\n *      alongside a merkle proof demonstrating the identifier meets the required\n *      criteria.\n */\nstruct CriteriaResolver {\n    uint256 orderIndex;\n    Side side;\n    uint256 index;\n    uint256 identifier;\n    bytes32[] criteriaProof;\n}\n\n/**\n * @dev A fulfillment is applied to a group of orders. It decrements a series of\n *      offer and consideration items, then generates a single execution\n *      element. A given fulfillment can be applied to as many offer and\n *      consideration items as desired, but must contain at least one offer and\n *      at least one consideration that match. The fulfillment must also remain\n *      consistent on all key parameters across all offer items (same offerer,\n *      token, type, tokenId, and conduit preference) as well as across all\n *      consideration items (token, type, tokenId, and recipient).\n */\nstruct Fulfillment {\n    FulfillmentComponent[] offerComponents;\n    FulfillmentComponent[] considerationComponents;\n}\n\n/**\n * @dev Each fulfillment component contains one index referencing a specific\n *      order and another referencing a specific offer or consideration item.\n */\nstruct FulfillmentComponent {\n    uint256 orderIndex;\n    uint256 itemIndex;\n}\n\n/**\n * @dev An execution is triggered once all consideration items have been zeroed\n *      out. It sends the item in question from the offerer to the item's\n *      recipient, optionally sourcing approvals from either this contract\n *      directly or from the offerer's chosen conduit if one is specified. An\n *      execution is not provided as an argument, but rather is derived via\n *      orders, criteria resolvers, and fulfillments (where the total number of\n *      executions will be less than or equal to the total number of indicated\n *      fulfillments) and returned as part of `matchOrders`.\n */\nstruct Execution {\n    ReceivedItem item;\n    address offerer;\n    bytes32 conduitKey;\n}\n\n/**\n * @dev Restricted orders are validated post-execution by calling validateOrder\n *      on the zone. This struct provides context about the order fulfillment\n *      and any supplied extraData, as well as all order hashes fulfilled in a\n *      call to a match or fulfillAvailable method.\n */\nstruct ZoneParameters {\n    bytes32 orderHash;\n    address fulfiller;\n    address offerer;\n    SpentItem[] offer;\n    ReceivedItem[] consideration;\n    bytes extraData;\n    bytes32[] orderHashes;\n    uint256 startTime;\n    uint256 endTime;\n    bytes32 zoneHash;\n}\n\n/**\n * @dev Zones and contract offerers can communicate which schemas they implement\n *      along with any associated metadata related to each schema.\n */\nstruct Schema {\n    uint256 id;\n    bytes metadata;\n}\n\nusing StructPointers for OrderComponents global;\nusing StructPointers for OfferItem global;\nusing StructPointers for ConsiderationItem global;\nusing StructPointers for SpentItem global;\nusing StructPointers for ReceivedItem global;\nusing StructPointers for BasicOrderParameters global;\nusing StructPointers for AdditionalRecipient global;\nusing StructPointers for OrderParameters global;\nusing StructPointers for Order global;\nusing StructPointers for AdvancedOrder global;\nusing StructPointers for OrderStatus global;\nusing StructPointers for CriteriaResolver global;\nusing StructPointers for Fulfillment global;\nusing StructPointers for FulfillmentComponent global;\nusing StructPointers for Execution global;\nusing StructPointers for ZoneParameters global;\n\n/**\n * @dev This library provides a set of functions for converting structs to\n *      pointers.\n */\nlibrary StructPointers {\n    /**\n     * @dev Get a MemoryPointer from OrderComponents.\n     *\n     * @param obj The OrderComponents object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        OrderComponents memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from OrderComponents.\n     *\n     * @param obj The OrderComponents object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        OrderComponents calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from OfferItem.\n     *\n     * @param obj The OfferItem object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        OfferItem memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from OfferItem.\n     *\n     * @param obj The OfferItem object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        OfferItem calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from ConsiderationItem.\n     *\n     * @param obj The ConsiderationItem object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        ConsiderationItem memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from ConsiderationItem.\n     *\n     * @param obj The ConsiderationItem object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        ConsiderationItem calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from SpentItem.\n     *\n     * @param obj The SpentItem object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        SpentItem memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from SpentItem.\n     *\n     * @param obj The SpentItem object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        SpentItem calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from ReceivedItem.\n     *\n     * @param obj The ReceivedItem object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        ReceivedItem memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from ReceivedItem.\n     *\n     * @param obj The ReceivedItem object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        ReceivedItem calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from BasicOrderParameters.\n     *\n     * @param obj The BasicOrderParameters object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        BasicOrderParameters memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from BasicOrderParameters.\n     *\n     * @param obj The BasicOrderParameters object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        BasicOrderParameters calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from AdditionalRecipient.\n     *\n     * @param obj The AdditionalRecipient object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        AdditionalRecipient memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from AdditionalRecipient.\n     *\n     * @param obj The AdditionalRecipient object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        AdditionalRecipient calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from OrderParameters.\n     *\n     * @param obj The OrderParameters object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        OrderParameters memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from OrderParameters.\n     *\n     * @param obj The OrderParameters object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        OrderParameters calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from Order.\n     *\n     * @param obj The Order object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        Order memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from Order.\n     *\n     * @param obj The Order object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        Order calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from AdvancedOrder.\n     *\n     * @param obj The AdvancedOrder object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        AdvancedOrder memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from AdvancedOrder.\n     *\n     * @param obj The AdvancedOrder object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        AdvancedOrder calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from OrderStatus.\n     *\n     * @param obj The OrderStatus object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        OrderStatus memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from OrderStatus.\n     *\n     * @param obj The OrderStatus object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        OrderStatus calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from CriteriaResolver.\n     *\n     * @param obj The CriteriaResolver object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        CriteriaResolver memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from CriteriaResolver.\n     *\n     * @param obj The CriteriaResolver object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        CriteriaResolver calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from Fulfillment.\n     *\n     * @param obj The Fulfillment object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        Fulfillment memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from Fulfillment.\n     *\n     * @param obj The Fulfillment object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        Fulfillment calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from FulfillmentComponent.\n     *\n     * @param obj The FulfillmentComponent object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        FulfillmentComponent memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from FulfillmentComponent.\n     *\n     * @param obj The FulfillmentComponent object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        FulfillmentComponent calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from Execution.\n     *\n     * @param obj The Execution object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        Execution memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from Execution.\n     *\n     * @param obj The Execution object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        Execution calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a MemoryPointer from ZoneParameters.\n     *\n     * @param obj The ZoneParameters object.\n     *\n     * @return ptr The MemoryPointer.\n     */\n    function toMemoryPointer(\n        ZoneParameters memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Get a CalldataPointer from ZoneParameters.\n     *\n     * @param obj The ZoneParameters object.\n     *\n     * @return ptr The CalldataPointer.\n     */\n    function toCalldataPointer(\n        ZoneParameters calldata obj\n    ) internal pure returns (CalldataPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n}\n"
      },
      "lib/seaport/lib/seaport-types/src/interfaces/ContractOffererInterface.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {ReceivedItem, Schema, SpentItem} from \"../lib/ConsiderationStructs.sol\";\nimport {IERC165} from \"../interfaces/IERC165.sol\";\n\n/**\n * @title ContractOffererInterface\n * @notice Contains the minimum interfaces needed to interact with a contract\n *         offerer.\n */\ninterface ContractOffererInterface is IERC165 {\n    /**\n     * @dev Generates an order with the specified minimum and maximum spent\n     *      items, and optional context (supplied as extraData).\n     *\n     * @param fulfiller       The address of the fulfiller.\n     * @param minimumReceived The minimum items that the caller is willing to\n     *                        receive.\n     * @param maximumSpent    The maximum items the caller is willing to spend.\n     * @param context         Additional context of the order.\n     *\n     * @return offer         A tuple containing the offer items.\n     * @return consideration A tuple containing the consideration items.\n     */\n    function generateOrder(\n        address fulfiller,\n        SpentItem[] calldata minimumReceived,\n        SpentItem[] calldata maximumSpent,\n        bytes calldata context // encoded based on the schemaID\n    ) external returns (SpentItem[] memory offer, ReceivedItem[] memory consideration);\n\n    /**\n     * @dev Ratifies an order with the specified offer, consideration, and\n     *      optional context (supplied as extraData).\n     *\n     * @param offer         The offer items.\n     * @param consideration The consideration items.\n     * @param context       Additional context of the order.\n     * @param orderHashes   The hashes to ratify.\n     * @param contractNonce The nonce of the contract.\n     *\n     * @return ratifyOrderMagicValue The magic value returned by the contract\n     *                               offerer.\n     */\n    function ratifyOrder(\n        SpentItem[] calldata offer,\n        ReceivedItem[] calldata consideration,\n        bytes calldata context, // encoded based on the schemaID\n        bytes32[] calldata orderHashes,\n        uint256 contractNonce\n    ) external returns (bytes4 ratifyOrderMagicValue);\n\n    /**\n     * @dev View function to preview an order generated in response to a minimum\n     *      set of received items, maximum set of spent items, and context\n     *      (supplied as extraData).\n     *\n     * @param caller          The address of the caller (e.g. Seaport).\n     * @param fulfiller       The address of the fulfiller (e.g. the account\n     *                        calling Seaport).\n     * @param minimumReceived The minimum items that the caller is willing to\n     *                        receive.\n     * @param maximumSpent    The maximum items the caller is willing to spend.\n     * @param context         Additional context of the order.\n     *\n     * @return offer         A tuple containing the offer items.\n     * @return consideration A tuple containing the consideration items.\n     */\n    function previewOrder(\n        address caller,\n        address fulfiller,\n        SpentItem[] calldata minimumReceived,\n        SpentItem[] calldata maximumSpent,\n        bytes calldata context // encoded based on the schemaID\n    ) external view returns (SpentItem[] memory offer, ReceivedItem[] memory consideration);\n\n    /**\n     * @dev Gets the metadata for this contract offerer.\n     *\n     * @return name    The name of the contract offerer.\n     * @return schemas The schemas supported by the contract offerer.\n     */\n    function getSeaportMetadata() external view returns (string memory name, Schema[] memory schemas); // map to Seaport Improvement Proposal IDs\n\n    function supportsInterface(bytes4 interfaceId) external view override returns (bool);\n\n    // Additional functions and/or events based on implemented schemaIDs\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.19;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "src/interfaces/IDelegationRegistry.sol": {
        "content": "// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.17;\n\n/**\n * @title An immutable registry contract to be deployed as a standalone primitive\n * @dev See EIP-5639, new project launches can read previous cold wallet -> hot wallet delegations\n * from here and integrate those permissions into their flow\n */\ninterface IDelegationRegistry {\n    /// @notice Delegation type\n    enum DelegationType {\n        NONE,\n        ALL,\n        CONTRACT,\n        TOKEN\n    }\n\n    /// @notice Info about a single delegation, used for onchain enumeration\n    struct DelegationInfo {\n        DelegationType type_;\n        address vault;\n        address delegate;\n        address contract_;\n        uint256 tokenId;\n    }\n\n    /// @notice Info about a single contract-level delegation\n    struct ContractDelegation {\n        address contract_;\n        address delegate;\n    }\n\n    /// @notice Info about a single token-level delegation\n    struct TokenDelegation {\n        address contract_;\n        uint256 tokenId;\n        address delegate;\n    }\n\n    /// @notice Emitted when a user delegates their entire wallet\n    event DelegateForAll(\n        address indexed vault,\n        address indexed delegate,\n        bool value\n    );\n\n    /// @notice Emitted when a user delegates a specific contract\n    event DelegateForContract(\n        address indexed vault,\n        address indexed delegate,\n        address indexed contract_,\n        bool value\n    );\n\n    /// @notice Emitted when a user delegates a specific token\n    event DelegateForToken(\n        address indexed vault,\n        address indexed delegate,\n        address indexed contract_,\n        uint256 tokenId,\n        bool value\n    );\n\n    /// @notice Emitted when a user revokes all delegations\n    event RevokeAllDelegates(address indexed vault);\n\n    /// @notice Emitted when a user revoes all delegations for a given delegate\n    event RevokeDelegate(address indexed vault, address indexed delegate);\n\n    /**\n     * -----------  WRITE -----------\n     */\n\n    /**\n     * @notice Allow the delegate to act on your behalf for all contracts\n     * @param delegate The hotwallet to act on your behalf\n     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking\n     */\n    function delegateForAll(address delegate, bool value) external;\n\n    /**\n     * @notice Allow the delegate to act on your behalf for a specific contract\n     * @param delegate The hotwallet to act on your behalf\n     * @param contract_ The address for the contract you're delegating\n     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking\n     */\n    function delegateForContract(\n        address delegate,\n        address contract_,\n        bool value\n    ) external;\n\n    /**\n     * @notice Allow the delegate to act on your behalf for a specific token\n     * @param delegate The hotwallet to act on your behalf\n     * @param contract_ The address for the contract you're delegating\n     * @param tokenId The token id for the token you're delegating\n     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking\n     */\n    function delegateForToken(\n        address delegate,\n        address contract_,\n        uint256 tokenId,\n        bool value\n    ) external;\n\n    /**\n     * @notice Revoke all delegates\n     */\n    function revokeAllDelegates() external;\n\n    /**\n     * @notice Revoke a specific delegate for all their permissions\n     * @param delegate The hotwallet to revoke\n     */\n    function revokeDelegate(address delegate) external;\n\n    /**\n     * @notice Remove yourself as a delegate for a specific vault\n     * @param vault The vault which delegated to the msg.sender, and should be removed\n     */\n    function revokeSelf(address vault) external;\n\n    /**\n     * -----------  READ -----------\n     */\n\n    /**\n     * @notice Returns all active delegations a given delegate is able to claim on behalf of\n     * @param delegate The delegate that you would like to retrieve delegations for\n     * @return info Array of DelegationInfo structs\n     */\n    function getDelegationsByDelegate(\n        address delegate\n    ) external view returns (DelegationInfo[] memory);\n\n    /**\n     * @notice Returns an array of wallet-level delegates for a given vault\n     * @param vault The cold wallet who issued the delegation\n     * @return addresses Array of wallet-level delegates for a given vault\n     */\n    function getDelegatesForAll(\n        address vault\n    ) external view returns (address[] memory);\n\n    /**\n     * @notice Returns an array of contract-level delegates for a given vault and contract\n     * @param vault The cold wallet who issued the delegation\n     * @param contract_ The address for the contract you're delegating\n     * @return addresses Array of contract-level delegates for a given vault and contract\n     */\n    function getDelegatesForContract(\n        address vault,\n        address contract_\n    ) external view returns (address[] memory);\n\n    /**\n     * @notice Returns an array of contract-level delegates for a given vault's token\n     * @param vault The cold wallet who issued the delegation\n     * @param contract_ The address for the contract holding the token\n     * @param tokenId The token id for the token you're delegating\n     * @return addresses Array of contract-level delegates for a given vault's token\n     */\n    function getDelegatesForToken(\n        address vault,\n        address contract_,\n        uint256 tokenId\n    ) external view returns (address[] memory);\n\n    /**\n     * @notice Returns all contract-level delegations for a given vault\n     * @param vault The cold wallet who issued the delegations\n     * @return delegations Array of ContractDelegation structs\n     */\n    function getContractLevelDelegations(\n        address vault\n    ) external view returns (ContractDelegation[] memory delegations);\n\n    /**\n     * @notice Returns all token-level delegations for a given vault\n     * @param vault The cold wallet who issued the delegations\n     * @return delegations Array of TokenDelegation structs\n     */\n    function getTokenLevelDelegations(\n        address vault\n    ) external view returns (TokenDelegation[] memory delegations);\n\n    /**\n     * @notice Returns true if the address is delegated to act on the entire vault\n     * @param delegate The hotwallet to act on your behalf\n     * @param vault The cold wallet who issued the delegation\n     */\n    function checkDelegateForAll(\n        address delegate,\n        address vault\n    ) external view returns (bool);\n\n    /**\n     * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault\n     * @param delegate The hotwallet to act on your behalf\n     * @param contract_ The address for the contract you're delegating\n     * @param vault The cold wallet who issued the delegation\n     */\n    function checkDelegateForContract(\n        address delegate,\n        address vault,\n        address contract_\n    ) external view returns (bool);\n\n    /**\n     * @notice Returns true if the address is delegated to act on your behalf for a specific token, the token's contract or an entire vault\n     * @param delegate The hotwallet to act on your behalf\n     * @param contract_ The address for the contract you're delegating\n     * @param tokenId The token id for the token you're delegating\n     * @param vault The cold wallet who issued the delegation\n     */\n    function checkDelegateForToken(\n        address delegate,\n        address vault,\n        address contract_,\n        uint256 tokenId\n    ) external view returns (bool);\n}\n"
      },
      "lib/seaport/lib/seaport-types/src/lib/ConsiderationEnums.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nenum OrderType {\n    // 0: no partial fills, anyone can execute\n    FULL_OPEN,\n\n    // 1: partial fills supported, anyone can execute\n    PARTIAL_OPEN,\n\n    // 2: no partial fills, only offerer or zone can execute\n    FULL_RESTRICTED,\n\n    // 3: partial fills supported, only offerer or zone can execute\n    PARTIAL_RESTRICTED,\n\n    // 4: contract order type\n    CONTRACT\n}\n\nenum BasicOrderType {\n    // 0: no partial fills, anyone can execute\n    ETH_TO_ERC721_FULL_OPEN,\n\n    // 1: partial fills supported, anyone can execute\n    ETH_TO_ERC721_PARTIAL_OPEN,\n\n    // 2: no partial fills, only offerer or zone can execute\n    ETH_TO_ERC721_FULL_RESTRICTED,\n\n    // 3: partial fills supported, only offerer or zone can execute\n    ETH_TO_ERC721_PARTIAL_RESTRICTED,\n\n    // 4: no partial fills, anyone can execute\n    ETH_TO_ERC1155_FULL_OPEN,\n\n    // 5: partial fills supported, anyone can execute\n    ETH_TO_ERC1155_PARTIAL_OPEN,\n\n    // 6: no partial fills, only offerer or zone can execute\n    ETH_TO_ERC1155_FULL_RESTRICTED,\n\n    // 7: partial fills supported, only offerer or zone can execute\n    ETH_TO_ERC1155_PARTIAL_RESTRICTED,\n\n    // 8: no partial fills, anyone can execute\n    ERC20_TO_ERC721_FULL_OPEN,\n\n    // 9: partial fills supported, anyone can execute\n    ERC20_TO_ERC721_PARTIAL_OPEN,\n\n    // 10: no partial fills, only offerer or zone can execute\n    ERC20_TO_ERC721_FULL_RESTRICTED,\n\n    // 11: partial fills supported, only offerer or zone can execute\n    ERC20_TO_ERC721_PARTIAL_RESTRICTED,\n\n    // 12: no partial fills, anyone can execute\n    ERC20_TO_ERC1155_FULL_OPEN,\n\n    // 13: partial fills supported, anyone can execute\n    ERC20_TO_ERC1155_PARTIAL_OPEN,\n\n    // 14: no partial fills, only offerer or zone can execute\n    ERC20_TO_ERC1155_FULL_RESTRICTED,\n\n    // 15: partial fills supported, only offerer or zone can execute\n    ERC20_TO_ERC1155_PARTIAL_RESTRICTED,\n\n    // 16: no partial fills, anyone can execute\n    ERC721_TO_ERC20_FULL_OPEN,\n\n    // 17: partial fills supported, anyone can execute\n    ERC721_TO_ERC20_PARTIAL_OPEN,\n\n    // 18: no partial fills, only offerer or zone can execute\n    ERC721_TO_ERC20_FULL_RESTRICTED,\n\n    // 19: partial fills supported, only offerer or zone can execute\n    ERC721_TO_ERC20_PARTIAL_RESTRICTED,\n\n    // 20: no partial fills, anyone can execute\n    ERC1155_TO_ERC20_FULL_OPEN,\n\n    // 21: partial fills supported, anyone can execute\n    ERC1155_TO_ERC20_PARTIAL_OPEN,\n\n    // 22: no partial fills, only offerer or zone can execute\n    ERC1155_TO_ERC20_FULL_RESTRICTED,\n\n    // 23: partial fills supported, only offerer or zone can execute\n    ERC1155_TO_ERC20_PARTIAL_RESTRICTED\n}\n\nenum BasicOrderRouteType {\n    // 0: provide Ether (or other native token) to receive offered ERC721 item.\n    ETH_TO_ERC721,\n\n    // 1: provide Ether (or other native token) to receive offered ERC1155 item.\n    ETH_TO_ERC1155,\n\n    // 2: provide ERC20 item to receive offered ERC721 item.\n    ERC20_TO_ERC721,\n\n    // 3: provide ERC20 item to receive offered ERC1155 item.\n    ERC20_TO_ERC1155,\n\n    // 4: provide ERC721 item to receive offered ERC20 item.\n    ERC721_TO_ERC20,\n\n    // 5: provide ERC1155 item to receive offered ERC20 item.\n    ERC1155_TO_ERC20\n}\n\nenum ItemType {\n    // 0: ETH on mainnet, MATIC on polygon, etc.\n    NATIVE,\n\n    // 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)\n    ERC20,\n\n    // 2: ERC721 items\n    ERC721,\n\n    // 3: ERC1155 items\n    ERC1155,\n\n    // 4: ERC721 items where a number of tokenIds are supported\n    ERC721_WITH_CRITERIA,\n\n    // 5: ERC1155 items where a number of ids are supported\n    ERC1155_WITH_CRITERIA\n}\n\nenum Side {\n    // 0: Items that can be spent\n    OFFER,\n\n    // 1: Items that must be received\n    CONSIDERATION\n}\n"
      },
      "lib/solady/src/utils/ECDSA.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Gas optimized ECDSA wrapper.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)\nlibrary ECDSA {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                        CUSTOM ERRORS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The signature is invalid.\n    error InvalidSignature();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The number which `s` must be less than in order for\n    /// the signature to be non-malleable.\n    bytes32 private constant _MALLEABILITY_THRESHOLD_PLUS_ONE =\n        0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                    RECOVERY OPERATIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    // Note: as of Solady version 0.0.68, these functions will\n    // revert upon recovery failure for more safety by default.\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the `signature`.\n    ///\n    /// This function does NOT accept EIP-2098 short form signatures.\n    /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098\n    /// short form signatures instead.\n    function recover(bytes32 hash, bytes memory signature) internal view returns (address result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.\n            mstore(0x40, mload(add(signature, 0x20))) // `r`.\n            mstore(0x60, mload(add(signature, 0x40))) // `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    and(\n                        // If the signature is exactly 65 bytes in length.\n                        eq(mload(signature), 65),\n                        // If `s` in lower half order, such that the signature is not malleable.\n                        lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE)\n                    ), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x00, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            result := mload(0x00)\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            if iszero(returndatasize()) {\n                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x60, 0) // Restore the zero slot.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the `signature`.\n    ///\n    /// This function does NOT accept EIP-2098 short form signatures.\n    /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098\n    /// short form signatures instead.\n    function recoverCalldata(bytes32 hash, bytes calldata signature)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.\n            calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    and(\n                        // If the signature is exactly 65 bytes in length.\n                        eq(signature.length, 65),\n                        // If `s` in lower half order, such that the signature is not malleable.\n                        lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE)\n                    ), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x00, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            result := mload(0x00)\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            if iszero(returndatasize()) {\n                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x60, 0) // Restore the zero slot.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the EIP-2098 short form signature defined by `r` and `vs`.\n    ///\n    /// This function only accepts EIP-2098 short form signatures.\n    /// See: https://eips.ethereum.org/EIPS/eip-2098\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, add(shr(255, vs), 27)) // `v`.\n            mstore(0x40, r)\n            mstore(0x60, shr(1, shl(1, vs))) // `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    // If `s` in lower half order, such that the signature is not malleable.\n                    lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x00, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            result := mload(0x00)\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            if iszero(returndatasize()) {\n                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x60, 0) // Restore the zero slot.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the signature defined by `v`, `r`, `s`.\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, and(v, 0xff))\n            mstore(0x40, r)\n            mstore(0x60, s)\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    // If `s` in lower half order, such that the signature is not malleable.\n                    lt(s, _MALLEABILITY_THRESHOLD_PLUS_ONE), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x00, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            result := mload(0x00)\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            if iszero(returndatasize()) {\n                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x60, 0) // Restore the zero slot.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                   TRY-RECOVER OPERATIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    // WARNING!\n    // These functions will NOT revert upon recovery failure.\n    // Instead, they will return the zero address upon recovery failure.\n    // It is critical that the returned address is NEVER compared against\n    // a zero address (e.g. an uninitialized address variable).\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the `signature`.\n    ///\n    /// This function does NOT accept EIP-2098 short form signatures.\n    /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098\n    /// short form signatures instead.\n    function tryRecover(bytes32 hash, bytes memory signature)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.\n            mstore(0x40, mload(add(signature, 0x20))) // `r`.\n            mstore(0x60, mload(add(signature, 0x40))) // `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    and(\n                        // If the signature is exactly 65 bytes in length.\n                        eq(mload(signature), 65),\n                        // If `s` in lower half order, such that the signature is not malleable.\n                        lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE)\n                    ), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x40, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            mstore(0x60, 0) // Restore the zero slot.\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            result := mload(xor(0x60, returndatasize()))\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the `signature`.\n    ///\n    /// This function does NOT accept EIP-2098 short form signatures.\n    /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098\n    /// short form signatures instead.\n    function tryRecoverCalldata(bytes32 hash, bytes calldata signature)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.\n            calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    and(\n                        // If the signature is exactly 65 bytes in length.\n                        eq(signature.length, 65),\n                        // If `s` in lower half order, such that the signature is not malleable.\n                        lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE)\n                    ), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x40, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            mstore(0x60, 0) // Restore the zero slot.\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            result := mload(xor(0x60, returndatasize()))\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the EIP-2098 short form signature defined by `r` and `vs`.\n    ///\n    /// This function only accepts EIP-2098 short form signatures.\n    /// See: https://eips.ethereum.org/EIPS/eip-2098\n    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, add(shr(255, vs), 27)) // `v`.\n            mstore(0x40, r)\n            mstore(0x60, shr(1, shl(1, vs))) // `s`.\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    // If `s` in lower half order, such that the signature is not malleable.\n                    lt(mload(0x60), _MALLEABILITY_THRESHOLD_PLUS_ONE), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x40, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            mstore(0x60, 0) // Restore the zero slot.\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            result := mload(xor(0x60, returndatasize()))\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Recovers the signer's address from a message digest `hash`,\n    /// and the signature defined by `v`, `r`, `s`.\n    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)\n        internal\n        view\n        returns (address result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n            mstore(0x00, hash)\n            mstore(0x20, and(v, 0xff))\n            mstore(0x40, r)\n            mstore(0x60, s)\n            pop(\n                staticcall(\n                    gas(), // Amount of gas left for the transaction.\n                    // If `s` in lower half order, such that the signature is not malleable.\n                    lt(s, _MALLEABILITY_THRESHOLD_PLUS_ONE), // Address of `ecrecover`.\n                    0x00, // Start of input.\n                    0x80, // Size of input.\n                    0x40, // Start of output.\n                    0x20 // Size of output.\n                )\n            )\n            mstore(0x60, 0) // Restore the zero slot.\n            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n            result := mload(xor(0x60, returndatasize()))\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     HASHING OPERATIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns an Ethereum Signed Message, created from a `hash`.\n    /// This produces a hash corresponding to the one signed with the\n    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)\n    /// JSON-RPC method as part of EIP-191.\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x20, hash) // Store into scratch space for keccak256.\n            mstore(0x00, \"\\x00\\x00\\x00\\x00\\x19Ethereum Signed Message:\\n32\") // 28 bytes.\n            result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`.\n        }\n    }\n\n    /// @dev Returns an Ethereum Signed Message, created from `s`.\n    /// This produces a hash corresponding to the one signed with the\n    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)\n    /// JSON-RPC method as part of EIP-191.\n    /// Note: Supports lengths of `s` up to 999999 bytes.\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let sLength := mload(s)\n            let o := 0x20\n            mstore(o, \"\\x19Ethereum Signed Message:\\n\") // 26 bytes, zero-right-padded.\n            mstore(0x00, 0x00)\n            // Convert the `s.length` to ASCII decimal representation: `base10(s.length)`.\n            for { let temp := sLength } 1 {} {\n                o := sub(o, 1)\n                mstore8(o, add(48, mod(temp, 10)))\n                temp := div(temp, 10)\n                if iszero(temp) { break }\n            }\n            let n := sub(0x3a, o) // Header length: `26 + 32 - o`.\n            // Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes.\n            returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20))\n            mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header.\n            result := keccak256(add(s, sub(0x20, n)), add(n, sLength))\n            mstore(s, sLength) // Restore the length.\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                   EMPTY CALLDATA HELPERS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns an empty calldata bytes.\n    function emptySignature() internal pure returns (bytes calldata signature) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            signature.length := 0\n        }\n    }\n}\n"
      },
      "src/interfaces/ISeaDropTokenContractMetadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\ninterface ISeaDropTokenContractMetadata {\n    /**\n     * @dev Emit an event for token metadata reveals/updates,\n     *      according to EIP-4906.\n     *\n     * @param _fromTokenId The start token id.\n     * @param _toTokenId   The end token id.\n     */\n    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n\n    /**\n     * @dev Emit an event when the URI for the collection-level metadata\n     *      is updated.\n     */\n    event ContractURIUpdated(string newContractURI);\n\n    /**\n     * @dev Emit an event with the previous and new provenance hash after\n     *      being updated.\n     */\n    event ProvenanceHashUpdated(bytes32 previousHash, bytes32 newHash);\n\n    /**\n     * @dev Emit an event when the EIP-2981 royalty info is updated.\n     */\n    event RoyaltyInfoUpdated(address receiver, uint256 basisPoints);\n\n    /**\n     * @notice Throw if the max supply exceeds uint64, a limit\n     *         due to the storage of bit-packed variables.\n     */\n    error CannotExceedMaxSupplyOfUint64(uint256 got);\n\n    /**\n     * @dev Revert with an error when attempting to set the provenance\n     *      hash after the mint has started.\n     */\n    error ProvenanceHashCannotBeSetAfterMintStarted();\n\n    /**\n     * @dev Revert with an error when attempting to set the provenance\n     *      hash after it has already been set.\n     */\n    error ProvenanceHashCannotBeSetAfterAlreadyBeingSet();\n\n    /**\n     * @notice Sets the base URI for the token metadata and emits an event.\n     *\n     * @param tokenURI The new base URI to set.\n     */\n    function setBaseURI(string calldata tokenURI) external;\n\n    /**\n     * @notice Sets the contract URI for contract metadata.\n     *\n     * @param newContractURI The new contract URI.\n     */\n    function setContractURI(string calldata newContractURI) external;\n\n    /**\n     * @notice Sets the provenance hash and emits an event.\n     *\n     *         The provenance hash is used for random reveals, which\n     *         is a hash of the ordered metadata to show it has not been\n     *         modified after mint started.\n     *\n     *         This function will revert after the first item has been minted.\n     *\n     * @param newProvenanceHash The new provenance hash to set.\n     */\n    function setProvenanceHash(bytes32 newProvenanceHash) external;\n\n    /**\n     * @notice Sets the default royalty information.\n     *\n     * Requirements:\n     *\n     * - `receiver` cannot be the zero address.\n     * - `feeNumerator` cannot be greater than the fee denominator of\n     *   10_000 basis points.\n     */\n    function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\n\n    /**\n     * @notice Returns the base URI for token metadata.\n     */\n    function baseURI() external view returns (string memory);\n\n    /**\n     * @notice Returns the contract URI.\n     */\n    function contractURI() external view returns (string memory);\n\n    /**\n     * @notice Returns the provenance hash.\n     *         The provenance hash is used for random reveals, which\n     *         is a hash of the ordered metadata to show it is unmodified\n     *         after mint has started.\n     */\n    function provenanceHash() external view returns (bytes32);\n}\n"
      },
      "lib/solady/src/tokens/ERC2981.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC2981 NFT Royalty Standard implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC2981.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol)\nabstract contract ERC2981 {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The royalty fee numerator exceeds the fee denominator.\n    error RoyaltyOverflow();\n\n    /// @dev The royalty receiver cannot be the zero address.\n    error RoyaltyReceiverIsZeroAddress();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          STORAGE                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The default royalty info is given by:\n    /// ```\n    ///     let packed := sload(_ERC2981_MASTER_SLOT_SEED)\n    ///     let receiver := shr(96, packed)\n    ///     let royaltyFraction := xor(packed, shl(96, receiver))\n    /// ```\n    ///\n    /// The per token royalty info is given by.\n    /// ```\n    ///     mstore(0x00, tokenId)\n    ///     mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n    ///     let packed := sload(keccak256(0x00, 0x40))\n    ///     let receiver := shr(96, packed)\n    ///     let royaltyFraction := xor(packed, shl(96, receiver))\n    /// ```\n    uint256 private constant _ERC2981_MASTER_SLOT_SEED = 0xaa4ec00224afccfdb7;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          ERC2981                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Checks that `_feeDenominator` is non-zero.\n    constructor() {\n        require(_feeDenominator() != 0, \"Fee denominator cannot be zero.\");\n    }\n\n    /// @dev Returns the denominator for the royalty amount.\n    /// Defaults to 10000, which represents fees in basis points.\n    /// Override this function to return a custom amount if needed.\n    function _feeDenominator() internal pure virtual returns (uint96) {\n        return 10000;\n    }\n\n    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n    /// See: https://eips.ethereum.org/EIPS/eip-165\n    /// This function call must use less than 30000 gas.\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let s := shr(224, interfaceId)\n            // ERC165: 0x01ffc9a7, ERC2981: 0x2a55205a.\n            result := or(eq(s, 0x01ffc9a7), eq(s, 0x2a55205a))\n        }\n    }\n\n    /// @dev Returns the `receiver` and `royaltyAmount` for `tokenId` sold at `salePrice`.\n    function royaltyInfo(uint256 tokenId, uint256 salePrice)\n        public\n        view\n        virtual\n        returns (address receiver, uint256 royaltyAmount)\n    {\n        uint256 feeDenominator = _feeDenominator();\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, tokenId)\n            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n            let packed := sload(keccak256(0x00, 0x40))\n            receiver := shr(96, packed)\n            if iszero(receiver) {\n                packed := sload(mload(0x20))\n                receiver := shr(96, packed)\n            }\n            let x := salePrice\n            let y := xor(packed, shl(96, receiver)) // `feeNumerator`.\n            // Overflow check, equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\n            // Out-of-gas revert. Should not be triggered in practice, but included for safety.\n            returndatacopy(returndatasize(), returndatasize(), mul(y, gt(x, div(not(0), y))))\n            royaltyAmount := div(mul(x, y), feeDenominator)\n        }\n    }\n\n    /// @dev Sets the default royalty `receiver` and `feeNumerator`.\n    ///\n    /// Requirements:\n    /// - `receiver` must not be the zero address.\n    /// - `feeNumerator` must not be greater than the fee denominator.\n    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n        uint256 feeDenominator = _feeDenominator();\n        /// @solidity memory-safe-assembly\n        assembly {\n            feeNumerator := shr(160, shl(160, feeNumerator))\n            if gt(feeNumerator, feeDenominator) {\n                mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.\n                revert(0x1c, 0x04)\n            }\n            let packed := shl(96, receiver)\n            if iszero(packed) {\n                mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            sstore(_ERC2981_MASTER_SLOT_SEED, or(packed, feeNumerator))\n        }\n    }\n\n    /// @dev Sets the default royalty `receiver` and `feeNumerator` to zero.\n    function _deleteDefaultRoyalty() internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            sstore(_ERC2981_MASTER_SLOT_SEED, 0)\n        }\n    }\n\n    /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId`.\n    ///\n    /// Requirements:\n    /// - `receiver` must not be the zero address.\n    /// - `feeNumerator` must not be greater than the fee denominator.\n    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)\n        internal\n        virtual\n    {\n        uint256 feeDenominator = _feeDenominator();\n        /// @solidity memory-safe-assembly\n        assembly {\n            feeNumerator := shr(160, shl(160, feeNumerator))\n            if gt(feeNumerator, feeDenominator) {\n                mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.\n                revert(0x1c, 0x04)\n            }\n            let packed := shl(96, receiver)\n            if iszero(packed) {\n                mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x00, tokenId)\n            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n            sstore(keccak256(0x00, 0x40), or(packed, feeNumerator))\n        }\n    }\n\n    /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId` to zero.\n    function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, tokenId)\n            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n            sstore(keccak256(0x00, 0x40), 0)\n        }\n    }\n}\n"
      },
      "lib/solady/src/auth/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)\n/// @dev While the ownable portion follows\n/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,\n/// the nomenclature for the 2-step ownership handover may be unique to this codebase.\nabstract contract Ownable {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The caller is not authorized to call the function.\n    error Unauthorized();\n\n    /// @dev The `newOwner` cannot be the zero address.\n    error NewOwnerIsZeroAddress();\n\n    /// @dev The `pendingOwner` does not have a valid handover request.\n    error NoHandoverRequest();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                           EVENTS                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.\n    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be\n    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),\n    /// despite it not being as lightweight as a single argument event.\n    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);\n\n    /// @dev An ownership handover to `pendingOwner` has been requested.\n    event OwnershipHandoverRequested(address indexed pendingOwner);\n\n    /// @dev The ownership handover to `pendingOwner` has been canceled.\n    event OwnershipHandoverCanceled(address indexed pendingOwner);\n\n    /// @dev `keccak256(bytes(\"OwnershipTransferred(address,address)\"))`.\n    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =\n        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;\n\n    /// @dev `keccak256(bytes(\"OwnershipHandoverRequested(address)\"))`.\n    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =\n        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;\n\n    /// @dev `keccak256(bytes(\"OwnershipHandoverCanceled(address)\"))`.\n    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =\n        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          STORAGE                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The owner slot is given by: `not(_OWNER_SLOT_NOT)`.\n    /// It is intentionally chosen to be a high value\n    /// to avoid collision with lower slots.\n    /// The choice of manual storage layout is to enable compatibility\n    /// with both regular and upgradeable contracts.\n    uint256 private constant _OWNER_SLOT_NOT = 0x8b78c6d8;\n\n    /// The ownership handover slot of `newOwner` is given by:\n    /// ```\n    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))\n    ///     let handoverSlot := keccak256(0x00, 0x20)\n    /// ```\n    /// It stores the expiry timestamp of the two-step ownership handover.\n    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     INTERNAL FUNCTIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Initializes the owner directly without authorization guard.\n    /// This function must be called upon initialization,\n    /// regardless of whether the contract is upgradeable or not.\n    /// This is to enable generalization to both regular and upgradeable contracts,\n    /// and to save gas in case the initial owner is not the caller.\n    /// For performance reasons, this function will not check if there\n    /// is an existing owner.\n    function _initializeOwner(address newOwner) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Clean the upper 96 bits.\n            newOwner := shr(96, shl(96, newOwner))\n            // Store the new value.\n            sstore(not(_OWNER_SLOT_NOT), newOwner)\n            // Emit the {OwnershipTransferred} event.\n            log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n        }\n    }\n\n    /// @dev Sets the owner directly without authorization guard.\n    function _setOwner(address newOwner) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ownerSlot := not(_OWNER_SLOT_NOT)\n            // Clean the upper 96 bits.\n            newOwner := shr(96, shl(96, newOwner))\n            // Emit the {OwnershipTransferred} event.\n            log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n            // Store the new value.\n            sstore(ownerSlot, newOwner)\n        }\n    }\n\n    /// @dev Throws if the sender is not the owner.\n    function _checkOwner() internal view virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // If the caller is not the stored owner, revert.\n            if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {\n                mstore(0x00, 0x82b42900) // `Unauthorized()`.\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  PUBLIC UPDATE FUNCTIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Allows the owner to transfer the ownership to `newOwner`.\n    function transferOwnership(address newOwner) public payable virtual onlyOwner {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(shl(96, newOwner)) {\n                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.\n                revert(0x1c, 0x04)\n            }\n        }\n        _setOwner(newOwner);\n    }\n\n    /// @dev Allows the owner to renounce their ownership.\n    function renounceOwnership() public payable virtual onlyOwner {\n        _setOwner(address(0));\n    }\n\n    /// @dev Request a two-step ownership handover to the caller.\n    /// The request will automatically expire in 48 hours (172800 seconds) by default.\n    function requestOwnershipHandover() public payable virtual {\n        unchecked {\n            uint256 expires = block.timestamp + ownershipHandoverValidFor();\n            /// @solidity memory-safe-assembly\n            assembly {\n                // Compute and set the handover slot to `expires`.\n                mstore(0x0c, _HANDOVER_SLOT_SEED)\n                mstore(0x00, caller())\n                sstore(keccak256(0x0c, 0x20), expires)\n                // Emit the {OwnershipHandoverRequested} event.\n                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())\n            }\n        }\n    }\n\n    /// @dev Cancels the two-step ownership handover to the caller, if any.\n    function cancelOwnershipHandover() public payable virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute and set the handover slot to 0.\n            mstore(0x0c, _HANDOVER_SLOT_SEED)\n            mstore(0x00, caller())\n            sstore(keccak256(0x0c, 0x20), 0)\n            // Emit the {OwnershipHandoverCanceled} event.\n            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())\n        }\n    }\n\n    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.\n    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.\n    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute and set the handover slot to 0.\n            mstore(0x0c, _HANDOVER_SLOT_SEED)\n            mstore(0x00, pendingOwner)\n            let handoverSlot := keccak256(0x0c, 0x20)\n            // If the handover does not exist, or has expired.\n            if gt(timestamp(), sload(handoverSlot)) {\n                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.\n                revert(0x1c, 0x04)\n            }\n            // Set the handover slot to 0.\n            sstore(handoverSlot, 0)\n        }\n        _setOwner(pendingOwner);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                   PUBLIC READ FUNCTIONS                    */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the owner of the contract.\n    function owner() public view virtual returns (address result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := sload(not(_OWNER_SLOT_NOT))\n        }\n    }\n\n    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.\n    function ownershipHandoverExpiresAt(address pendingOwner)\n        public\n        view\n        virtual\n        returns (uint256 result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the handover slot.\n            mstore(0x0c, _HANDOVER_SLOT_SEED)\n            mstore(0x00, pendingOwner)\n            // Load the handover slot.\n            result := sload(keccak256(0x0c, 0x20))\n        }\n    }\n\n    /// @dev Returns how long a two-step ownership handover is valid for in seconds.\n    function ownershipHandoverValidFor() public view virtual returns (uint64) {\n        return 48 * 3600;\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         MODIFIERS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Marks a function as only callable by the owner.\n    modifier onlyOwner() virtual {\n        _checkOwner();\n        _;\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.19;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (address(this).code.length == 0 && _initialized == 1),\n            \"Initializable: contract is already initialized\"\n        );\n        _initialized = 1;\n        if (isTopLevelCall) {\n            _initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            _initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: setting the version to 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n        _initialized = version;\n        _initializing = true;\n        _;\n        _initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _initializing;\n    }\n}\n"
      },
      "src/lib/SeaDropErrorsAndEvents.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { CreatorPayout, PublicDrop } from \"./ERC721SeaDropStructs.sol\";\n\ninterface SeaDropErrorsAndEvents {\n    /**\n     * @notice The SeaDrop token types, emitted as part of\n     *         `event SeaDropTokenDeployed`.\n     */\n    enum SEADROP_TOKEN_TYPE {\n        ERC721_STANDARD,\n        ERC721_CLONE,\n        ERC721_UPGRADEABLE,\n        ERC1155_STANDARD,\n        ERC1155_CLONE,\n        ERC1155_UPGRADEABLE\n    }\n\n    /**\n     * @notice An event to signify that a SeaDrop token contract was deployed.\n     */\n    event SeaDropTokenDeployed(SEADROP_TOKEN_TYPE tokenType);\n\n    /**\n     * @notice Revert with an error if the function selector is not supported.\n     */\n    error UnsupportedFunctionSelector(bytes4 selector);\n\n    /**\n     * @dev Revert with an error if the drop stage is not active.\n     */\n    error NotActive(\n        uint256 currentTimestamp,\n        uint256 startTimestamp,\n        uint256 endTimestamp\n    );\n\n    /**\n     * @dev Revert with an error if the mint quantity exceeds the max allowed\n     *      to be minted per wallet.\n     */\n    error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);\n\n    /**\n     * @dev Revert with an error if the mint quantity exceeds the max token\n     *      supply.\n     */\n    error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n    /**\n     * @dev Revert with an error if the mint quantity exceeds the max token\n     *      supply for the stage.\n     *      Note: The `maxTokenSupplyForStage` for public mint is\n     *      always `type(uint).max`.\n     */\n    error MintQuantityExceedsMaxTokenSupplyForStage(\n        uint256 total,\n        uint256 maxTokenSupplyForStage\n    );\n\n    /**\n     * @dev Revert if the fee recipient is the zero address.\n     */\n    error FeeRecipientCannotBeZeroAddress();\n\n    /**\n     * @dev Revert if the fee recipient is not already included.\n     */\n    error FeeRecipientNotPresent();\n\n    /**\n     * @dev Revert if the fee basis points is greater than 10_000.\n     */\n    error InvalidFeeBps(uint256 feeBps);\n\n    /**\n     * @dev Revert if the fee recipient is already included.\n     */\n    error DuplicateFeeRecipient();\n\n    /**\n     * @dev Revert if the fee recipient is restricted and not allowed.\n     */\n    error FeeRecipientNotAllowed(address got);\n\n    /**\n     * @dev Revert if the creator payout address is the zero address.\n     */\n    error CreatorPayoutAddressCannotBeZeroAddress();\n\n    /**\n     * @dev Revert if the creator payouts are not set.\n     */\n    error CreatorPayoutsNotSet();\n\n    /**\n     * @dev Revert if the creator payout basis points are zero.\n     */\n    error CreatorPayoutBasisPointsCannotBeZero();\n\n    /**\n     * @dev Revert if the total basis points for the creator payouts\n     *      don't equal exactly 10_000.\n     */\n    error InvalidCreatorPayoutTotalBasisPoints(\n        uint256 totalReceivedBasisPoints\n    );\n\n    /**\n     * @dev Revert if the creator payout basis points don't add up to 10_000.\n     */\n    error InvalidCreatorPayoutBasisPoints(uint256 totalReceivedBasisPoints);\n\n    /**\n     * @dev Revert with an error if the allow list proof is invalid.\n     */\n    error InvalidProof();\n\n    /**\n     * @dev Revert if a supplied signer address is the zero address.\n     */\n    error SignerCannotBeZeroAddress();\n\n    /**\n     * @dev Revert with an error if a signer is not included in\n     *      the enumeration when removing.\n     */\n    error SignerNotPresent();\n\n    /**\n     * @dev Revert with an error if a payer is not included in\n     *      the enumeration when removing.\n     */\n    error PayerNotPresent();\n\n    /**\n     * @dev Revert with an error if a payer is already included in mapping\n     *      when adding.\n     */\n    error DuplicatePayer();\n\n    /**\n     * @dev Revert with an error if a signer is already included in mapping\n     *      when adding.\n     */\n    error DuplicateSigner();\n\n    /**\n     * @dev Revert with an error if the payer is not allowed. The minter must\n     *      pay for their own mint.\n     */\n    error PayerNotAllowed(address got);\n\n    /**\n     * @dev Revert if a supplied payer address is the zero address.\n     */\n    error PayerCannotBeZeroAddress();\n\n    /**\n     * @dev Revert if the start time is greater than the end time.\n     */\n    error InvalidStartAndEndTime(uint256 startTime, uint256 endTime);\n\n    /**\n     * @dev Revert with an error if the signer payment token is not the same.\n     */\n    error InvalidSignedPaymentToken(address got, address want);\n\n    /**\n     * @dev Revert with an error if supplied signed mint price is less than\n     *      the minimum specified.\n     */\n    error InvalidSignedMintPrice(\n        address paymentToken,\n        uint256 got,\n        uint256 minimum\n    );\n\n    /**\n     * @dev Revert with an error if supplied signed maxTotalMintableByWallet\n     *      is greater than the maximum specified.\n     */\n    error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);\n\n    /**\n     * @dev Revert with an error if supplied signed\n     *      maxTotalMintableByWalletPerToken is greater than the maximum\n     *      specified.\n     */\n    error InvalidSignedMaxTotalMintableByWalletPerToken(\n        uint256 got,\n        uint256 maximum\n    );\n\n    /**\n     * @dev Revert with an error if the fromTokenId is not within range.\n     */\n    error InvalidSignedFromTokenId(uint256 got, uint256 minimum);\n\n    /**\n     * @dev Revert with an error if the toTokenId is not within range.\n     */\n    error InvalidSignedToTokenId(uint256 got, uint256 maximum);\n\n    /**\n     * @dev Revert with an error if supplied signed start time is less than\n     *      the minimum specified.\n     */\n    error InvalidSignedStartTime(uint256 got, uint256 minimum);\n\n    /**\n     * @dev Revert with an error if supplied signed end time is greater than\n     *      the maximum specified.\n     */\n    error InvalidSignedEndTime(uint256 got, uint256 maximum);\n\n    /**\n     * @dev Revert with an error if supplied signed maxTokenSupplyForStage\n     *      is greater than the maximum specified.\n     */\n    error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);\n\n    /**\n     * @dev Revert with an error if supplied signed feeBps is greater than\n     *      the maximum specified, or less than the minimum.\n     */\n    error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);\n\n    /**\n     * @dev Revert with an error if signed mint did not specify to restrict\n     *      fee recipients.\n     */\n    error SignedMintsMustRestrictFeeRecipients();\n\n    /**\n     * @dev Revert with an error if a signature for a signed mint has already\n     *      been used.\n     */\n    error SignatureAlreadyUsed();\n\n    /**\n     * @dev Revert with an error if the contract has no balance to withdraw.\n     */\n    error NoBalanceToWithdraw();\n\n    /**\n     * @dev Revert with an error if the caller is not an allowed Seaport.\n     */\n    error InvalidCallerOnlyAllowedSeaport(address caller);\n\n    /**\n     * @dev Revert with an error if the order does not have the ERC1155 magic\n     *      consideration item to signify a consecutive mint.\n     */\n    error MustSpecifyERC1155ConsiderationItemForSeaDropMint();\n\n    /**\n     * @dev Revert with an error if the extra data version is not supported.\n     */\n    error UnsupportedExtraDataVersion(uint8 version);\n\n    /**\n     * @dev Revert with an error if the extra data encoding is not supported.\n     */\n    error InvalidExtraDataEncoding(uint8 version);\n\n    /**\n     * @dev Revert with an error if the provided substandard is not supported.\n     */\n    error InvalidSubstandard(uint8 substandard);\n\n    /**\n     * @dev Revert with an error if the implementation contract is called without\n     *      delegatecall.\n     */\n    error OnlyDelegateCalled();\n\n    /**\n     * @dev Revert with an error if the provided allowed Seaport is the\n     *      zero address.\n     */\n    error AllowedSeaportCannotBeZeroAddress();\n\n    /**\n     * @dev Emit an event when allowed Seaport contracts are updated.\n     */\n    event AllowedSeaportUpdated(address[] allowedSeaport);\n\n    /**\n     * @dev An event with details of a SeaDrop mint, for analytical purposes.\n     *\n     * @param payer          The address who payed for the tx.\n     * @param dropStageIndex The drop stage index. Items minted through\n     *                       public mint have dropStageIndex of 0\n     */\n    event SeaDropMint(address payer, uint256 dropStageIndex);\n\n    /**\n     * @dev An event with updated allow list data.\n     *\n     * @param previousMerkleRoot The previous allow list merkle root.\n     * @param newMerkleRoot      The new allow list merkle root.\n     * @param publicKeyURI       If the allow list is encrypted, the public key\n     *                           URIs that can decrypt the list.\n     *                           Empty if unencrypted.\n     * @param allowListURI       The URI for the allow list.\n     */\n    event AllowListUpdated(\n        bytes32 indexed previousMerkleRoot,\n        bytes32 indexed newMerkleRoot,\n        string[] publicKeyURI,\n        string allowListURI\n    );\n\n    /**\n     * @dev An event with updated drop URI.\n     */\n    event DropURIUpdated(string newDropURI);\n\n    /**\n     * @dev An event with the updated creator payout address.\n     */\n    event CreatorPayoutsUpdated(CreatorPayout[] creatorPayouts);\n\n    /**\n     * @dev An event with the updated allowed fee recipient.\n     */\n    event AllowedFeeRecipientUpdated(\n        address indexed feeRecipient,\n        bool indexed allowed\n    );\n\n    /**\n     * @dev An event with the updated signer.\n     */\n    event SignerUpdated(address indexed signer, bool indexed allowed);\n\n    /**\n     * @dev An event with the updated payer.\n     */\n    event PayerUpdated(address indexed payer, bool indexed allowed);\n}\n"
      },
      "lib/seaport/lib/seaport-types/src/helpers/PointerLibraries.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\ntype CalldataPointer is uint256;\n\ntype ReturndataPointer is uint256;\n\ntype MemoryPointer is uint256;\n\nusing CalldataPointerLib for CalldataPointer global;\nusing MemoryPointerLib for MemoryPointer global;\nusing ReturndataPointerLib for ReturndataPointer global;\n\nusing CalldataReaders for CalldataPointer global;\nusing ReturndataReaders for ReturndataPointer global;\nusing MemoryReaders for MemoryPointer global;\nusing MemoryWriters for MemoryPointer global;\n\nCalldataPointer constant CalldataStart = CalldataPointer.wrap(0x04);\nMemoryPointer constant FreeMemoryPPtr = MemoryPointer.wrap(0x40);\nuint256 constant IdentityPrecompileAddress = 0x4;\nuint256 constant OffsetOrLengthMask = 0xffffffff;\nuint256 constant _OneWord = 0x20;\nuint256 constant _FreeMemoryPointerSlot = 0x40;\n\n/// @dev Allocates `size` bytes in memory by increasing the free memory pointer\n///    and returns the memory pointer to the first byte of the allocated region.\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction malloc(uint256 size) pure returns (MemoryPointer mPtr) {\n    assembly {\n        mPtr := mload(_FreeMemoryPointerSlot)\n        mstore(_FreeMemoryPointerSlot, add(mPtr, size))\n    }\n}\n\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction getFreeMemoryPointer() pure returns (MemoryPointer mPtr) {\n    mPtr = FreeMemoryPPtr.readMemoryPointer();\n}\n\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction setFreeMemoryPointer(MemoryPointer mPtr) pure {\n    FreeMemoryPPtr.write(mPtr);\n}\n\nlibrary CalldataPointerLib {\n    function lt(\n        CalldataPointer a,\n        CalldataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := lt(a, b)\n        }\n    }\n\n    function gt(\n        CalldataPointer a,\n        CalldataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := gt(a, b)\n        }\n    }\n\n    function eq(\n        CalldataPointer a,\n        CalldataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := eq(a, b)\n        }\n    }\n\n    function isNull(CalldataPointer a) internal pure returns (bool b) {\n        assembly {\n            b := iszero(a)\n        }\n    }\n\n    /// @dev Resolves an offset stored at `cdPtr + headOffset` to a calldata.\n    ///      pointer `cdPtr` must point to some parent object with a dynamic\n    ///      type's head stored at `cdPtr + headOffset`.\n    function pptr(\n        CalldataPointer cdPtr,\n        uint256 headOffset\n    ) internal pure returns (CalldataPointer cdPtrChild) {\n        cdPtrChild = cdPtr.offset(\n            cdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask\n        );\n    }\n\n    /// @dev Resolves an offset stored at `cdPtr` to a calldata pointer.\n    ///      `cdPtr` must point to some parent object with a dynamic type as its\n    ///      first member, e.g. `struct { bytes data; }`\n    function pptr(\n        CalldataPointer cdPtr\n    ) internal pure returns (CalldataPointer cdPtrChild) {\n        cdPtrChild = cdPtr.offset(cdPtr.readUint256() & OffsetOrLengthMask);\n    }\n\n    /// @dev Returns the calldata pointer one word after `cdPtr`.\n    function next(\n        CalldataPointer cdPtr\n    ) internal pure returns (CalldataPointer cdPtrNext) {\n        assembly {\n            cdPtrNext := add(cdPtr, _OneWord)\n        }\n    }\n\n    /// @dev Returns the calldata pointer `_offset` bytes after `cdPtr`.\n    function offset(\n        CalldataPointer cdPtr,\n        uint256 _offset\n    ) internal pure returns (CalldataPointer cdPtrNext) {\n        assembly {\n            cdPtrNext := add(cdPtr, _offset)\n        }\n    }\n\n    /// @dev Copies `size` bytes from calldata starting at `src` to memory at\n    ///      `dst`.\n    function copy(\n        CalldataPointer src,\n        MemoryPointer dst,\n        uint256 size\n    ) internal pure {\n        assembly {\n            calldatacopy(dst, src, size)\n        }\n    }\n}\n\nlibrary ReturndataPointerLib {\n    function lt(\n        ReturndataPointer a,\n        ReturndataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := lt(a, b)\n        }\n    }\n\n    function gt(\n        ReturndataPointer a,\n        ReturndataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := gt(a, b)\n        }\n    }\n\n    function eq(\n        ReturndataPointer a,\n        ReturndataPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := eq(a, b)\n        }\n    }\n\n    function isNull(ReturndataPointer a) internal pure returns (bool b) {\n        assembly {\n            b := iszero(a)\n        }\n    }\n\n    /// @dev Resolves an offset stored at `rdPtr + headOffset` to a returndata\n    ///      pointer. `rdPtr` must point to some parent object with a dynamic\n    ///      type's head stored at `rdPtr + headOffset`.\n    function pptr(\n        ReturndataPointer rdPtr,\n        uint256 headOffset\n    ) internal pure returns (ReturndataPointer rdPtrChild) {\n        rdPtrChild = rdPtr.offset(\n            rdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask\n        );\n    }\n\n    /// @dev Resolves an offset stored at `rdPtr` to a returndata pointer.\n    ///    `rdPtr` must point to some parent object with a dynamic type as its\n    ///    first member, e.g. `struct { bytes data; }`\n    function pptr(\n        ReturndataPointer rdPtr\n    ) internal pure returns (ReturndataPointer rdPtrChild) {\n        rdPtrChild = rdPtr.offset(rdPtr.readUint256() & OffsetOrLengthMask);\n    }\n\n    /// @dev Returns the returndata pointer one word after `cdPtr`.\n    function next(\n        ReturndataPointer rdPtr\n    ) internal pure returns (ReturndataPointer rdPtrNext) {\n        assembly {\n            rdPtrNext := add(rdPtr, _OneWord)\n        }\n    }\n\n    /// @dev Returns the returndata pointer `_offset` bytes after `cdPtr`.\n    function offset(\n        ReturndataPointer rdPtr,\n        uint256 _offset\n    ) internal pure returns (ReturndataPointer rdPtrNext) {\n        assembly {\n            rdPtrNext := add(rdPtr, _offset)\n        }\n    }\n\n    /// @dev Copies `size` bytes from returndata starting at `src` to memory at\n    /// `dst`.\n    function copy(\n        ReturndataPointer src,\n        MemoryPointer dst,\n        uint256 size\n    ) internal pure {\n        assembly {\n            returndatacopy(dst, src, size)\n        }\n    }\n}\n\nlibrary MemoryPointerLib {\n    function copy(\n        MemoryPointer src,\n        MemoryPointer dst,\n        uint256 size\n    ) internal view {\n        assembly {\n            let success := staticcall(\n                gas(),\n                IdentityPrecompileAddress,\n                src,\n                size,\n                dst,\n                size\n            )\n            if or(iszero(returndatasize()), iszero(success)) {\n                revert(0, 0)\n            }\n        }\n    }\n\n    function lt(\n        MemoryPointer a,\n        MemoryPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := lt(a, b)\n        }\n    }\n\n    function gt(\n        MemoryPointer a,\n        MemoryPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := gt(a, b)\n        }\n    }\n\n    function eq(\n        MemoryPointer a,\n        MemoryPointer b\n    ) internal pure returns (bool c) {\n        assembly {\n            c := eq(a, b)\n        }\n    }\n\n    function isNull(MemoryPointer a) internal pure returns (bool b) {\n        assembly {\n            b := iszero(a)\n        }\n    }\n\n    function hash(\n        MemoryPointer ptr,\n        uint256 length\n    ) internal pure returns (bytes32 _hash) {\n        assembly {\n            _hash := keccak256(ptr, length)\n        }\n    }\n\n    /// @dev Returns the memory pointer one word after `mPtr`.\n    function next(\n        MemoryPointer mPtr\n    ) internal pure returns (MemoryPointer mPtrNext) {\n        assembly {\n            mPtrNext := add(mPtr, _OneWord)\n        }\n    }\n\n    /// @dev Returns the memory pointer `_offset` bytes after `mPtr`.\n    function offset(\n        MemoryPointer mPtr,\n        uint256 _offset\n    ) internal pure returns (MemoryPointer mPtrNext) {\n        assembly {\n            mPtrNext := add(mPtr, _offset)\n        }\n    }\n\n    /// @dev Resolves a pointer at `mPtr + headOffset` to a memory\n    ///    pointer. `mPtr` must point to some parent object with a dynamic\n    ///    type's pointer stored at `mPtr + headOffset`.\n    function pptr(\n        MemoryPointer mPtr,\n        uint256 headOffset\n    ) internal pure returns (MemoryPointer mPtrChild) {\n        mPtrChild = mPtr.offset(headOffset).readMemoryPointer();\n    }\n\n    /// @dev Resolves a pointer stored at `mPtr` to a memory pointer.\n    ///    `mPtr` must point to some parent object with a dynamic type as its\n    ///    first member, e.g. `struct { bytes data; }`\n    function pptr(\n        MemoryPointer mPtr\n    ) internal pure returns (MemoryPointer mPtrChild) {\n        mPtrChild = mPtr.readMemoryPointer();\n    }\n}\n\nlibrary CalldataReaders {\n    /// @dev Reads the value at `cdPtr` and applies a mask to return only the\n    ///    last 4 bytes.\n    function readMaskedUint256(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint256 value) {\n        value = cdPtr.readUint256() & OffsetOrLengthMask;\n    }\n\n    /// @dev Reads the bool at `cdPtr` in calldata.\n    function readBool(\n        CalldataPointer cdPtr\n    ) internal pure returns (bool value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the address at `cdPtr` in calldata.\n    function readAddress(\n        CalldataPointer cdPtr\n    ) internal pure returns (address value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes1 at `cdPtr` in calldata.\n    function readBytes1(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes1 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes2 at `cdPtr` in calldata.\n    function readBytes2(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes2 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes3 at `cdPtr` in calldata.\n    function readBytes3(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes3 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes4 at `cdPtr` in calldata.\n    function readBytes4(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes4 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes5 at `cdPtr` in calldata.\n    function readBytes5(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes5 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes6 at `cdPtr` in calldata.\n    function readBytes6(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes6 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes7 at `cdPtr` in calldata.\n    function readBytes7(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes7 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes8 at `cdPtr` in calldata.\n    function readBytes8(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes8 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes9 at `cdPtr` in calldata.\n    function readBytes9(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes9 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes10 at `cdPtr` in calldata.\n    function readBytes10(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes10 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes11 at `cdPtr` in calldata.\n    function readBytes11(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes11 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes12 at `cdPtr` in calldata.\n    function readBytes12(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes12 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes13 at `cdPtr` in calldata.\n    function readBytes13(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes13 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes14 at `cdPtr` in calldata.\n    function readBytes14(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes14 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes15 at `cdPtr` in calldata.\n    function readBytes15(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes15 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes16 at `cdPtr` in calldata.\n    function readBytes16(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes16 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes17 at `cdPtr` in calldata.\n    function readBytes17(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes17 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes18 at `cdPtr` in calldata.\n    function readBytes18(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes18 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes19 at `cdPtr` in calldata.\n    function readBytes19(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes19 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes20 at `cdPtr` in calldata.\n    function readBytes20(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes20 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes21 at `cdPtr` in calldata.\n    function readBytes21(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes21 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes22 at `cdPtr` in calldata.\n    function readBytes22(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes22 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes23 at `cdPtr` in calldata.\n    function readBytes23(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes23 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes24 at `cdPtr` in calldata.\n    function readBytes24(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes24 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes25 at `cdPtr` in calldata.\n    function readBytes25(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes25 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes26 at `cdPtr` in calldata.\n    function readBytes26(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes26 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes27 at `cdPtr` in calldata.\n    function readBytes27(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes27 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes28 at `cdPtr` in calldata.\n    function readBytes28(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes28 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes29 at `cdPtr` in calldata.\n    function readBytes29(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes29 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes30 at `cdPtr` in calldata.\n    function readBytes30(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes30 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes31 at `cdPtr` in calldata.\n    function readBytes31(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes31 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the bytes32 at `cdPtr` in calldata.\n    function readBytes32(\n        CalldataPointer cdPtr\n    ) internal pure returns (bytes32 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint8 at `cdPtr` in calldata.\n    function readUint8(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint8 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint16 at `cdPtr` in calldata.\n    function readUint16(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint16 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint24 at `cdPtr` in calldata.\n    function readUint24(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint24 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint32 at `cdPtr` in calldata.\n    function readUint32(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint32 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint40 at `cdPtr` in calldata.\n    function readUint40(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint40 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint48 at `cdPtr` in calldata.\n    function readUint48(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint48 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint56 at `cdPtr` in calldata.\n    function readUint56(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint56 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint64 at `cdPtr` in calldata.\n    function readUint64(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint64 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint72 at `cdPtr` in calldata.\n    function readUint72(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint72 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint80 at `cdPtr` in calldata.\n    function readUint80(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint80 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint88 at `cdPtr` in calldata.\n    function readUint88(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint88 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint96 at `cdPtr` in calldata.\n    function readUint96(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint96 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint104 at `cdPtr` in calldata.\n    function readUint104(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint104 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint112 at `cdPtr` in calldata.\n    function readUint112(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint112 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint120 at `cdPtr` in calldata.\n    function readUint120(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint120 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint128 at `cdPtr` in calldata.\n    function readUint128(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint128 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint136 at `cdPtr` in calldata.\n    function readUint136(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint136 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint144 at `cdPtr` in calldata.\n    function readUint144(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint144 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint152 at `cdPtr` in calldata.\n    function readUint152(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint152 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint160 at `cdPtr` in calldata.\n    function readUint160(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint160 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint168 at `cdPtr` in calldata.\n    function readUint168(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint168 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint176 at `cdPtr` in calldata.\n    function readUint176(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint176 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint184 at `cdPtr` in calldata.\n    function readUint184(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint184 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint192 at `cdPtr` in calldata.\n    function readUint192(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint192 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint200 at `cdPtr` in calldata.\n    function readUint200(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint200 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint208 at `cdPtr` in calldata.\n    function readUint208(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint208 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint216 at `cdPtr` in calldata.\n    function readUint216(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint216 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint224 at `cdPtr` in calldata.\n    function readUint224(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint224 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint232 at `cdPtr` in calldata.\n    function readUint232(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint232 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint240 at `cdPtr` in calldata.\n    function readUint240(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint240 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint248 at `cdPtr` in calldata.\n    function readUint248(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint248 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the uint256 at `cdPtr` in calldata.\n    function readUint256(\n        CalldataPointer cdPtr\n    ) internal pure returns (uint256 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int8 at `cdPtr` in calldata.\n    function readInt8(\n        CalldataPointer cdPtr\n    ) internal pure returns (int8 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int16 at `cdPtr` in calldata.\n    function readInt16(\n        CalldataPointer cdPtr\n    ) internal pure returns (int16 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int24 at `cdPtr` in calldata.\n    function readInt24(\n        CalldataPointer cdPtr\n    ) internal pure returns (int24 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int32 at `cdPtr` in calldata.\n    function readInt32(\n        CalldataPointer cdPtr\n    ) internal pure returns (int32 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int40 at `cdPtr` in calldata.\n    function readInt40(\n        CalldataPointer cdPtr\n    ) internal pure returns (int40 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int48 at `cdPtr` in calldata.\n    function readInt48(\n        CalldataPointer cdPtr\n    ) internal pure returns (int48 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int56 at `cdPtr` in calldata.\n    function readInt56(\n        CalldataPointer cdPtr\n    ) internal pure returns (int56 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int64 at `cdPtr` in calldata.\n    function readInt64(\n        CalldataPointer cdPtr\n    ) internal pure returns (int64 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int72 at `cdPtr` in calldata.\n    function readInt72(\n        CalldataPointer cdPtr\n    ) internal pure returns (int72 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int80 at `cdPtr` in calldata.\n    function readInt80(\n        CalldataPointer cdPtr\n    ) internal pure returns (int80 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int88 at `cdPtr` in calldata.\n    function readInt88(\n        CalldataPointer cdPtr\n    ) internal pure returns (int88 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int96 at `cdPtr` in calldata.\n    function readInt96(\n        CalldataPointer cdPtr\n    ) internal pure returns (int96 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int104 at `cdPtr` in calldata.\n    function readInt104(\n        CalldataPointer cdPtr\n    ) internal pure returns (int104 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int112 at `cdPtr` in calldata.\n    function readInt112(\n        CalldataPointer cdPtr\n    ) internal pure returns (int112 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int120 at `cdPtr` in calldata.\n    function readInt120(\n        CalldataPointer cdPtr\n    ) internal pure returns (int120 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int128 at `cdPtr` in calldata.\n    function readInt128(\n        CalldataPointer cdPtr\n    ) internal pure returns (int128 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int136 at `cdPtr` in calldata.\n    function readInt136(\n        CalldataPointer cdPtr\n    ) internal pure returns (int136 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int144 at `cdPtr` in calldata.\n    function readInt144(\n        CalldataPointer cdPtr\n    ) internal pure returns (int144 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int152 at `cdPtr` in calldata.\n    function readInt152(\n        CalldataPointer cdPtr\n    ) internal pure returns (int152 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int160 at `cdPtr` in calldata.\n    function readInt160(\n        CalldataPointer cdPtr\n    ) internal pure returns (int160 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int168 at `cdPtr` in calldata.\n    function readInt168(\n        CalldataPointer cdPtr\n    ) internal pure returns (int168 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int176 at `cdPtr` in calldata.\n    function readInt176(\n        CalldataPointer cdPtr\n    ) internal pure returns (int176 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int184 at `cdPtr` in calldata.\n    function readInt184(\n        CalldataPointer cdPtr\n    ) internal pure returns (int184 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int192 at `cdPtr` in calldata.\n    function readInt192(\n        CalldataPointer cdPtr\n    ) internal pure returns (int192 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int200 at `cdPtr` in calldata.\n    function readInt200(\n        CalldataPointer cdPtr\n    ) internal pure returns (int200 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int208 at `cdPtr` in calldata.\n    function readInt208(\n        CalldataPointer cdPtr\n    ) internal pure returns (int208 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int216 at `cdPtr` in calldata.\n    function readInt216(\n        CalldataPointer cdPtr\n    ) internal pure returns (int216 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int224 at `cdPtr` in calldata.\n    function readInt224(\n        CalldataPointer cdPtr\n    ) internal pure returns (int224 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int232 at `cdPtr` in calldata.\n    function readInt232(\n        CalldataPointer cdPtr\n    ) internal pure returns (int232 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int240 at `cdPtr` in calldata.\n    function readInt240(\n        CalldataPointer cdPtr\n    ) internal pure returns (int240 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int248 at `cdPtr` in calldata.\n    function readInt248(\n        CalldataPointer cdPtr\n    ) internal pure returns (int248 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n\n    /// @dev Reads the int256 at `cdPtr` in calldata.\n    function readInt256(\n        CalldataPointer cdPtr\n    ) internal pure returns (int256 value) {\n        assembly {\n            value := calldataload(cdPtr)\n        }\n    }\n}\n\nlibrary ReturndataReaders {\n    /// @dev Reads value at `rdPtr` & applies a mask to return only last 4 bytes\n    function readMaskedUint256(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint256 value) {\n        value = rdPtr.readUint256() & OffsetOrLengthMask;\n    }\n\n    /// @dev Reads the bool at `rdPtr` in returndata.\n    function readBool(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bool value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the address at `rdPtr` in returndata.\n    function readAddress(\n        ReturndataPointer rdPtr\n    ) internal pure returns (address value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes1 at `rdPtr` in returndata.\n    function readBytes1(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes1 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes2 at `rdPtr` in returndata.\n    function readBytes2(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes2 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes3 at `rdPtr` in returndata.\n    function readBytes3(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes3 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes4 at `rdPtr` in returndata.\n    function readBytes4(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes4 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes5 at `rdPtr` in returndata.\n    function readBytes5(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes5 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes6 at `rdPtr` in returndata.\n    function readBytes6(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes6 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes7 at `rdPtr` in returndata.\n    function readBytes7(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes7 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes8 at `rdPtr` in returndata.\n    function readBytes8(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes8 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes9 at `rdPtr` in returndata.\n    function readBytes9(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes9 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes10 at `rdPtr` in returndata.\n    function readBytes10(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes10 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes11 at `rdPtr` in returndata.\n    function readBytes11(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes11 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes12 at `rdPtr` in returndata.\n    function readBytes12(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes12 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes13 at `rdPtr` in returndata.\n    function readBytes13(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes13 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes14 at `rdPtr` in returndata.\n    function readBytes14(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes14 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes15 at `rdPtr` in returndata.\n    function readBytes15(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes15 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes16 at `rdPtr` in returndata.\n    function readBytes16(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes16 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes17 at `rdPtr` in returndata.\n    function readBytes17(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes17 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes18 at `rdPtr` in returndata.\n    function readBytes18(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes18 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes19 at `rdPtr` in returndata.\n    function readBytes19(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes19 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes20 at `rdPtr` in returndata.\n    function readBytes20(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes20 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes21 at `rdPtr` in returndata.\n    function readBytes21(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes21 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes22 at `rdPtr` in returndata.\n    function readBytes22(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes22 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes23 at `rdPtr` in returndata.\n    function readBytes23(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes23 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes24 at `rdPtr` in returndata.\n    function readBytes24(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes24 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes25 at `rdPtr` in returndata.\n    function readBytes25(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes25 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes26 at `rdPtr` in returndata.\n    function readBytes26(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes26 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes27 at `rdPtr` in returndata.\n    function readBytes27(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes27 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes28 at `rdPtr` in returndata.\n    function readBytes28(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes28 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes29 at `rdPtr` in returndata.\n    function readBytes29(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes29 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes30 at `rdPtr` in returndata.\n    function readBytes30(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes30 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes31 at `rdPtr` in returndata.\n    function readBytes31(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes31 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the bytes32 at `rdPtr` in returndata.\n    function readBytes32(\n        ReturndataPointer rdPtr\n    ) internal pure returns (bytes32 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint8 at `rdPtr` in returndata.\n    function readUint8(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint8 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint16 at `rdPtr` in returndata.\n    function readUint16(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint16 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint24 at `rdPtr` in returndata.\n    function readUint24(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint24 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint32 at `rdPtr` in returndata.\n    function readUint32(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint32 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint40 at `rdPtr` in returndata.\n    function readUint40(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint40 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint48 at `rdPtr` in returndata.\n    function readUint48(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint48 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint56 at `rdPtr` in returndata.\n    function readUint56(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint56 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint64 at `rdPtr` in returndata.\n    function readUint64(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint64 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint72 at `rdPtr` in returndata.\n    function readUint72(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint72 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint80 at `rdPtr` in returndata.\n    function readUint80(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint80 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint88 at `rdPtr` in returndata.\n    function readUint88(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint88 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint96 at `rdPtr` in returndata.\n    function readUint96(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint96 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint104 at `rdPtr` in returndata.\n    function readUint104(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint104 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint112 at `rdPtr` in returndata.\n    function readUint112(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint112 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint120 at `rdPtr` in returndata.\n    function readUint120(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint120 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint128 at `rdPtr` in returndata.\n    function readUint128(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint128 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint136 at `rdPtr` in returndata.\n    function readUint136(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint136 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint144 at `rdPtr` in returndata.\n    function readUint144(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint144 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint152 at `rdPtr` in returndata.\n    function readUint152(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint152 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint160 at `rdPtr` in returndata.\n    function readUint160(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint160 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint168 at `rdPtr` in returndata.\n    function readUint168(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint168 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint176 at `rdPtr` in returndata.\n    function readUint176(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint176 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint184 at `rdPtr` in returndata.\n    function readUint184(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint184 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint192 at `rdPtr` in returndata.\n    function readUint192(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint192 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint200 at `rdPtr` in returndata.\n    function readUint200(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint200 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint208 at `rdPtr` in returndata.\n    function readUint208(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint208 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint216 at `rdPtr` in returndata.\n    function readUint216(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint216 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint224 at `rdPtr` in returndata.\n    function readUint224(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint224 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint232 at `rdPtr` in returndata.\n    function readUint232(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint232 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint240 at `rdPtr` in returndata.\n    function readUint240(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint240 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint248 at `rdPtr` in returndata.\n    function readUint248(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint248 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the uint256 at `rdPtr` in returndata.\n    function readUint256(\n        ReturndataPointer rdPtr\n    ) internal pure returns (uint256 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int8 at `rdPtr` in returndata.\n    function readInt8(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int8 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int16 at `rdPtr` in returndata.\n    function readInt16(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int16 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int24 at `rdPtr` in returndata.\n    function readInt24(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int24 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int32 at `rdPtr` in returndata.\n    function readInt32(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int32 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int40 at `rdPtr` in returndata.\n    function readInt40(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int40 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int48 at `rdPtr` in returndata.\n    function readInt48(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int48 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int56 at `rdPtr` in returndata.\n    function readInt56(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int56 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int64 at `rdPtr` in returndata.\n    function readInt64(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int64 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int72 at `rdPtr` in returndata.\n    function readInt72(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int72 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int80 at `rdPtr` in returndata.\n    function readInt80(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int80 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int88 at `rdPtr` in returndata.\n    function readInt88(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int88 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int96 at `rdPtr` in returndata.\n    function readInt96(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int96 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int104 at `rdPtr` in returndata.\n    function readInt104(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int104 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int112 at `rdPtr` in returndata.\n    function readInt112(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int112 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int120 at `rdPtr` in returndata.\n    function readInt120(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int120 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int128 at `rdPtr` in returndata.\n    function readInt128(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int128 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int136 at `rdPtr` in returndata.\n    function readInt136(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int136 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int144 at `rdPtr` in returndata.\n    function readInt144(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int144 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int152 at `rdPtr` in returndata.\n    function readInt152(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int152 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int160 at `rdPtr` in returndata.\n    function readInt160(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int160 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int168 at `rdPtr` in returndata.\n    function readInt168(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int168 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int176 at `rdPtr` in returndata.\n    function readInt176(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int176 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int184 at `rdPtr` in returndata.\n    function readInt184(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int184 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int192 at `rdPtr` in returndata.\n    function readInt192(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int192 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int200 at `rdPtr` in returndata.\n    function readInt200(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int200 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int208 at `rdPtr` in returndata.\n    function readInt208(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int208 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int216 at `rdPtr` in returndata.\n    function readInt216(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int216 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int224 at `rdPtr` in returndata.\n    function readInt224(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int224 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int232 at `rdPtr` in returndata.\n    function readInt232(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int232 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int240 at `rdPtr` in returndata.\n    function readInt240(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int240 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int248 at `rdPtr` in returndata.\n    function readInt248(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int248 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n\n    /// @dev Reads the int256 at `rdPtr` in returndata.\n    function readInt256(\n        ReturndataPointer rdPtr\n    ) internal pure returns (int256 value) {\n        assembly {\n            returndatacopy(0, rdPtr, _OneWord)\n            value := mload(0)\n        }\n    }\n}\n\nlibrary MemoryReaders {\n    /// @dev Reads the memory pointer at `mPtr` in memory.\n    function readMemoryPointer(\n        MemoryPointer mPtr\n    ) internal pure returns (MemoryPointer value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads value at `mPtr` & applies a mask to return only last 4 bytes\n    function readMaskedUint256(\n        MemoryPointer mPtr\n    ) internal pure returns (uint256 value) {\n        value = mPtr.readUint256() & OffsetOrLengthMask;\n    }\n\n    /// @dev Reads the bool at `mPtr` in memory.\n    function readBool(MemoryPointer mPtr) internal pure returns (bool value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the address at `mPtr` in memory.\n    function readAddress(\n        MemoryPointer mPtr\n    ) internal pure returns (address value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes1 at `mPtr` in memory.\n    function readBytes1(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes1 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes2 at `mPtr` in memory.\n    function readBytes2(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes2 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes3 at `mPtr` in memory.\n    function readBytes3(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes3 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes4 at `mPtr` in memory.\n    function readBytes4(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes4 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes5 at `mPtr` in memory.\n    function readBytes5(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes5 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes6 at `mPtr` in memory.\n    function readBytes6(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes6 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes7 at `mPtr` in memory.\n    function readBytes7(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes7 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes8 at `mPtr` in memory.\n    function readBytes8(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes8 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes9 at `mPtr` in memory.\n    function readBytes9(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes9 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes10 at `mPtr` in memory.\n    function readBytes10(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes10 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes11 at `mPtr` in memory.\n    function readBytes11(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes11 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes12 at `mPtr` in memory.\n    function readBytes12(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes12 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes13 at `mPtr` in memory.\n    function readBytes13(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes13 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes14 at `mPtr` in memory.\n    function readBytes14(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes14 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes15 at `mPtr` in memory.\n    function readBytes15(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes15 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes16 at `mPtr` in memory.\n    function readBytes16(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes16 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes17 at `mPtr` in memory.\n    function readBytes17(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes17 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes18 at `mPtr` in memory.\n    function readBytes18(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes18 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes19 at `mPtr` in memory.\n    function readBytes19(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes19 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes20 at `mPtr` in memory.\n    function readBytes20(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes20 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes21 at `mPtr` in memory.\n    function readBytes21(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes21 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes22 at `mPtr` in memory.\n    function readBytes22(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes22 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes23 at `mPtr` in memory.\n    function readBytes23(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes23 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes24 at `mPtr` in memory.\n    function readBytes24(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes24 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes25 at `mPtr` in memory.\n    function readBytes25(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes25 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes26 at `mPtr` in memory.\n    function readBytes26(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes26 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes27 at `mPtr` in memory.\n    function readBytes27(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes27 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes28 at `mPtr` in memory.\n    function readBytes28(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes28 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes29 at `mPtr` in memory.\n    function readBytes29(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes29 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes30 at `mPtr` in memory.\n    function readBytes30(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes30 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes31 at `mPtr` in memory.\n    function readBytes31(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes31 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the bytes32 at `mPtr` in memory.\n    function readBytes32(\n        MemoryPointer mPtr\n    ) internal pure returns (bytes32 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint8 at `mPtr` in memory.\n    function readUint8(MemoryPointer mPtr) internal pure returns (uint8 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint16 at `mPtr` in memory.\n    function readUint16(\n        MemoryPointer mPtr\n    ) internal pure returns (uint16 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint24 at `mPtr` in memory.\n    function readUint24(\n        MemoryPointer mPtr\n    ) internal pure returns (uint24 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint32 at `mPtr` in memory.\n    function readUint32(\n        MemoryPointer mPtr\n    ) internal pure returns (uint32 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint40 at `mPtr` in memory.\n    function readUint40(\n        MemoryPointer mPtr\n    ) internal pure returns (uint40 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint48 at `mPtr` in memory.\n    function readUint48(\n        MemoryPointer mPtr\n    ) internal pure returns (uint48 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint56 at `mPtr` in memory.\n    function readUint56(\n        MemoryPointer mPtr\n    ) internal pure returns (uint56 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint64 at `mPtr` in memory.\n    function readUint64(\n        MemoryPointer mPtr\n    ) internal pure returns (uint64 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint72 at `mPtr` in memory.\n    function readUint72(\n        MemoryPointer mPtr\n    ) internal pure returns (uint72 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint80 at `mPtr` in memory.\n    function readUint80(\n        MemoryPointer mPtr\n    ) internal pure returns (uint80 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint88 at `mPtr` in memory.\n    function readUint88(\n        MemoryPointer mPtr\n    ) internal pure returns (uint88 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint96 at `mPtr` in memory.\n    function readUint96(\n        MemoryPointer mPtr\n    ) internal pure returns (uint96 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint104 at `mPtr` in memory.\n    function readUint104(\n        MemoryPointer mPtr\n    ) internal pure returns (uint104 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint112 at `mPtr` in memory.\n    function readUint112(\n        MemoryPointer mPtr\n    ) internal pure returns (uint112 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint120 at `mPtr` in memory.\n    function readUint120(\n        MemoryPointer mPtr\n    ) internal pure returns (uint120 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint128 at `mPtr` in memory.\n    function readUint128(\n        MemoryPointer mPtr\n    ) internal pure returns (uint128 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint136 at `mPtr` in memory.\n    function readUint136(\n        MemoryPointer mPtr\n    ) internal pure returns (uint136 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint144 at `mPtr` in memory.\n    function readUint144(\n        MemoryPointer mPtr\n    ) internal pure returns (uint144 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint152 at `mPtr` in memory.\n    function readUint152(\n        MemoryPointer mPtr\n    ) internal pure returns (uint152 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint160 at `mPtr` in memory.\n    function readUint160(\n        MemoryPointer mPtr\n    ) internal pure returns (uint160 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint168 at `mPtr` in memory.\n    function readUint168(\n        MemoryPointer mPtr\n    ) internal pure returns (uint168 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint176 at `mPtr` in memory.\n    function readUint176(\n        MemoryPointer mPtr\n    ) internal pure returns (uint176 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint184 at `mPtr` in memory.\n    function readUint184(\n        MemoryPointer mPtr\n    ) internal pure returns (uint184 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint192 at `mPtr` in memory.\n    function readUint192(\n        MemoryPointer mPtr\n    ) internal pure returns (uint192 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint200 at `mPtr` in memory.\n    function readUint200(\n        MemoryPointer mPtr\n    ) internal pure returns (uint200 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint208 at `mPtr` in memory.\n    function readUint208(\n        MemoryPointer mPtr\n    ) internal pure returns (uint208 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint216 at `mPtr` in memory.\n    function readUint216(\n        MemoryPointer mPtr\n    ) internal pure returns (uint216 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint224 at `mPtr` in memory.\n    function readUint224(\n        MemoryPointer mPtr\n    ) internal pure returns (uint224 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint232 at `mPtr` in memory.\n    function readUint232(\n        MemoryPointer mPtr\n    ) internal pure returns (uint232 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint240 at `mPtr` in memory.\n    function readUint240(\n        MemoryPointer mPtr\n    ) internal pure returns (uint240 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint248 at `mPtr` in memory.\n    function readUint248(\n        MemoryPointer mPtr\n    ) internal pure returns (uint248 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the uint256 at `mPtr` in memory.\n    function readUint256(\n        MemoryPointer mPtr\n    ) internal pure returns (uint256 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int8 at `mPtr` in memory.\n    function readInt8(MemoryPointer mPtr) internal pure returns (int8 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int16 at `mPtr` in memory.\n    function readInt16(MemoryPointer mPtr) internal pure returns (int16 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int24 at `mPtr` in memory.\n    function readInt24(MemoryPointer mPtr) internal pure returns (int24 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int32 at `mPtr` in memory.\n    function readInt32(MemoryPointer mPtr) internal pure returns (int32 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int40 at `mPtr` in memory.\n    function readInt40(MemoryPointer mPtr) internal pure returns (int40 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int48 at `mPtr` in memory.\n    function readInt48(MemoryPointer mPtr) internal pure returns (int48 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int56 at `mPtr` in memory.\n    function readInt56(MemoryPointer mPtr) internal pure returns (int56 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int64 at `mPtr` in memory.\n    function readInt64(MemoryPointer mPtr) internal pure returns (int64 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int72 at `mPtr` in memory.\n    function readInt72(MemoryPointer mPtr) internal pure returns (int72 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int80 at `mPtr` in memory.\n    function readInt80(MemoryPointer mPtr) internal pure returns (int80 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int88 at `mPtr` in memory.\n    function readInt88(MemoryPointer mPtr) internal pure returns (int88 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int96 at `mPtr` in memory.\n    function readInt96(MemoryPointer mPtr) internal pure returns (int96 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int104 at `mPtr` in memory.\n    function readInt104(\n        MemoryPointer mPtr\n    ) internal pure returns (int104 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int112 at `mPtr` in memory.\n    function readInt112(\n        MemoryPointer mPtr\n    ) internal pure returns (int112 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int120 at `mPtr` in memory.\n    function readInt120(\n        MemoryPointer mPtr\n    ) internal pure returns (int120 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int128 at `mPtr` in memory.\n    function readInt128(\n        MemoryPointer mPtr\n    ) internal pure returns (int128 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int136 at `mPtr` in memory.\n    function readInt136(\n        MemoryPointer mPtr\n    ) internal pure returns (int136 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int144 at `mPtr` in memory.\n    function readInt144(\n        MemoryPointer mPtr\n    ) internal pure returns (int144 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int152 at `mPtr` in memory.\n    function readInt152(\n        MemoryPointer mPtr\n    ) internal pure returns (int152 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int160 at `mPtr` in memory.\n    function readInt160(\n        MemoryPointer mPtr\n    ) internal pure returns (int160 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int168 at `mPtr` in memory.\n    function readInt168(\n        MemoryPointer mPtr\n    ) internal pure returns (int168 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int176 at `mPtr` in memory.\n    function readInt176(\n        MemoryPointer mPtr\n    ) internal pure returns (int176 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int184 at `mPtr` in memory.\n    function readInt184(\n        MemoryPointer mPtr\n    ) internal pure returns (int184 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int192 at `mPtr` in memory.\n    function readInt192(\n        MemoryPointer mPtr\n    ) internal pure returns (int192 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int200 at `mPtr` in memory.\n    function readInt200(\n        MemoryPointer mPtr\n    ) internal pure returns (int200 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int208 at `mPtr` in memory.\n    function readInt208(\n        MemoryPointer mPtr\n    ) internal pure returns (int208 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int216 at `mPtr` in memory.\n    function readInt216(\n        MemoryPointer mPtr\n    ) internal pure returns (int216 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int224 at `mPtr` in memory.\n    function readInt224(\n        MemoryPointer mPtr\n    ) internal pure returns (int224 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int232 at `mPtr` in memory.\n    function readInt232(\n        MemoryPointer mPtr\n    ) internal pure returns (int232 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int240 at `mPtr` in memory.\n    function readInt240(\n        MemoryPointer mPtr\n    ) internal pure returns (int240 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int248 at `mPtr` in memory.\n    function readInt248(\n        MemoryPointer mPtr\n    ) internal pure returns (int248 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n\n    /// @dev Reads the int256 at `mPtr` in memory.\n    function readInt256(\n        MemoryPointer mPtr\n    ) internal pure returns (int256 value) {\n        assembly {\n            value := mload(mPtr)\n        }\n    }\n}\n\nlibrary MemoryWriters {\n    /// @dev Writes `valuePtr` to memory at `mPtr`.\n    function write(MemoryPointer mPtr, MemoryPointer valuePtr) internal pure {\n        assembly {\n            mstore(mPtr, valuePtr)\n        }\n    }\n\n    /// @dev Writes a boolean `value` to `mPtr` in memory.\n    function write(MemoryPointer mPtr, bool value) internal pure {\n        assembly {\n            mstore(mPtr, value)\n        }\n    }\n\n    /// @dev Writes an address `value` to `mPtr` in memory.\n    function write(MemoryPointer mPtr, address value) internal pure {\n        assembly {\n            mstore(mPtr, value)\n        }\n    }\n\n    /// @dev Writes a bytes32 `value` to `mPtr` in memory.\n    /// Separate name to disambiguate literal write parameters.\n    function writeBytes32(MemoryPointer mPtr, bytes32 value) internal pure {\n        assembly {\n            mstore(mPtr, value)\n        }\n    }\n\n    /// @dev Writes a uint256 `value` to `mPtr` in memory.\n    function write(MemoryPointer mPtr, uint256 value) internal pure {\n        assembly {\n            mstore(mPtr, value)\n        }\n    }\n\n    /// @dev Writes an int256 `value` to `mPtr` in memory.\n    /// Separate name to disambiguate literal write parameters.\n    function writeInt(MemoryPointer mPtr, int256 value) internal pure {\n        assembly {\n            mstore(mPtr, value)\n        }\n    }\n}\n"
      },
      "lib/seaport/lib/seaport-types/src/interfaces/IERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.7;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.19;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check if target is a contract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(target.code.length > 0, \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      },
      "src/lib/ERC721SeaDropStructs.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\n/**\n * @notice A struct defining public drop data.\n *         Designed to fit efficiently in two storage slots.\n *\n * @param startPrice               The start price per token. (Up to 1.2m\n *                                 of native token, e.g. ETH, MATIC)\n * @param endPrice                 The end price per token. If this differs\n *                                 from startPrice, the current price will\n *                                 be calculated based on the current time.\n * @param startTime                The start time, ensure this is not zero.\n * @param endTime                  The end time, ensure this is not zero.\n * @param paymentToken             The payment token address. Null for\n *                                 native token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n *                                 allowed. (The limit for this field is\n *                                 2^16 - 1)\n * @param feeBps                   Fee out of 10_000 basis points to be\n *                                 collected.\n * @param restrictFeeRecipients    If false, allow any fee recipient;\n *                                 if true, check fee recipient is allowed.\n */\nstruct PublicDrop {\n    uint80 startPrice; // 80/512 bits\n    uint80 endPrice; // 160/512 bits\n    uint40 startTime; // 200/512 bits\n    uint40 endTime; // 240/512 bits\n    address paymentToken; // 400/512 bits\n    uint16 maxTotalMintableByWallet; // 416/512 bits\n    uint16 feeBps; // 432/512 bits\n    bool restrictFeeRecipients; // 440/512 bits\n}\n\n/**\n * @notice A struct defining mint params for an allow list.\n *         An allow list leaf will be composed of `msg.sender` and\n *         the following params.\n *\n *         Note: Since feeBps is encoded in the leaf, backend should ensure\n *         that feeBps is acceptable before generating a proof.\n *\n * @param startPrice               The start price per token. (Up to 1.2m\n *                                 of native token, e.g. ETH, MATIC)\n * @param endPrice                 The end price per token. If this differs\n *                                 from startPrice, the current price will\n *                                 be calculated based on the current time.\n * @param startTime                The start time, ensure this is not zero.\n * @param endTime                  The end time, ensure this is not zero.\n * @param paymentToken             The payment token for the mint. Null for\n *                                 native token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n *                                 allowed.\n * @param maxTokenSupplyForStage   The limit of token supply this stage can\n *                                 mint within.\n * @param dropStageIndex           The drop stage index to emit with the event\n *                                 for analytical purposes. This should be\n *                                 non-zero since the public mint emits with\n *                                 index zero.\n * @param feeBps                   Fee out of 10_000 basis points to be\n *                                 collected.\n * @param restrictFeeRecipients    If false, allow any fee recipient;\n *                                 if true, check fee recipient is allowed.\n */\nstruct MintParams {\n    uint256 startPrice;\n    uint256 endPrice;\n    uint256 startTime;\n    uint256 endTime;\n    address paymentToken;\n    uint256 maxTotalMintableByWallet;\n    uint256 maxTokenSupplyForStage;\n    uint256 dropStageIndex; // non-zero\n    uint256 feeBps;\n    bool restrictFeeRecipients;\n}\n\n/**\n * @dev Struct containing internal SeaDrop implementation logic\n *      mint details to avoid stack too deep.\n *\n * @param feeRecipient The fee recipient.\n * @param payer        The payer of the mint.\n * @param minter       The mint recipient.\n * @param quantity     The number of tokens to mint.\n * @param withEffects  Whether to apply state changes of the mint.\n */\nstruct MintDetails {\n    address feeRecipient;\n    address payer;\n    address minter;\n    uint256 quantity;\n    bool withEffects;\n}\n\n/**\n * @notice A struct to configure multiple contract options in one transaction.\n */\nstruct MultiConfigureStruct {\n    uint256 maxSupply;\n    string baseURI;\n    string contractURI;\n    PublicDrop publicDrop;\n    string dropURI;\n    AllowListData allowListData;\n    CreatorPayout[] creatorPayouts;\n    bytes32 provenanceHash;\n    address[] allowedFeeRecipients;\n    address[] disallowedFeeRecipients;\n    address[] allowedPayers;\n    address[] disallowedPayers;\n    // Server-signed\n    address[] allowedSigners;\n    address[] disallowedSigners;\n    // ERC-2981\n    address royaltyReceiver;\n    uint96 royaltyBps;\n    // Mint\n    address mintRecipient;\n    uint256 mintQuantity;\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "forge-std/=lib/forge-std/src/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "ERC721A/=lib/ERC721A/contracts/",
        "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        "@openzeppelin-upgradeable/contracts/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "@rari-capital/solmate/=lib/seaport/lib/solmate/",
        "murky/=lib/murky/src/",
        "create2-scripts/=lib/create2-helpers/script/",
        "seadrop/=src/",
        "seaport-sol/=lib/seaport/lib/seaport-sol/",
        "seaport-types/=lib/seaport/lib/seaport-types/",
        "seaport-core/=lib/seaport/lib/seaport-core/",
        "seaport-test-utils/=lib/seaport/test/foundry/utils/",
        "solady/=lib/solady/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 99999999
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "none",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}