{"sources":{"src/Seaport.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport { Consideration } from \"./lib/Consideration.sol\";\n\n/**\n * @title Seaport\n * @custom:version 1.6\n * @author 0age (0age.eth)\n * @custom:coauthor d1ll0n (d1ll0n.eth)\n * @custom:coauthor transmissions11 (t11s.eth)\n * @custom:coauthor James Wenzel (emo.eth)\n * @custom:coauthor Daniel Viau (snotrocket.eth)\n * @custom:contributor Kartik (slokh.eth)\n * @custom:contributor LeFevre (lefevre.eth)\n * @custom:contributor Joseph Schiarizzi (CupOJoseph.eth)\n * @custom:contributor Aspyn Palatnick (stuckinaboot.eth)\n * @custom:contributor Stephan Min (stephanm.eth)\n * @custom:contributor Ryan Ghods (ralxz.eth)\n * @custom:contributor hack3r-0m (hack3r-0m.eth)\n * @custom:contributor Diego Estevez (antidiego.eth)\n * @custom:contributor Chomtana (chomtana.eth)\n * @custom:contributor Saw-mon and Natalie (sawmonandnatalie.eth)\n * @custom:contributor 0xBeans (0xBeans.eth)\n * @custom:contributor 0x4non (punkdev.eth)\n * @custom:contributor Laurence E. Day (norsefire.eth)\n * @custom:contributor vectorized.eth (vectorized.eth)\n * @custom:contributor karmacoma (karmacoma.eth)\n * @custom:contributor horsefacts (horsefacts.eth)\n * @custom:contributor UncarvedBlock (uncarvedblock.eth)\n * @custom:contributor Zoraiz Mahmood (zorz.eth)\n * @custom:contributor William Poulin (wpoulin.eth)\n * @custom:contributor Rajiv Patel-O'Connor (rajivpoc.eth)\n * @custom:contributor tserg (tserg.eth)\n * @custom:contributor cygaar (cygaar.eth)\n * @custom:contributor Meta0xNull (meta0xnull.eth)\n * @custom:contributor gpersoon (gpersoon.eth)\n * @custom:contributor Matt Solomon (msolomon.eth)\n * @custom:contributor Weikang Song (weikangs.eth)\n * @custom:contributor zer0dot (zer0dot.eth)\n * @custom:contributor Mudit Gupta (mudit.eth)\n * @custom:contributor leonardoalt (leoalt.eth)\n * @custom:contributor cmichel (cmichel.eth)\n * @custom:contributor PraneshASP (pranesh.eth)\n * @custom:contributor JasperAlexander (jasperalexander.eth)\n * @custom:contributor Ellahi (ellahi.eth)\n * @custom:contributor zaz (1zaz1.eth)\n * @custom:contributor berndartmueller (berndartmueller.eth)\n * @custom:contributor dmfxyz (dmfxyz.eth)\n * @custom:contributor daltoncoder (dontkillrobots.eth)\n * @custom:contributor 0xf4ce (0xf4ce.eth)\n * @custom:contributor phaze (phaze.eth)\n * @custom:contributor hrkrshnn (hrkrshnn.eth)\n * @custom:contributor axic (axic.eth)\n * @custom:contributor leastwood (leastwood.eth)\n * @custom:contributor 0xsanson (sanson.eth)\n * @custom:contributor blockdev (blockd3v.eth)\n * @custom:contributor fiveoutofnine (fiveoutofnine.eth)\n * @custom:contributor shuklaayush (shuklaayush.eth)\n * @custom:contributor dravee (dravee.eth)\n * @custom:contributor 0xPatissier\n * @custom:contributor pcaversaccio\n * @custom:contributor David Eiber\n * @custom:contributor csanuragjain\n * @custom:contributor sach1r0\n * @custom:contributor twojoy0\n * @custom:contributor ori_dabush\n * @custom:contributor Daniel Gelfand\n * @custom:contributor okkothejawa\n * @custom:contributor FlameHorizon\n * @custom:contributor vdrg\n * @custom:contributor dmitriia\n * @custom:contributor bokeh-eth\n * @custom:contributor asutorufos\n * @custom:contributor rfart(rfa)\n * @custom:contributor Riley Holterhus\n * @custom:contributor big-tech-sux\n * @notice Seaport is a generalized native token/ERC20/ERC721/ERC1155\n *         marketplace with lightweight methods for common routes as well as\n *         more flexible methods for composing advanced orders or groups of\n *         orders. Each order contains an arbitrary number of items that may be\n *         spent (the \"offer\") along with an arbitrary number of items that must\n *         be received back by the indicated recipients (the \"consideration\").\n */\ncontract Seaport is Consideration {\n    /**\n     * @notice Derive and set hashes, reference chainId, and associated domain\n     *         separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) Consideration(conduitController) {}\n\n    /**\n     * @dev Internal pure function to retrieve and return the name of this\n     *      contract.\n     *\n     * @return The name of this contract.\n     */\n    function _name() internal pure override returns (string memory) {\n        // Return the name of the contract.\n        assembly {\n            mstore(0x20, 0x20)\n            mstore(0x47, 0x07536561706f7274)\n            return(0x20, 0x60)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to retrieve the name of this contract as a\n     *      string that will be used to derive the name hash in the constructor.\n     *\n     * @return The name of this contract as a string.\n     */\n    function _nameString() internal pure override returns (string memory) {\n        // Return the name of the contract.\n        return \"Seaport\";\n    }\n}\n"},"src/lib/Executor.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ConduitInterface\n} from \"seaport-types/src/interfaces/ConduitInterface.sol\";\n\nimport {\n    ConduitItemType\n} from \"seaport-types/src/conduit/lib/ConduitEnums.sol\";\n\nimport { ItemType } from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport { ReceivedItem } from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { Verifiers } from \"./Verifiers.sol\";\n\nimport { TokenTransferrer } from \"./TokenTransferrer.sol\";\n\nimport {\n    Accumulator_array_length_ptr,\n    Accumulator_array_offset_ptr,\n    Accumulator_array_offset,\n    Accumulator_conduitKey_ptr,\n    Accumulator_itemSizeOffsetDifference,\n    Accumulator_selector_ptr,\n    AccumulatorArmed,\n    AccumulatorDisarmed,\n    Conduit_transferItem_amount_ptr,\n    Conduit_transferItem_from_ptr,\n    Conduit_transferItem_identifier_ptr,\n    Conduit_transferItem_size,\n    Conduit_transferItem_to_ptr,\n    Conduit_transferItem_token_ptr,\n    FreeMemoryPointerSlot,\n    OneWord,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    NativeTokenTransferGenericFailure_error_account_ptr,\n    NativeTokenTransferGenericFailure_error_amount_ptr,\n    NativeTokenTransferGenericFailure_error_length,\n    NativeTokenTransferGenericFailure_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\nimport {\n    _revertInvalidCallToConduit,\n    _revertInvalidConduit,\n    _revertInvalidERC721TransferAmount,\n    _revertUnusedItemParameters\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\n/**\n * @title Executor\n * @author 0age\n * @notice Executor contains functions related to processing executions (i.e.\n *         transferring items, either directly or via conduits).\n */\ncontract Executor is Verifiers, TokenTransferrer {\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) Verifiers(conduitController) {}\n\n    /**\n     * @dev Internal function to transfer a given item, either directly or via\n     *      a corresponding conduit.\n     *\n     * @param item        The item to transfer, including an amount and a\n     *                    recipient.\n     * @param from        The account supplying the item.\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _transfer(\n        ReceivedItem memory item,\n        address from,\n        bytes32 conduitKey,\n        bytes memory accumulator\n    ) internal {\n        // If the item type indicates Ether or a native token...\n        if (item.itemType == ItemType.NATIVE) {\n            // Ensure neither the token nor the identifier parameters are set.\n            if ((uint160(item.token) | item.identifier) != 0) {\n                _revertUnusedItemParameters();\n            }\n\n            // transfer the native tokens to the recipient.\n            _transferNativeTokens(item.recipient, item.amount);\n        } else if (item.itemType == ItemType.ERC20) {\n            // Ensure that no identifier is supplied.\n            if (item.identifier != 0) {\n                _revertUnusedItemParameters();\n            }\n\n            // Transfer ERC20 tokens from the source to the recipient.\n            _transferERC20(\n                item.token,\n                from,\n                item.recipient,\n                item.amount,\n                conduitKey,\n                accumulator\n            );\n        } else if (item.itemType == ItemType.ERC721) {\n            // Transfer ERC721 token from the source to the recipient.\n            _transferERC721(\n                item.token,\n                from,\n                item.recipient,\n                item.identifier,\n                item.amount,\n                conduitKey,\n                accumulator\n            );\n        } else {\n            // Transfer ERC1155 token from the source to the recipient.\n            _transferERC1155(\n                item.token,\n                from,\n                item.recipient,\n                item.identifier,\n                item.amount,\n                conduitKey,\n                accumulator\n            );\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer Ether or other native tokens to a\n     *      given recipient.\n     *\n     * @param to     The recipient of the transfer.\n     * @param amount The amount to transfer.\n     */\n    function _transferNativeTokens(\n        address payable to,\n        uint256 amount\n    ) internal {\n        // Ensure that the supplied amount is non-zero.\n        _assertNonZeroAmount(amount);\n\n        // Declare a variable indicating whether the call was successful or not.\n        bool success;\n\n        assembly {\n            // Transfer the native token and store if it succeeded or not.\n            success := call(gas(), to, amount, 0, 0, 0, 0)\n        }\n\n        // If the call fails...\n        if (!success) {\n            // Revert and pass the revert reason along if one was returned.\n            _revertWithReasonIfOneIsReturned();\n\n            // Otherwise, revert with a generic error message.\n            assembly {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, NativeTokenTransferGenericFailure_error_selector)\n\n                // Write `to` and `amount` arguments.\n                mstore(NativeTokenTransferGenericFailure_error_account_ptr, to)\n                mstore(\n                    NativeTokenTransferGenericFailure_error_amount_ptr,\n                    amount\n                )\n\n                // revert(abi.encodeWithSignature(\n                //     \"NativeTokenTransferGenericFailure(address,uint256)\",\n                //     to,\n                //     amount\n                // ))\n                revert(\n                    Error_selector_offset,\n                    NativeTokenTransferGenericFailure_error_length\n                )\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer ERC20 tokens from a given originator\n     *      to a given recipient using a given conduit if applicable. Sufficient\n     *      approvals must be set on this contract or on a respective conduit.\n     *\n     * @param token       The ERC20 token to transfer.\n     * @param from        The originator of the transfer.\n     * @param to          The recipient of the transfer.\n     * @param amount      The amount to transfer.\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _transferERC20(\n        address token,\n        address from,\n        address to,\n        uint256 amount,\n        bytes32 conduitKey,\n        bytes memory accumulator\n    ) internal {\n        // Ensure that the supplied amount is non-zero.\n        _assertNonZeroAmount(amount);\n\n        // Trigger accumulated transfers if the conduits differ.\n        _triggerIfArmedAndNotAccumulatable(accumulator, conduitKey);\n\n        // If no conduit has been specified...\n        if (conduitKey == bytes32(0)) {\n            // Perform the token transfer directly.\n            _performERC20Transfer(token, from, to, amount);\n        } else {\n            // Insert the call to the conduit into the accumulator.\n            _insert(\n                conduitKey,\n                accumulator,\n                ConduitItemType.ERC20,\n                token,\n                from,\n                to,\n                uint256(0),\n                amount\n            );\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer a single ERC721 token from a given\n     *      originator to a given recipient. Sufficient approvals must be set,\n     *      either on the respective conduit or on this contract itself.\n     *\n     * @param token       The ERC721 token to transfer.\n     * @param from        The originator of the transfer.\n     * @param to          The recipient of the transfer.\n     * @param identifier  The tokenId to transfer.\n     * @param amount      The amount to transfer (must be 1 for ERC721).\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _transferERC721(\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount,\n        bytes32 conduitKey,\n        bytes memory accumulator\n    ) internal {\n        // Trigger accumulated transfers if the conduits differ.\n        _triggerIfArmedAndNotAccumulatable(accumulator, conduitKey);\n\n        // If no conduit has been specified...\n        if (conduitKey == bytes32(0)) {\n            // Ensure that exactly one 721 item is being transferred.\n            if (amount != 1) {\n                _revertInvalidERC721TransferAmount(amount);\n            }\n\n            // Perform transfer via the token contract directly.\n            _performERC721Transfer(token, from, to, identifier);\n        } else {\n            // Insert the call to the conduit into the accumulator.\n            _insert(\n                conduitKey,\n                accumulator,\n                ConduitItemType.ERC721,\n                token,\n                from,\n                to,\n                identifier,\n                amount\n            );\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer ERC1155 tokens from a given originator\n     *      to a given recipient. Sufficient approvals must be set, either on\n     *      the respective conduit or on this contract itself.\n     *\n     * @param token       The ERC1155 token to transfer.\n     * @param from        The originator of the transfer.\n     * @param to          The recipient of the transfer.\n     * @param identifier  The id to transfer.\n     * @param amount      The amount to transfer.\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _transferERC1155(\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount,\n        bytes32 conduitKey,\n        bytes memory accumulator\n    ) internal {\n        // Ensure that the supplied amount is non-zero.\n        _assertNonZeroAmount(amount);\n\n        // Trigger accumulated transfers if the conduits differ.\n        _triggerIfArmedAndNotAccumulatable(accumulator, conduitKey);\n\n        // If no conduit has been specified...\n        if (conduitKey == bytes32(0)) {\n            // Perform transfer via the token contract directly.\n            _performERC1155Transfer(token, from, to, identifier, amount);\n        } else {\n            // Insert the call to the conduit into the accumulator.\n            _insert(\n                conduitKey,\n                accumulator,\n                ConduitItemType.ERC1155,\n                token,\n                from,\n                to,\n                identifier,\n                amount\n            );\n        }\n    }\n\n    /**\n     * @dev Internal function to trigger a call to the conduit currently held by\n     *      the accumulator if the accumulator contains item transfers (i.e. it\n     *      is \"armed\") and the supplied conduit key does not match the key held\n     *      by the accumulator.\n     *\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     */\n    function _triggerIfArmedAndNotAccumulatable(\n        bytes memory accumulator,\n        bytes32 conduitKey\n    ) internal {\n        // Retrieve the current conduit key from the accumulator.\n        bytes32 accumulatorConduitKey = _getAccumulatorConduitKey(accumulator);\n\n        // Perform conduit call if the set key does not match the supplied key.\n        if (accumulatorConduitKey != conduitKey) {\n            _triggerIfArmed(accumulator);\n        }\n    }\n\n    /**\n     * @dev Internal function to trigger a call to the conduit currently held by\n     *      the accumulator if the accumulator contains item transfers (i.e. it\n     *      is \"armed\").\n     *\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _triggerIfArmed(bytes memory accumulator) internal {\n        // Exit if the accumulator is not \"armed\".\n        if (accumulator.length != AccumulatorArmed) {\n            return;\n        }\n\n        // Retrieve the current conduit key from the accumulator.\n        bytes32 accumulatorConduitKey = _getAccumulatorConduitKey(accumulator);\n\n        // Perform conduit call.\n        _trigger(accumulatorConduitKey, accumulator);\n    }\n\n    /**\n     * @dev Internal function to trigger a call to the conduit corresponding to\n     *      a given conduit key, supplying all accumulated item transfers. The\n     *      accumulator will be \"disarmed\" and reset in the process.\n     *\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _trigger(bytes32 conduitKey, bytes memory accumulator) internal {\n        // Declare variables for offset in memory & size of calldata to conduit.\n        uint256 callDataOffset;\n        uint256 callDataSize;\n\n        // Call the conduit with all the accumulated transfers.\n        assembly {\n            // Call begins at third word; the first is length or \"armed\" status,\n            // and the second is the current conduit key.\n            callDataOffset := add(accumulator, TwoWords)\n\n            // 68 + items * 192\n            callDataSize := add(\n                Accumulator_array_offset_ptr,\n                mul(\n                    mload(add(accumulator, Accumulator_array_length_ptr)),\n                    Conduit_transferItem_size\n                )\n            )\n        }\n\n        // Call conduit derived from conduit key & supply accumulated transfers.\n        _callConduitUsingOffsets(conduitKey, callDataOffset, callDataSize);\n\n        // Reset accumulator length to signal that it is now \"disarmed\".\n        assembly {\n            mstore(accumulator, AccumulatorDisarmed)\n        }\n    }\n\n    /**\n     * @dev Internal function to perform a call to the conduit corresponding to\n     *      a given conduit key based on the offset and size of the calldata in\n     *      question in memory.\n     *\n     * @param conduitKey     A bytes32 value indicating what corresponding\n     *                       conduit, if any, to source token approvals from.\n     *                       The zero hash signifies that no conduit should be\n     *                       used, with direct approvals set on this contract.\n     * @param callDataOffset The memory pointer where calldata is contained.\n     * @param callDataSize   The size of calldata in memory.\n     */\n    function _callConduitUsingOffsets(\n        bytes32 conduitKey,\n        uint256 callDataOffset,\n        uint256 callDataSize\n    ) internal {\n        // Derive the address of the conduit using the conduit key.\n        address conduit = _deriveConduit(conduitKey);\n\n        bool success;\n        bytes4 result;\n\n        // call the conduit.\n        assembly {\n            // Ensure first word of scratch space is empty.\n            mstore(0, 0)\n\n            // Perform call, placing first word of return data in scratch space.\n            success := call(\n                gas(),\n                conduit,\n                0,\n                callDataOffset,\n                callDataSize,\n                0,\n                OneWord\n            )\n\n            // Take value from scratch space and place it on the stack.\n            result := mload(0)\n        }\n\n        // If the call failed...\n        if (!success) {\n            // Pass along whatever revert reason was given by the conduit.\n            _revertWithReasonIfOneIsReturned();\n\n            // Otherwise, revert with a generic error.\n            _revertInvalidCallToConduit(conduit);\n        }\n\n        // Ensure result was extracted and matches magic value.\n        if (result != ConduitInterface.execute.selector) {\n            _revertInvalidConduit(conduitKey, conduit);\n        }\n    }\n\n    /**\n     * @dev Internal pure function to retrieve the current conduit key set for\n     *      the accumulator.\n     *\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     *\n     * @return accumulatorConduitKey The conduit key currently set for the\n     *                               accumulator.\n     */\n    function _getAccumulatorConduitKey(\n        bytes memory accumulator\n    ) internal pure returns (bytes32 accumulatorConduitKey) {\n        // Retrieve the current conduit key from the accumulator.\n        assembly {\n            accumulatorConduitKey := mload(\n                add(accumulator, Accumulator_conduitKey_ptr)\n            )\n        }\n    }\n\n    /**\n     * @dev Internal pure function to place an item transfer into an accumulator\n     *      that collects a series of transfers to execute against a given\n     *      conduit in a single call.\n     *\n     * @param conduitKey  A bytes32 value indicating what corresponding conduit,\n     *                    if any, to source token approvals from. The zero hash\n     *                    signifies that no conduit should be used, with direct\n     *                    approvals set on this contract.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     * @param itemType    The type of the item to transfer.\n     * @param token       The token to transfer.\n     * @param from        The originator of the transfer.\n     * @param to          The recipient of the transfer.\n     * @param identifier  The tokenId to transfer.\n     * @param amount      The amount to transfer.\n     */\n    function _insert(\n        bytes32 conduitKey,\n        bytes memory accumulator,\n        ConduitItemType itemType,\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount\n    ) internal pure {\n        uint256 elements;\n        // \"Arm\" and prime accumulator if it's not already armed. The sentinel\n        // value is held in the length of the accumulator array.\n        if (accumulator.length == AccumulatorDisarmed) {\n            elements = 1;\n            bytes4 selector = ConduitInterface.execute.selector;\n            assembly {\n                mstore(accumulator, AccumulatorArmed) // \"arm\" the accumulator.\n                mstore(add(accumulator, Accumulator_conduitKey_ptr), conduitKey)\n                mstore(add(accumulator, Accumulator_selector_ptr), selector)\n                mstore(\n                    add(accumulator, Accumulator_array_offset_ptr),\n                    Accumulator_array_offset\n                )\n                mstore(add(accumulator, Accumulator_array_length_ptr), elements)\n            }\n        } else {\n            // Otherwise, increase the number of elements by one.\n            assembly {\n                elements := add(\n                    mload(add(accumulator, Accumulator_array_length_ptr)),\n                    1\n                )\n                mstore(add(accumulator, Accumulator_array_length_ptr), elements)\n            }\n        }\n\n        // Insert the item.\n        assembly {\n            let itemPointer := sub(\n                add(accumulator, mul(elements, Conduit_transferItem_size)),\n                Accumulator_itemSizeOffsetDifference\n            )\n            mstore(itemPointer, itemType)\n            mstore(add(itemPointer, Conduit_transferItem_token_ptr), token)\n            mstore(add(itemPointer, Conduit_transferItem_from_ptr), from)\n            mstore(add(itemPointer, Conduit_transferItem_to_ptr), to)\n            mstore(\n                add(itemPointer, Conduit_transferItem_identifier_ptr),\n                identifier\n            )\n            mstore(add(itemPointer, Conduit_transferItem_amount_ptr), amount)\n        }\n    }\n}\n"},"src/lib/Verifiers.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport { OrderStatus } from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { Assertions } from \"./Assertions.sol\";\n\nimport { SignatureVerification } from \"./SignatureVerification.sol\";\n\nimport {\n    _revertInvalidTime,\n    _revertOrderAlreadyFilled,\n    _revertOrderIsCancelled,\n    _revertOrderPartiallyFilled\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    BulkOrderProof_keyShift,\n    BulkOrderProof_keySize,\n    BulkOrderProof_lengthAdjustmentBeforeMask,\n    BulkOrderProof_lengthRangeAfterMask,\n    BulkOrderProof_minSize,\n    BulkOrderProof_rangeSize,\n    ECDSA_MaxLength,\n    OneWord,\n    OneWordShift,\n    ThirtyOneBytes,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\n/**\n * @title Verifiers\n * @author 0age\n * @notice Verifiers contains functions for performing verifications.\n */\ncontract Verifiers is Assertions, SignatureVerification {\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) Assertions(conduitController) {}\n\n    /**\n     * @dev Internal view function to ensure that the current time falls within\n     *      an order's valid timespan.\n     *\n     * @param startTime       The time at which the order becomes active.\n     * @param endTime         The time at which the order becomes inactive.\n     * @param revertOnInvalid A boolean indicating whether to revert if the\n     *                        order is not active.\n     *\n     * @return valid A boolean indicating whether the order is active.\n     */\n    function _verifyTime(\n        uint256 startTime,\n        uint256 endTime,\n        bool revertOnInvalid\n    ) internal view returns (bool valid) {\n        // Mark as valid if order has started and has not already ended.\n        assembly {\n            valid := and(\n                iszero(gt(startTime, timestamp())),\n                gt(endTime, timestamp())\n            )\n        }\n\n        // Only revert on invalid if revertOnInvalid has been supplied as true.\n        if (revertOnInvalid && !valid) {\n            _revertInvalidTime(startTime, endTime);\n        }\n    }\n\n    /**\n     * @dev Internal view function to verify the signature of an order. An\n     *      ERC-1271 fallback will be attempted if either the signature length\n     *      is not 64 or 65 bytes or if the recovered signer does not match the\n     *      supplied offerer. Note that in cases where a 64 or 65 byte signature\n     *      is supplied, only standard ECDSA signatures that recover to a\n     *      non-zero address are supported.\n     *\n     * @param offerer   The offerer for the order.\n     * @param orderHash The order hash.\n     * @param signature A signature from the offerer indicating that the order\n     *                  has been approved.\n     */\n    function _verifySignature(\n        address offerer,\n        bytes32 orderHash,\n        bytes memory signature\n    ) internal view {\n        // Determine whether the offerer is the caller.\n        bool offererIsCaller;\n        assembly {\n            offererIsCaller := eq(offerer, caller())\n        }\n\n        // Skip signature verification if the offerer is the caller.\n        if (offererIsCaller) {\n            return;\n        }\n\n        // Derive the EIP-712 domain separator.\n        bytes32 domainSeparator = _domainSeparator();\n\n        // Derive original EIP-712 digest using domain separator and order hash.\n        bytes32 originalDigest = _deriveEIP712Digest(\n            domainSeparator,\n            orderHash\n        );\n\n        // Read the length of the signature from memory and place on the stack.\n        uint256 originalSignatureLength = signature.length;\n\n        // Determine effective digest if signature has a valid bulk order size.\n        bytes32 digest;\n        if (_isValidBulkOrderSize(originalSignatureLength)) {\n            // Rederive order hash and digest using bulk order proof.\n            (orderHash) = _computeBulkOrderProof(signature, orderHash);\n            digest = _deriveEIP712Digest(domainSeparator, orderHash);\n        } else {\n            // Supply the original digest as the effective digest.\n            digest = originalDigest;\n        }\n\n        // Ensure that the signature for the digest is valid for the offerer.\n        _assertValidSignature(\n            offerer,\n            digest,\n            originalDigest,\n            originalSignatureLength,\n            signature\n        );\n    }\n\n    /**\n     * @dev Determines whether the specified bulk order size is valid.\n     *\n     * @param signatureLength The signature length of the bulk order to check.\n     *\n     * @return validLength True if bulk order size is valid, false otherwise.\n     */\n    function _isValidBulkOrderSize(\n        uint256 signatureLength\n    ) internal pure returns (bool validLength) {\n        // Utilize assembly to validate the length; the equivalent logic is\n        // (64 + x) + 3 + 32y where (0 <= x <= 1) and (1 <= y <= 24).\n        assembly {\n            validLength := and(\n                lt(\n                    sub(signatureLength, BulkOrderProof_minSize),\n                    BulkOrderProof_rangeSize\n                ),\n                lt(\n                    and(\n                        add(\n                            signatureLength,\n                            BulkOrderProof_lengthAdjustmentBeforeMask\n                        ),\n                        ThirtyOneBytes\n                    ),\n                    BulkOrderProof_lengthRangeAfterMask\n                )\n            )\n        }\n    }\n\n    /**\n     * @dev Computes the bulk order hash for the specified proof and leaf. Note\n     *      that if an index that exceeds the number of orders in the bulk order\n     *      payload will instead \"wrap around\" and refer to an earlier index.\n     *\n     * @param proofAndSignature The proof and signature of the bulk order.\n     * @param leaf              The leaf of the bulk order tree.\n     *\n     * @return bulkOrderHash The bulk order hash.\n     */\n    function _computeBulkOrderProof(\n        bytes memory proofAndSignature,\n        bytes32 leaf\n    ) internal pure returns (bytes32 bulkOrderHash) {\n        // Declare arguments for the root hash and the height of the proof.\n        bytes32 root;\n        uint256 height;\n\n        // Utilize assembly to efficiently derive the root hash using the proof.\n        assembly {\n            // Retrieve the length of the proof, key, and signature combined.\n            let fullLength := mload(proofAndSignature)\n\n            // If proofAndSignature has odd length, it is a compact signature\n            // with 64 bytes.\n            let signatureLength := sub(ECDSA_MaxLength, and(fullLength, 1))\n\n            // Derive height (or depth of tree) with signature and proof length.\n            height := shr(OneWordShift, sub(fullLength, signatureLength))\n\n            // Update the length in memory to only include the signature.\n            mstore(proofAndSignature, signatureLength)\n\n            // Derive the pointer for the key using the signature length.\n            let keyPtr := add(proofAndSignature, add(OneWord, signatureLength))\n\n            // Retrieve the three-byte key using the derived pointer.\n            let key := shr(BulkOrderProof_keyShift, mload(keyPtr))\n\n            /// Retrieve pointer to first proof element by applying a constant\n            // for the key size to the derived key pointer.\n            let proof := add(keyPtr, BulkOrderProof_keySize)\n\n            // Compute level 1.\n            let scratchPtr1 := shl(OneWordShift, and(key, 1))\n            mstore(scratchPtr1, leaf)\n            mstore(xor(scratchPtr1, OneWord), mload(proof))\n\n            // Compute remaining proofs.\n            for {\n                let i := 1\n            } lt(i, height) {\n                i := add(i, 1)\n            } {\n                proof := add(proof, OneWord)\n                let scratchPtr := shl(OneWordShift, and(shr(i, key), 1))\n                mstore(scratchPtr, keccak256(0, TwoWords))\n                mstore(xor(scratchPtr, OneWord), mload(proof))\n            }\n\n            // Compute root hash.\n            root := keccak256(0, TwoWords)\n        }\n\n        // Retrieve appropriate typehash constant based on height.\n        bytes32 rootTypeHash = _lookupBulkOrderTypehash(height);\n\n        // Use the typehash and the root hash to derive final bulk order hash.\n        assembly {\n            mstore(0, rootTypeHash)\n            mstore(OneWord, root)\n            bulkOrderHash := keccak256(0, TwoWords)\n        }\n    }\n\n    /**\n     * @dev Internal view function to validate that a given order is fillable\n     *      and not cancelled based on the order status.\n     *\n     * @param orderHash       The order hash.\n     * @param orderStatus     The status of the order, including whether it has\n     *                        been cancelled and the fraction filled.\n     * @param onlyAllowUnused A boolean flag indicating whether partial fills\n     *                        are supported by the calling function.\n     * @param revertOnInvalid A boolean indicating whether to revert if the\n     *                        order has been cancelled or filled beyond the\n     *                        allowable amount.\n     *\n     * @return valid A boolean indicating whether the order is valid.\n     */\n    function _verifyOrderStatus(\n        bytes32 orderHash,\n        OrderStatus storage orderStatus,\n        bool onlyAllowUnused,\n        bool revertOnInvalid\n    ) internal view returns (bool valid) {\n        // Ensure that the order has not been cancelled.\n        if (orderStatus.isCancelled) {\n            // Only revert if revertOnInvalid has been supplied as true.\n            if (revertOnInvalid) {\n                _revertOrderIsCancelled(orderHash);\n            }\n\n            // Return false as the order status is invalid.\n            return false;\n        }\n\n        // Read order status numerator from storage and place on stack.\n        uint256 orderStatusNumerator = orderStatus.numerator;\n\n        // If the order is not entirely unused...\n        if (orderStatusNumerator != 0) {\n            // ensure the order has not been partially filled when not allowed.\n            if (onlyAllowUnused) {\n                // Always revert on partial fills when onlyAllowUnused is true.\n                _revertOrderPartiallyFilled(orderHash);\n            }\n            // Otherwise, ensure that order has not been entirely filled.\n            else if (orderStatusNumerator >= orderStatus.denominator) {\n                // Only revert if revertOnInvalid has been supplied as true.\n                if (revertOnInvalid) {\n                    _revertOrderAlreadyFilled(orderHash);\n                }\n\n                // Return false as the order status is invalid.\n                return false;\n            }\n        }\n\n        // Return true as the order status is valid.\n        valid = true;\n    }\n}\n"},"src/lib/Assertions.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    OrderParameters\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { GettersAndDerivers } from \"./GettersAndDerivers.sol\";\n\nimport {\n    TokenTransferrerErrors\n} from \"seaport-types/src/interfaces/TokenTransferrerErrors.sol\";\n\nimport { CounterManager } from \"./CounterManager.sol\";\n\nimport {\n    AdditionalRecipient_size_shift,\n    AddressDirtyUpperBitThreshold,\n    BasicOrder_additionalRecipients_head_cdPtr,\n    BasicOrder_additionalRecipients_head_ptr,\n    BasicOrder_addlRecipients_length_cdPtr,\n    BasicOrder_basicOrderType_cdPtr,\n    BasicOrder_basicOrderType_range,\n    BasicOrder_considerationToken_cdPtr,\n    BasicOrder_offerer_cdPtr,\n    BasicOrder_offerToken_cdPtr,\n    BasicOrder_parameters_cdPtr,\n    BasicOrder_parameters_ptr,\n    BasicOrder_signature_cdPtr,\n    BasicOrder_signature_ptr,\n    BasicOrder_zone_cdPtr\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    MissingItemAmount_error_length,\n    MissingItemAmount_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\nimport {\n    _revertInvalidBasicOrderParameterEncoding,\n    _revertMissingOriginalConsiderationItems\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\n/**\n * @title Assertions\n * @author 0age\n * @notice Assertions contains logic for making various assertions that do not\n *         fit neatly within a dedicated semantic scope.\n */\ncontract Assertions is\n    GettersAndDerivers,\n    CounterManager,\n    TokenTransferrerErrors\n{\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(\n        address conduitController\n    ) GettersAndDerivers(conduitController) {}\n\n    /**\n     * @dev Internal view function to ensure that the supplied consideration\n     *      array length on a given set of order parameters is not less than the\n     *      original consideration array length for that order and to retrieve\n     *      the current counter for a given order's offerer and zone and use it\n     *      to derive the order hash.\n     *\n     * @param orderParameters The parameters of the order to hash.\n     *\n     * @return The hash.\n     */\n    function _assertConsiderationLengthAndGetOrderHash(\n        OrderParameters memory orderParameters\n    ) internal view returns (bytes32) {\n        // Ensure supplied consideration array length is not less than original.\n        _assertConsiderationLengthIsNotLessThanOriginalConsiderationLength(\n            orderParameters.consideration.length,\n            orderParameters.totalOriginalConsiderationItems\n        );\n\n        // Derive and return order hash using current counter for the offerer.\n        return\n            _deriveOrderHash(\n                orderParameters,\n                _getCounter(orderParameters.offerer)\n            );\n    }\n\n    /**\n     * @dev Internal pure function to ensure that the supplied consideration\n     *      array length for an order to be fulfilled is not less than the\n     *      original consideration array length for that order.\n     *\n     * @param suppliedConsiderationItemTotal The number of consideration items\n     *                                       supplied when fulfilling the order.\n     * @param originalConsiderationItemTotal The number of consideration items\n     *                                       supplied on initial order creation.\n     */\n    function _assertConsiderationLengthIsNotLessThanOriginalConsiderationLength(\n        uint256 suppliedConsiderationItemTotal,\n        uint256 originalConsiderationItemTotal\n    ) internal pure {\n        // Ensure supplied consideration array length is not less than original.\n        if (suppliedConsiderationItemTotal < originalConsiderationItemTotal) {\n            _revertMissingOriginalConsiderationItems();\n        }\n    }\n\n    /**\n     * @dev Internal pure function to ensure that a given item amount is not\n     *      zero.\n     *\n     * @param amount The amount to check.\n     */\n    function _assertNonZeroAmount(uint256 amount) internal pure {\n        assembly {\n            if iszero(amount) {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, MissingItemAmount_error_selector)\n\n                // revert(abi.encodeWithSignature(\"MissingItemAmount()\"))\n                revert(Error_selector_offset, MissingItemAmount_error_length)\n            }\n        }\n    }\n\n    /**\n     * @dev Internal pure function to validate calldata offsets for dynamic\n     *      types in BasicOrderParameters and other parameters. This ensures\n     *      that functions using the calldata object normally will be using the\n     *      same data as the assembly functions and that values that are bound\n     *      to a given range are within that range. Note that no parameters are\n     *      supplied as all basic order functions use the same calldata\n     *      encoding.\n     */\n    function _assertValidBasicOrderParameters() internal pure {\n        // Declare a boolean designating basic order parameter offset validity.\n        bool validOffsets;\n\n        // Utilize assembly in order to read offset data directly from calldata.\n        assembly {\n            /*\n             * Checks:\n             * 1. Order parameters struct offset == 0x20\n             * 2. Additional recipients arr offset == 0x240\n             * 3. Signature offset == 0x260 + (recipients.length * 0x40)\n             * 4. BasicOrderType between 0 and 23 (i.e. < 24)\n             * 5. Offerer, zone, offer token, and consideration token have no\n             *    upper dirty bits — each argument is type(uint160).max or less\n             */\n            validOffsets := and(\n                and(\n                    and(\n                        // Order parameters at cd 0x04 offset = 0x20.\n                        eq(\n                            calldataload(BasicOrder_parameters_cdPtr),\n                            BasicOrder_parameters_ptr\n                        ),\n                        // Additional recipients at cd 0x224 offset = 0x240.\n                        eq(\n                            calldataload(\n                                BasicOrder_additionalRecipients_head_cdPtr\n                            ),\n                            BasicOrder_additionalRecipients_head_ptr\n                        )\n                    ),\n                    // Signature offset = 0x260 + recipients.length * 0x40.\n                    eq(\n                        // Load signature offset from calldata 0x244.\n                        calldataload(BasicOrder_signature_cdPtr),\n                        // Expected offset = start of recipients + len * 64.\n                        add(\n                            BasicOrder_signature_ptr,\n                            shl(\n                                // Each additional recipient length = 0x40.\n                                AdditionalRecipient_size_shift,\n                                // Additional recipients length at cd 0x264.\n                                calldataload(\n                                    BasicOrder_addlRecipients_length_cdPtr\n                                )\n                            )\n                        )\n                    )\n                ),\n                and(\n                    // Ensure BasicOrderType parameter is less than 0x18.\n                    lt(\n                        // BasicOrderType parameter = calldata offset 0x124.\n                        calldataload(BasicOrder_basicOrderType_cdPtr),\n                        // Value should be less than 24.\n                        BasicOrder_basicOrderType_range\n                    ),\n                    // Ensure no dirty upper bits are present on offerer,\n                    // zone, offer token, or consideration token.\n                    lt(\n                        or(\n                            or(\n                                // Offerer parameter = calldata offset 0x84.\n                                calldataload(BasicOrder_offerer_cdPtr),\n                                // Zone parameter = calldata offset 0xa4.\n                                calldataload(BasicOrder_zone_cdPtr)\n                            ),\n                            or(\n                                // Offer token parameter = cd offset 0xc4.\n                                calldataload(BasicOrder_offerToken_cdPtr),\n                                // Consideration parameter = offset 0x24.\n                                calldataload(\n                                    BasicOrder_considerationToken_cdPtr\n                                )\n                            )\n                        ),\n                        AddressDirtyUpperBitThreshold\n                    )\n                )\n            )\n        }\n\n        // Revert with an error if basic order parameter offsets are invalid.\n        if (!validOffsets) {\n            _revertInvalidBasicOrderParameterEncoding();\n        }\n    }\n}\n"},"src/lib/AmountDeriver.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    AmountDerivationErrors\n} from \"seaport-types/src/interfaces/AmountDerivationErrors.sol\";\n\nimport {\n    Error_selector_offset,\n    InexactFraction_error_length,\n    InexactFraction_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title AmountDeriver\n * @author 0age\n * @notice AmountDeriver contains view and pure functions related to deriving\n *         item amounts based on partial fill quantity and on linear\n *         interpolation based on current time when the start amount and end\n *         amount differ.\n */\ncontract AmountDeriver is AmountDerivationErrors {\n    /**\n     * @dev Internal view function to derive the current amount of a given item\n     *      based on the current price, the starting price, and the ending\n     *      price. If the start and end prices differ, the current price will be\n     *      interpolated on a linear basis. Note that this function expects that\n     *      the startTime parameter of orderParameters is not greater than the\n     *      current block timestamp and that the endTime parameter is greater\n     *      than the current block timestamp. If this condition is not upheld,\n     *      duration / elapsed / remaining variables will underflow.\n     *\n     * @param startAmount The starting amount of the item.\n     * @param endAmount   The ending amount of the item.\n     * @param startTime   The starting time of the order.\n     * @param endTime     The end time of the order.\n     * @param roundUp     A boolean indicating whether the resultant amount\n     *                    should be rounded up or down.\n     *\n     * @return amount The current amount.\n     */\n    function _locateCurrentAmount(\n        uint256 startAmount,\n        uint256 endAmount,\n        uint256 startTime,\n        uint256 endTime,\n        bool roundUp\n    ) internal view returns (uint256 amount) {\n        // Only modify end amount if it doesn't already equal start amount.\n        if (startAmount != endAmount) {\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 order and place it on the stack.\n                duration = endTime - startTime;\n\n                // Derive time elapsed since the order started & place on stack.\n                elapsed = block.timestamp - startTime;\n\n                // Derive time remaining until order expires and place on stack.\n                remaining = duration - elapsed;\n            }\n\n            // Aggregate new amounts weighted by time with rounding factor.\n            uint256 totalBeforeDivision = ((startAmount * remaining) +\n                (endAmount * 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                amount := mul(\n                    iszero(iszero(totalBeforeDivision)),\n                    // Subtract 1 from the numerator and add 1 to the result\n                    // if roundUp is true to get proper rounding direction.\n                    // Division is performed with no zero check as duration\n                    // cannot be zero as long as startTime < endTime.\n                    add(\n                        div(sub(totalBeforeDivision, roundUp), duration),\n                        roundUp\n                    )\n                )\n            }\n\n            // Return the current amount.\n            return amount;\n        }\n\n        // Return the original amount as startAmount == endAmount.\n        return endAmount;\n    }\n\n    /**\n     * @dev Internal pure function to return a fraction of a given value and to\n     *      ensure the resultant value does not have any fractional component.\n     *      Note that this function assumes that zero will never be supplied as\n     *      the denominator parameter; invalid / undefined behavior will result\n     *      should a denominator of zero be provided.\n     *\n     * @param numerator   A value indicating the portion of the order that\n     *                    should be filled.\n     * @param denominator A value indicating the total size of the order. Note\n     *                    that this value cannot be equal to zero.\n     * @param value       The value for which to compute the fraction.\n     *\n     * @return newValue The value after applying the fraction.\n     */\n    function _getFraction(\n        uint256 numerator,\n        uint256 denominator,\n        uint256 value\n    ) internal pure returns (uint256 newValue) {\n        // Return value early in cases where the fraction resolves to 1.\n        if (numerator == denominator) {\n            return value;\n        }\n\n        // Ensure fraction can be applied to the value with no remainder. Note\n        // that the denominator cannot be zero.\n        assembly {\n            // Ensure new value contains no remainder via mulmod operator.\n            // Credit to @hrkrshnn + @axic for proposing this optimal solution.\n            if mulmod(value, numerator, denominator) {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, InexactFraction_error_selector)\n\n                // revert(abi.encodeWithSignature(\"InexactFraction()\"))\n                revert(Error_selector_offset, InexactFraction_error_length)\n            }\n        }\n\n        // Multiply the numerator by the value and ensure no overflow occurs.\n        uint256 valueTimesNumerator = value * numerator;\n\n        // Divide by the denominator (note that denominator cannot be zero).\n        assembly {\n            // Perform division without zero check.\n            newValue := div(valueTimesNumerator, denominator)\n        }\n    }\n\n    /**\n     * @dev Internal view function to apply a fraction to a consideration\n     * or offer item.\n     *\n     * @param startAmount     The starting amount of the item.\n     * @param endAmount       The ending amount of the item.\n     * @param numerator       A value indicating the portion of the order that\n     *                        should be filled.\n     * @param denominator     A value indicating the total size of the order.\n     * @param startTime       The starting time of the order.\n     * @param endTime         The end time of the order.\n     * @param roundUp         A boolean indicating whether the resultant\n     *                        amount should be rounded up or down.\n     *\n     * @return amount The received item to transfer with the final amount.\n     */\n    function _applyFraction(\n        uint256 startAmount,\n        uint256 endAmount,\n        uint256 numerator,\n        uint256 denominator,\n        uint256 startTime,\n        uint256 endTime,\n        bool roundUp\n    ) internal view returns (uint256 amount) {\n        // If start amount equals end amount, apply fraction to end amount.\n        if (startAmount == endAmount) {\n            // Apply fraction to end amount.\n            amount = _getFraction(numerator, denominator, endAmount);\n        } else {\n            // Otherwise, apply fraction to both and interpolated final amount.\n            amount = _locateCurrentAmount(\n                _getFraction(numerator, denominator, startAmount),\n                _getFraction(numerator, denominator, endAmount),\n                startTime,\n                endTime,\n                roundUp\n            );\n        }\n    }\n}\n"},"src/lib/Consideration.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ConsiderationInterface\n} from \"seaport-types/src/interfaces/ConsiderationInterface.sol\";\n\nimport {\n    AdvancedOrder,\n    BasicOrderParameters,\n    CriteriaResolver,\n    Execution,\n    Fulfillment,\n    FulfillmentComponent,\n    Order,\n    OrderComponents\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { OrderCombiner } from \"./OrderCombiner.sol\";\n\nimport {\n    CalldataStart,\n    CalldataPointer\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\nimport {\n    Offset_fulfillAdvancedOrder_criteriaResolvers,\n    Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts,\n    Offset_fulfillAvailableAdvancedOrders_criteriaResolvers,\n    Offset_fulfillAvailableAdvancedOrders_offerFulfillments,\n    Offset_fulfillAvailableOrders_considerationFulfillments,\n    Offset_fulfillAvailableOrders_offerFulfillments,\n    Offset_matchAdvancedOrders_criteriaResolvers,\n    Offset_matchAdvancedOrders_fulfillments,\n    Offset_matchOrders_fulfillments,\n    OrderParameters_counter_offset\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\n/**\n * @title Consideration\n * @author 0age (0age.eth)\n * @custom:coauthor d1ll0n (d1ll0n.eth)\n * @custom:coauthor transmissions11 (t11s.eth)\n * @custom:coauthor James Wenzel (emo.eth)\n * @custom:coauthor Daniel Viau (snotrocket.eth)\n * @custom:version 1.6\n * @notice Consideration is a generalized native token/ERC20/ERC721/ERC1155\n *         marketplace that provides lightweight methods for common routes as\n *         well as more flexible methods for composing advanced orders or groups\n *         of orders. Each order contains an arbitrary number of items that may\n *         be spent (the \"offer\") along with an arbitrary number of items that\n *         must be received back by the indicated recipients (the\n *         \"consideration\").\n */\ncontract Consideration is ConsiderationInterface, OrderCombiner {\n    /**\n     * @notice Derive and set hashes, reference chainId, and associated domain\n     *         separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) OrderCombiner(conduitController) {}\n\n    /**\n     * @notice Accept native token transfers during execution that may then be\n     *         used to facilitate native token transfers, where any tokens that\n     *         remain will be transferred to the caller. Native tokens are only\n     *         acceptable mid-fulfillment (and not during basic fulfillment).\n     */\n    receive() external payable {\n        // Ensure the reentrancy guard is currently set to accept native tokens.\n        _assertAcceptingNativeTokens();\n    }\n\n    /**\n     * @notice Fulfill an order offering an ERC20, ERC721, or ERC1155 item by\n     *         supplying Ether (or other native tokens), ERC20 tokens, an ERC721\n     *         item, or an ERC1155 item as consideration. Six permutations are\n     *         supported: Native token to ERC721, Native token to ERC1155, ERC20\n     *         to ERC721, ERC20 to ERC1155, ERC721 to ERC20, and ERC1155 to\n     *         ERC20 (with native tokens supplied as msg.value). For an order to\n     *         be eligible for fulfillment via this method, it must contain a\n     *         single offer item (though that item may have a greater amount if\n     *         the item is not an ERC721). An arbitrary number of \"additional\n     *         recipients\" may also be supplied which will each receive native\n     *         tokens or ERC20 items from the fulfiller as consideration. Refer\n     *         to the documentation for a more comprehensive summary of how to\n     *         utilize this method and what orders are compatible with it.\n     *\n     * @custom:param parameters Additional information on the fulfilled order.\n     *                          Note that the offerer and the fulfiller must\n     *                          first approve this contract (or their chosen\n     *                          conduit if indicated) before any tokens can be\n     *                          transferred. Also note that contract recipients\n     *                          of ERC1155 consideration items must implement\n     *                          `onERC1155Received` to receive those items.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder(\n        /**\n         * @custom:name parameters\n         */\n        BasicOrderParameters calldata\n    ) external payable override returns (bool fulfilled) {\n        // Validate and fulfill the basic order.\n        fulfilled = _validateAndFulfillBasicOrder();\n    }\n\n    /**\n     * @notice Fulfill an order offering an ERC20, ERC721, or ERC1155 item by\n     *         supplying Ether (or other native tokens), ERC20 tokens, an ERC721\n     *         item, or an ERC1155 item as consideration. Six permutations are\n     *         supported: Native token to ERC721, Native token to ERC1155, ERC20\n     *         to ERC721, ERC20 to ERC1155, ERC721 to ERC20, and ERC1155 to\n     *         ERC20 (with native tokens supplied as msg.value). For an order to\n     *         be eligible for fulfillment via this method, it must contain a\n     *         single offer item (though that item may have a greater amount if\n     *         the item is not an ERC721). An arbitrary number of \"additional\n     *         recipients\" may also be supplied which will each receive native\n     *         tokens or ERC20 items from the fulfiller as consideration. Refer\n     *         to the documentation for a more comprehensive summary of how to\n     *         utilize this method and what orders are compatible with it. Note\n     *         that this function costs less gas than `fulfillBasicOrder` due to\n     *         the zero bytes in the function selector (0x00000000) which also\n     *         results in earlier function dispatch.\n     *\n     * @custom:param parameters Additional information on the fulfilled order.\n     *                          Note that the offerer and the fulfiller must\n     *                          first approve this contract (or their chosen\n     *                          conduit if indicated) before any tokens can be\n     *                          transferred. Also note that contract recipients\n     *                          of ERC1155 consideration items must implement\n     *                          `onERC1155Received` to receive those items.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder_efficient_6GL6yc(\n        /**\n         * @custom:name parameters\n         */\n        BasicOrderParameters calldata\n    ) external payable override returns (bool fulfilled) {\n        // Validate and fulfill the basic order.\n        fulfilled = _validateAndFulfillBasicOrder();\n    }\n\n    /**\n     * @notice Fulfill an order with an arbitrary number of items for offer and\n     *         consideration. Note that this function does not support\n     *         criteria-based orders or partial filling of orders (though\n     *         filling the remainder of a partially-filled order is supported).\n     *\n     * @custom:param order        The order to fulfill. Note that both the\n     *                            offerer and the fulfiller must first approve\n     *                            this contract (or the corresponding conduit if\n     *                            indicated) to transfer any relevant tokens on\n     *                            their behalf and that contracts must implement\n     *                            `onERC1155Received` to receive ERC1155 tokens\n     *                            as consideration.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used (and direct approvals set on\n     *                            this contract).\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillOrder(\n        /**\n         * @custom:name order\n         */\n        Order calldata,\n        bytes32 fulfillerConduitKey\n    ) external payable override returns (bool fulfilled) {\n        // Convert order to \"advanced\" order, then validate and fulfill it.\n        fulfilled = _validateAndFulfillAdvancedOrder(\n            _toAdvancedOrderReturnType(_decodeOrderAsAdvancedOrder)(\n                CalldataStart.pptr()\n            ),\n            new CriteriaResolver[](0), // No criteria resolvers supplied.\n            fulfillerConduitKey,\n            msg.sender\n        );\n    }\n\n    /**\n     * @notice Fill an order, fully or partially, with an arbitrary number of\n     *         items for offer and consideration alongside criteria resolvers\n     *         containing specific token identifiers and associated proofs.\n     *\n     * @custom:param advancedOrder     The order to fulfill along with the\n     *                                 fraction of the order to attempt to fill.\n     *                                 Note that both the offerer and the\n     *                                 fulfiller must first approve this\n     *                                 contract (or their conduit if indicated\n     *                                 by the order) to transfer any relevant\n     *                                 tokens on their behalf and that contracts\n     *                                 must implement `onERC1155Received` to\n     *                                 receive ERC1155 tokens as consideration.\n     *                                 Also note that all offer and\n     *                                 consideration components must have no\n     *                                 remainder after multiplication of the\n     *                                 respective amount with the supplied\n     *                                 fraction for the partial fill to be\n     *                                 considered valid.\n     * @custom:param criteriaResolvers An array where each element contains a\n     *                                 reference to a specific offer or\n     *                                 consideration, a token identifier, and a\n     *                                 proof that the supplied token identifier\n     *                                 is contained in the merkle root held by\n     *                                 the item in question's criteria element.\n     *                                 Note that an empty criteria indicates\n     *                                 that any (transferable) token identifier\n     *                                 on the token in question is valid and\n     *                                 that no associated proof needs to be\n     *                                 supplied.\n     * @param fulfillerConduitKey      A bytes32 value indicating what conduit,\n     *                                 if any, to source the fulfiller's token\n     *                                 approvals from. The zero hash signifies\n     *                                 that no conduit should be used (and\n     *                                 direct approvals set on this contract).\n     * @param recipient                The intended recipient for all received\n     *                                 items, with `address(0)` indicating that\n     *                                 the caller should receive the items.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillAdvancedOrder(\n        /**\n         * @custom:name advancedOrder\n         */\n        AdvancedOrder calldata,\n        /**\n         * @custom:name criteriaResolvers\n         */\n        CriteriaResolver[] calldata,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) external payable override returns (bool fulfilled) {\n        // Validate and fulfill the order.\n        fulfilled = _validateAndFulfillAdvancedOrder(\n            _toAdvancedOrderReturnType(_decodeAdvancedOrder)(\n                CalldataStart.pptr()\n            ),\n            _toCriteriaResolversReturnType(_decodeCriteriaResolvers)(\n                CalldataStart.pptrOffset(\n                    Offset_fulfillAdvancedOrder_criteriaResolvers\n                )\n            ),\n            fulfillerConduitKey,\n            _substituteCallerForEmptyRecipient(recipient)\n        );\n    }\n\n    /**\n     * @notice Attempt to fill a group of orders, each with an arbitrary number\n     *         of items for offer and consideration. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *         Note that this function does not support criteria-based orders or\n     *         partial filling of orders (though filling the remainder of a\n     *         partially-filled order is supported).\n     *\n     * @custom:param orders                    The orders to fulfill. Note that\n     *                                         both the offerer and the\n     *                                         fulfiller must first approve this\n     *                                         contract (or the corresponding\n     *                                         conduit if indicated) to transfer\n     *                                         any relevant tokens on their\n     *                                         behalf and that contracts must\n     *                                         implement `onERC1155Received` to\n     *                                         receive ERC1155 tokens as\n     *                                         consideration.\n     * @custom:param offerFulfillments         An array of FulfillmentComponent\n     *                                         arrays indicating which offer\n     *                                         items to attempt to aggregate\n     *                                         when preparing executions. Note\n     *                                         that any offer items not included\n     *                                         as part of a fulfillment will be\n     *                                         sent unaggregated to the caller.\n     * @custom:param considerationFulfillments An array of FulfillmentComponent\n     *                                         arrays indicating which\n     *                                         consideration items to attempt to\n     *                                         aggregate when preparing\n     *                                         executions.\n     * @param fulfillerConduitKey              A bytes32 value indicating what\n     *                                         conduit, if any, to source the\n     *                                         fulfiller's token approvals from.\n     *                                         The zero hash signifies that no\n     *                                         conduit should be used (and\n     *                                         direct approvals set on this\n     *                                         contract).\n     * @param maximumFulfilled                 The maximum number of orders to\n     *                                         fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders.\n     */\n    function fulfillAvailableOrders(\n        /**\n         * @custom:name orders\n         */\n        Order[] calldata,\n        /**\n         * @custom:name offerFulfillments\n         */\n        FulfillmentComponent[][] calldata,\n        /**\n         * @custom:name considerationFulfillments\n         */\n        FulfillmentComponent[][] calldata,\n        bytes32 fulfillerConduitKey,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        override\n        returns (\n            bool[] memory /* availableOrders */,\n            Execution[] memory /* executions */\n        )\n    {\n        // Convert orders to \"advanced\" orders and fulfill all available orders.\n        return\n            _fulfillAvailableAdvancedOrders(\n                _toAdvancedOrdersReturnType(_decodeOrdersAsAdvancedOrders)(\n                    CalldataStart.pptr()\n                ), // Convert to advanced orders.\n                new CriteriaResolver[](0), // No criteria resolvers supplied.\n                _toNestedFulfillmentComponentsReturnType(\n                    _decodeNestedFulfillmentComponents\n                )(\n                    CalldataStart.pptrOffset(\n                        Offset_fulfillAvailableOrders_offerFulfillments\n                    )\n                ),\n                _toNestedFulfillmentComponentsReturnType(\n                    _decodeNestedFulfillmentComponents\n                )(\n                    CalldataStart.pptrOffset(\n                        Offset_fulfillAvailableOrders_considerationFulfillments\n                    )\n                ),\n                fulfillerConduitKey,\n                msg.sender,\n                maximumFulfilled\n            );\n    }\n\n    /**\n     * @notice Attempt to fill a group of orders, fully or partially, with an\n     *         arbitrary number of items for offer and consideration per order\n     *         alongside criteria resolvers containing specific token\n     *         identifiers and associated proofs. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *\n     * @custom:param advancedOrders            The orders to fulfill along with\n     *                                         the fraction of those orders to\n     *                                         attempt to fill. Note that both\n     *                                         the offerer and the fulfiller\n     *                                         must first approve this contract\n     *                                         (or their conduit if indicated by\n     *                                         the order) to transfer any\n     *                                         relevant tokens on their behalf\n     *                                         and that contracts must implement\n     *                                         `onERC1155Received` to receive\n     *                                         ERC1155 tokens as consideration.\n     *                                         Also note that all offer and\n     *                                         consideration components must\n     *                                         have no remainder after\n     *                                         multiplication of the respective\n     *                                         amount with the supplied fraction\n     *                                         for an order's partial fill\n     *                                         amount to be considered valid.\n     * @custom:param criteriaResolvers         An array where each element\n     *                                         contains a reference to a\n     *                                         specific offer or consideration,\n     *                                         a token identifier, and a proof\n     *                                         that the supplied token\n     *                                         identifier is contained in the\n     *                                         merkle root held by the item in\n     *                                         question's criteria element. Note\n     *                                         that an empty criteria indicates\n     *                                         that any (transferable) token\n     *                                         identifier on the token in\n     *                                         question is valid and that no\n     *                                         associated proof needs to be\n     *                                         supplied.\n     * @custom:param offerFulfillments         An array of FulfillmentComponent\n     *                                         arrays indicating which offer\n     *                                         items to attempt to aggregate\n     *                                         when preparing executions. Note\n     *                                         that any offer items not included\n     *                                         as part of a fulfillment will be\n     *                                         sent unaggregated to the caller.\n     * @custom:param considerationFulfillments An array of FulfillmentComponent\n     *                                         arrays indicating which\n     *                                         consideration items to attempt to\n     *                                         aggregate when preparing\n     *                                         executions.\n     * @param fulfillerConduitKey              A bytes32 value indicating what\n     *                                         conduit, if any, to source the\n     *                                         fulfiller's token approvals from.\n     *                                         The zero hash signifies that no\n     *                                         conduit should be used (and\n     *                                         direct approvals set on this\n     *                                         contract).\n     * @param recipient                        The intended recipient for all\n     *                                         received items, with `address(0)`\n     *                                         indicating that the caller should\n     *                                         receive the offer items.\n     * @param maximumFulfilled                 The maximum number of orders to\n     *                                         fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders.\n     */\n    function fulfillAvailableAdvancedOrders(\n        /**\n         * @custom:name advancedOrders\n         */\n        AdvancedOrder[] calldata,\n        /**\n         * @custom:name criteriaResolvers\n         */\n        CriteriaResolver[] calldata,\n        /**\n         * @custom:name offerFulfillments\n         */\n        FulfillmentComponent[][] calldata,\n        /**\n         * @custom:name considerationFulfillments\n         */\n        FulfillmentComponent[][] calldata,\n        bytes32 fulfillerConduitKey,\n        address recipient,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        override\n        returns (\n            bool[] memory /* availableOrders */,\n            Execution[] memory /* executions */\n        )\n    {\n        // Fulfill all available orders.\n        return\n            _fulfillAvailableAdvancedOrders(\n                _toAdvancedOrdersReturnType(_decodeAdvancedOrders)(\n                    CalldataStart.pptr()\n                ),\n                _toCriteriaResolversReturnType(_decodeCriteriaResolvers)(\n                    CalldataStart.pptrOffset(\n                        Offset_fulfillAvailableAdvancedOrders_criteriaResolvers\n                    )\n                ),\n                _toNestedFulfillmentComponentsReturnType(\n                    _decodeNestedFulfillmentComponents\n                )(\n                    CalldataStart.pptrOffset(\n                        Offset_fulfillAvailableAdvancedOrders_offerFulfillments\n                    )\n                ),\n                _toNestedFulfillmentComponentsReturnType(\n                    _decodeNestedFulfillmentComponents\n                )(\n                    CalldataStart.pptrOffset(\n                        Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts\n                    )\n                ),\n                fulfillerConduitKey,\n                _substituteCallerForEmptyRecipient(recipient),\n                maximumFulfilled\n            );\n    }\n\n    /**\n     * @notice Match an arbitrary number of orders, each with an arbitrary\n     *         number of items for offer and consideration along with a set of\n     *         fulfillments allocating offer components to consideration\n     *         components. Note that this function does not support\n     *         criteria-based or partial filling of orders (though filling the\n     *         remainder of a partially-filled order is supported). Any unspent\n     *         offer item amounts or native tokens will be transferred to the\n     *         caller.\n     *\n     * @custom:param orders       The orders to match. Note that both the\n     *                            offerer and fulfiller on each order must first\n     *                            approve this contract (or their conduit if\n     *                            indicated by the order) to transfer any\n     *                            relevant tokens on their behalf and each\n     *                            consideration recipient must implement\n     *                            `onERC1155Received` to receive ERC1155 tokens.\n     * @custom:param fulfillments An array of elements allocating offer\n     *                            components to consideration components. Note\n     *                            that each consideration component must be\n     *                            fully met for the match operation to be valid,\n     *                            and that any unspent offer items will be sent\n     *                            unaggregated to the caller.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders. Note that unspent offer item amounts or native\n     *                    tokens will not be reflected as part of this array.\n     */\n    function matchOrders(\n        /**\n         * @custom:name orders\n         */\n        Order[] calldata,\n        /**\n         * @custom:name fulfillments\n         */\n        Fulfillment[] calldata\n    ) external payable override returns (Execution[] memory /* executions */) {\n        // Convert to advanced, validate, and match orders using fulfillments.\n        return\n            _matchAdvancedOrders(\n                _toAdvancedOrdersReturnType(_decodeOrdersAsAdvancedOrders)(\n                    CalldataStart.pptr()\n                ),\n                new CriteriaResolver[](0), // No criteria resolvers supplied.\n                _toFulfillmentsReturnType(_decodeFulfillments)(\n                    CalldataStart.pptrOffset(Offset_matchOrders_fulfillments)\n                ),\n                msg.sender\n            );\n    }\n\n    /**\n     * @notice Match an arbitrary number of full, partial, or contract orders,\n     *         each with an arbitrary number of items for offer and\n     *         consideration, supplying criteria resolvers containing specific\n     *         token identifiers and associated proofs as well as fulfillments\n     *         allocating offer components to consideration components. Any\n     *         unspent offer item amounts will be transferred to the designated\n     *         recipient (with the null address signifying to use the caller)\n     *         and any unspent native tokens will be returned to the caller.\n     *\n     * @custom:param advancedOrders    The advanced orders to match. Note that\n     *                                 both the offerer and fulfiller on each\n     *                                 order must first approve this contract\n     *                                 (or their conduit if indicated by the\n     *                                 order) to transfer any relevant tokens on\n     *                                 their behalf and each consideration\n     *                                 recipient must implement\n     *                                 `onERC1155Received` to receive ERC1155\n     *                                 tokens. Also note that the offer and\n     *                                 consideration components for each order\n     *                                 must have no remainder after multiplying\n     *                                 the respective amount with the supplied\n     *                                 fraction for the group of partial fills\n     *                                 to be considered valid.\n     * @custom:param criteriaResolvers An array where each element contains a\n     *                                 reference to a specific offer or\n     *                                 consideration, a token identifier, and a\n     *                                 proof that the supplied token identifier\n     *                                 is contained in the merkle root held by\n     *                                 the item in question's criteria element.\n     *                                 Note that an empty criteria indicates\n     *                                 that any (transferable) token identifier\n     *                                 on the token in question is valid and\n     *                                 that no associated proof needs to be\n     *                                 supplied.\n     * @custom:param fulfillments      An array of elements allocating offer\n     *                                 components to consideration components.\n     *                                 Note that each consideration component\n     *                                 must be fully met for the match operation\n     *                                 to be valid, and that any unspent offer\n     *                                 items will be sent unaggregated to the\n     *                                 designated recipient.\n     * @param recipient                The intended recipient for all unspent\n     *                                 offer item amounts, or the caller if the\n     *                                 null address is supplied.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                     transfers performed as part of matching the given\n     *                     orders. Note that unspent offer item amounts or\n     *                     native tokens will not be reflected as part of this\n     *                     array.\n     */\n    function matchAdvancedOrders(\n        /**\n         * @custom:name advancedOrders\n         */\n        AdvancedOrder[] calldata,\n        /**\n         * @custom:name criteriaResolvers\n         */\n        CriteriaResolver[] calldata,\n        /**\n         * @custom:name fulfillments\n         */\n        Fulfillment[] calldata,\n        address recipient\n    ) external payable override returns (Execution[] memory /* executions */) {\n        // Validate and match the advanced orders using supplied fulfillments.\n        return\n            _matchAdvancedOrders(\n                _toAdvancedOrdersReturnType(_decodeAdvancedOrders)(\n                    CalldataStart.pptr()\n                ),\n                _toCriteriaResolversReturnType(_decodeCriteriaResolvers)(\n                    CalldataStart.pptrOffset(\n                        Offset_matchAdvancedOrders_criteriaResolvers\n                    )\n                ),\n                _toFulfillmentsReturnType(_decodeFulfillments)(\n                    CalldataStart.pptrOffset(\n                        Offset_matchAdvancedOrders_fulfillments\n                    )\n                ),\n                _substituteCallerForEmptyRecipient(recipient)\n            );\n    }\n\n    /**\n     * @notice Cancel an arbitrary number of orders. Note that only the offerer\n     *         or the zone of a given order may cancel it. Callers should ensure\n     *         that the intended order was cancelled by calling `getOrderStatus`\n     *         and confirming that `isCancelled` returns `true`.\n     *\n     * @param orders The orders to cancel.\n     *\n     * @return cancelled A boolean indicating whether the supplied orders have\n     *                   been successfully cancelled.\n     */\n    function cancel(\n        OrderComponents[] calldata orders\n    ) external override returns (bool cancelled) {\n        // Cancel the orders.\n        cancelled = _cancel(orders);\n    }\n\n    /**\n     * @notice Validate an arbitrary number of orders, thereby registering their\n     *         signatures as valid and allowing the fulfiller to skip signature\n     *         verification on fulfillment. Note that validated orders may still\n     *         be unfulfillable due to invalid item amounts or other factors;\n     *         callers should determine whether validated orders are fulfillable\n     *         by simulating the fulfillment call prior to execution. Also note\n     *         that anyone can validate a signed order, but only the offerer can\n     *         validate an order without supplying a signature.\n     *\n     * @custom:param orders The orders to validate.\n     *\n     * @return validated A boolean indicating whether the supplied orders have\n     *                   been successfully validated.\n     */\n    function validate(\n        /**\n         * @custom:name orders\n         */\n        Order[] calldata\n    ) external override returns (bool /* validated */) {\n        return\n            _validate(_toOrdersReturnType(_decodeOrders)(CalldataStart.pptr()));\n    }\n\n    /**\n     * @notice Cancel all orders from a given offerer with a given zone in bulk\n     *         by incrementing a counter. Note that only the offerer may\n     *         increment the counter.\n     *\n     * @return newCounter The new counter.\n     */\n    function incrementCounter() external override returns (uint256 newCounter) {\n        // Increment current counter for the supplied offerer.  Note that the\n        // counter is incremented by a large, quasi-random interval.\n        newCounter = _incrementCounter();\n    }\n\n    /**\n     * @notice Retrieve the order hash for a given order.\n     *\n     * @custom:param order The components of the order.\n     *\n     * @return orderHash The order hash.\n     */\n    function getOrderHash(\n        /**\n         * @custom:name order\n         */\n        OrderComponents calldata\n    ) external view override returns (bytes32 orderHash) {\n        CalldataPointer orderPointer = CalldataStart.pptr();\n\n        // Derive order hash by supplying order parameters along with counter.\n        orderHash = _deriveOrderHash(\n            _toOrderParametersReturnType(\n                _decodeOrderComponentsAsOrderParameters\n            )(orderPointer),\n            // Read order counter\n            orderPointer.offset(OrderParameters_counter_offset).readUint256()\n        );\n    }\n\n    /**\n     * @notice Retrieve the status of a given order by hash, including whether\n     *         the order has been cancelled or validated and the fraction of the\n     *         order that has been filled. Since the _orderStatus[orderHash]\n     *         does not get set for contract orders, getOrderStatus will always\n     *         return (false, false, 0, 0) for those hashes. Note that this\n     *         function is susceptible to view reentrancy and so should be used\n     *         with care when calling from other contracts.\n     *\n     * @param orderHash The order hash in question.\n     *\n     * @return isValidated A boolean indicating whether the order in question\n     *                     has been validated (i.e. previously approved or\n     *                     partially filled).\n     * @return isCancelled A boolean indicating whether the order in question\n     *                     has been cancelled.\n     * @return totalFilled The total portion of the order that has been filled\n     *                     (i.e. the \"numerator\").\n     * @return totalSize   The total size of the order that is either filled or\n     *                     unfilled (i.e. the \"denominator\").\n     */\n    function getOrderStatus(\n        bytes32 orderHash\n    )\n        external\n        view\n        override\n        returns (\n            bool isValidated,\n            bool isCancelled,\n            uint256 totalFilled,\n            uint256 totalSize\n        )\n    {\n        // Retrieve the order status using the order hash.\n        return _getOrderStatus(orderHash);\n    }\n\n    /**\n     * @notice Retrieve the current counter for a given offerer.\n     *\n     * @param offerer The offerer in question.\n     *\n     * @return counter The current counter.\n     */\n    function getCounter(\n        address offerer\n    ) external view override returns (uint256 counter) {\n        // Return the counter for the supplied offerer.\n        counter = _getCounter(offerer);\n    }\n\n    /**\n     * @notice Retrieve configuration information for this contract.\n     *\n     * @return version           The contract version.\n     * @return domainSeparator   The domain separator for this contract.\n     * @return conduitController The conduit Controller set for this contract.\n     */\n    function information()\n        external\n        view\n        override\n        returns (\n            string memory version,\n            bytes32 domainSeparator,\n            address conduitController\n        )\n    {\n        // Return the information for this contract.\n        return _information();\n    }\n\n    /**\n     * @dev Gets the contract offerer nonce for the specified contract offerer.\n     *      Note that this function is susceptible to view reentrancy and so\n     *      should be used with care when calling from other contracts.\n     *\n     * @param contractOfferer The contract offerer for which to get the nonce.\n     *\n     * @return nonce The contract offerer nonce.\n     */\n    function getContractOffererNonce(\n        address contractOfferer\n    ) external view override returns (uint256 nonce) {\n        nonce = _contractNonces[contractOfferer];\n    }\n\n    /**\n     * @notice Retrieve the name of this contract.\n     *\n     * @return contractName The name of this contract.\n     */\n    function name()\n        external\n        pure\n        override\n        returns (string memory /* contractName */)\n    {\n        // Return the name of the contract.\n        return _name();\n    }\n}\n"},"src/lib/OrderCombiner.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    Side,\n    ItemType,\n    OrderType\n} from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    ConsiderationItem,\n    CriteriaResolver,\n    Execution,\n    Fulfillment,\n    FulfillmentComponent,\n    OfferItem,\n    OrderParameters,\n    ReceivedItem\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { OrderFulfiller } from \"./OrderFulfiller.sol\";\n\nimport { FulfillmentApplier } from \"./FulfillmentApplier.sol\";\n\nimport {\n    _revertConsiderationNotMet,\n    _revertInvalidNativeOfferItem,\n    _revertNoSpecifiedOrdersAvailable\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    Error_selector_offset,\n    InsufficientNativeTokensSupplied_error_selector,\n    InsufficientNativeTokensSupplied_error_length\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\nimport {\n    AccumulatorDisarmed,\n    ConsiderationItem_recipient_offset,\n    Execution_offerer_offset,\n    NonMatchSelector_InvalidErrorValue,\n    NonMatchSelector_MagicMask,\n    OneWord,\n    OneWordShift,\n    OrdersMatchedTopic0,\n    ReceivedItem_amount_offset,\n    ReceivedItem_recipient_offset,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    MemoryPointer,\n    MemoryPointerLib,\n    ZeroSlotPtr\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\n/**\n * @title OrderCombiner\n * @author 0age\n * @notice OrderCombiner contains logic for fulfilling combinations of orders,\n *         either by matching offer items to consideration items or by\n *         fulfilling orders where available.\n */\ncontract OrderCombiner is OrderFulfiller, FulfillmentApplier {\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) OrderFulfiller(conduitController) {}\n\n    /**\n     * @notice Internal function to attempt to fill a group of orders, fully or\n     *         partially, with an arbitrary number of items for offer and\n     *         consideration per order alongside criteria resolvers containing\n     *         specific token identifiers and associated proofs. Any order that\n     *         is not currently active, has already been fully filled, or has\n     *         been cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *\n     * @param advancedOrders            The orders to fulfill along with the\n     *                                  fraction of those orders to attempt to\n     *                                  fill. Note that both the offerer and the\n     *                                  fulfiller must first approve this\n     *                                  contract (or a conduit if indicated by\n     *                                  the order) to transfer any relevant\n     *                                  tokens on their behalf and that\n     *                                  contracts must implement\n     *                                  `onERC1155Received` in order to receive\n     *                                  ERC1155 tokens as consideration. Also\n     *                                  note that all offer and consideration\n     *                                  components must have no remainder after\n     *                                  multiplication of the respective amount\n     *                                  with the supplied fraction for an\n     *                                  order's partial fill amount to be\n     *                                  considered valid.\n     * @param criteriaResolvers         An array where each element contains a\n     *                                  reference to a specific offer or\n     *                                  consideration, a token identifier, and a\n     *                                  proof that the supplied token identifier\n     *                                  is contained in the merkle root held by\n     *                                  the item in question's criteria element.\n     *                                  Note that an empty criteria indicates\n     *                                  that any (transferable) token\n     *                                  identifier on the token in question is\n     *                                  valid and that no associated proof needs\n     *                                  to be supplied.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used (and\n     *                                  direct approvals set on Consideration).\n     * @param recipient                 The intended recipient for all received\n     *                                  items.\n     * @param maximumFulfilled          The maximum number of orders to fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders.\n     */\n    function _fulfillAvailableAdvancedOrders(\n        AdvancedOrder[] memory advancedOrders,\n        CriteriaResolver[] memory criteriaResolvers,\n        FulfillmentComponent[][] memory offerFulfillments,\n        FulfillmentComponent[][] memory considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        address recipient,\n        uint256 maximumFulfilled\n    )\n        internal\n        returns (\n            bool[] memory /* availableOrders */,\n            Execution[] memory /* executions */\n        )\n    {\n        // Create a `false` boolean variable to indicate that invalid orders\n        // should NOT revert. Does not use a constant to avoid function\n        // specialization in solc that would increase contract size.\n        bool revertOnInvalid = _runTimeConstantFalse();\n        // Validate orders, apply amounts, & determine if they use conduits.\n        (\n            bytes32[] memory orderHashes,\n            bool containsNonOpen\n        ) = _validateOrdersAndPrepareToFulfill(\n                advancedOrders,\n                criteriaResolvers,\n                revertOnInvalid,\n                maximumFulfilled,\n                recipient\n            );\n\n        // Aggregate used offer and consideration items and execute transfers.\n        return\n            _executeAvailableFulfillments(\n                advancedOrders,\n                offerFulfillments,\n                considerationFulfillments,\n                fulfillerConduitKey,\n                recipient,\n                orderHashes,\n                containsNonOpen\n            );\n    }\n\n    /**\n     * @dev Internal function to validate a group of orders, update their\n     *      statuses, reduce amounts by their previously filled fractions, apply\n     *      criteria resolvers, and emit OrderFulfilled events. Note that this\n     *      function needs to be called before\n     *      _aggregateValidFulfillmentConsiderationItems to set the memory\n     *      layout that _aggregateValidFulfillmentConsiderationItems depends on.\n     *\n     * @param advancedOrders    The advanced orders to validate and reduce by\n     *                          their previously filled amounts.\n     * @param criteriaResolvers An array where each element contains a reference\n     *                          to a specific order as well as that order's\n     *                          offer or consideration, a token identifier, and\n     *                          a proof that the supplied token identifier is\n     *                          contained in the order's merkle root. Note that\n     *                          a root of zero indicates that any transferable\n     *                          token identifier is valid and that no proof\n     *                          needs to be supplied.\n     * @param revertOnInvalid   A boolean indicating whether to revert on any\n     *                          order being invalid; setting this to false will\n     *                          instead cause the invalid order to be skipped.\n     * @param maximumFulfilled  The maximum number of orders to fulfill.\n     * @param recipient         The intended recipient for all items that do not\n     *                          already have a designated recipient and are not\n     *                          already used as part of a provided fulfillment.\n     *\n     * @return orderHashes     The hashes of the orders being fulfilled.\n     * @return containsNonOpen A boolean indicating whether any restricted or\n     *                         contract orders are present within the provided\n     *                         array of advanced orders.\n     */\n    function _validateOrdersAndPrepareToFulfill(\n        AdvancedOrder[] memory advancedOrders,\n        CriteriaResolver[] memory criteriaResolvers,\n        bool revertOnInvalid,\n        uint256 maximumFulfilled,\n        address recipient\n    ) internal returns (bytes32[] memory orderHashes, bool containsNonOpen) {\n        // Ensure this function cannot be triggered during a reentrant call.\n        _setReentrancyGuard(true); // Native tokens accepted during execution.\n\n        // Declare \"terminal memory offset\" variable for use in efficient loops.\n        uint256 terminalMemoryOffset;\n\n        {\n            // Declare an error buffer indicating status of any native offer\n            // items. Native tokens may only be provided as part of contract\n            // orders or when fulfilling via matchOrders or matchAdvancedOrders;\n            // throw if bits indicating the conditions aren't met have been set.\n            uint256 invalidNativeOfferItemErrorBuffer;\n\n            // Use assembly to set the value for the second bit of error buffer.\n            assembly {\n                /**\n                 * Use the 231st bit of the error buffer to indicate whether the\n                 * current function is not matchAdvancedOrders or matchOrders.\n                 *\n                 * sig                                func\n                 * -------------------------------------------------------------\n                 * 1010100000010111010001000 0 000100 matchOrders\n                 * 1111001011010001001010110 0 010010 matchAdvancedOrders\n                 * 1110110110011000101001010 1 110100 fulfillAvailableOrders\n                 * 1000011100100000000110110 1 000001 fulfillAvailableAdvanced\n                 *                           ^ 7th bit\n                 */\n                invalidNativeOfferItemErrorBuffer := and(\n                    NonMatchSelector_MagicMask,\n                    calldataload(0)\n                )\n            }\n\n            unchecked {\n                // Read length of orders array and place on the stack.\n                uint256 totalOrders = advancedOrders.length;\n\n                // Track the order hash for each order being fulfilled.\n                orderHashes = new bytes32[](totalOrders);\n\n                // Determine the memory offset to terminate on during loops.\n                terminalMemoryOffset = (totalOrders + 1) << OneWordShift;\n            }\n\n            // Skip overflow checks as for loops are indexed starting at zero.\n            unchecked {\n                // Declare variable to track if order is not a contract order.\n                bool isNonContract;\n\n                // Iterate over each order.\n                for (\n                    uint256 i = OneWord;\n                    i < terminalMemoryOffset;\n                    i += OneWord\n                ) {\n                    // Retrieve order via pointer to bypass out-of-range check &\n                    // cast function to avoid additional memory allocation.\n                    AdvancedOrder memory advancedOrder = (\n                        _getReadAdvancedOrderByOffset()(advancedOrders, i)\n                    );\n\n                    // Validate it, update status, & determine fraction to fill.\n                    (\n                        bytes32 orderHash,\n                        uint256 numerator,\n                        uint256 denominator\n                    ) = _validateOrder(advancedOrder, revertOnInvalid);\n\n                    // Update the numerator on the order in question.\n                    advancedOrder.numerator = uint120(numerator);\n\n                    // Do not track hash or adjust prices if order is skipped.\n                    if (numerator == 0) {\n                        // Continue iterating through the remaining orders.\n                        continue;\n                    }\n\n                    // Update the denominator on the order in question.\n                    advancedOrder.denominator = uint120(denominator);\n\n                    // Otherwise, track the order hash in question.\n                    assembly {\n                        mstore(add(orderHashes, i), orderHash)\n                    }\n\n                    // Place the start time for the order on the stack.\n                    uint256 startTime = advancedOrder.parameters.startTime;\n\n                    // Place the end time for the order on the stack.\n                    uint256 endTime = advancedOrder.parameters.endTime;\n\n                    {\n                        // Determine order type, used to check for eligibility\n                        // for native token offer items as well as for presence\n                        // of restricted and contract orders or non-open orders.\n                        OrderType orderType = (\n                            advancedOrder.parameters.orderType\n                        );\n\n                        // Utilize assembly to efficiently check order types.\n                        // Note these checks expect that there are no order\n                        // types beyond current set (0-4) and will need to be\n                        // modified if more order types are added.\n                        assembly {\n                            // Assign the variable indicating if the order is\n                            // not a contract order.\n                            isNonContract := lt(orderType, 4)\n\n                            // Update the variable indicating if order is not an\n                            // open order & keep set if it has been set already.\n                            containsNonOpen := or(\n                                containsNonOpen,\n                                gt(orderType, 1)\n                            )\n                        }\n                    }\n\n                    // Retrieve array of offer items for the order in question.\n                    OfferItem[] memory offer = advancedOrder.parameters.offer;\n\n                    // Read length of offer array and place on the stack.\n                    uint256 totalOfferItems = offer.length;\n\n                    // Iterate over each offer item on the order.\n                    for (uint256 j = 0; j < totalOfferItems; ++j) {\n                        // Retrieve the offer item.\n                        OfferItem memory offerItem = offer[j];\n\n                        // If the offer item is for the native token and the\n                        // order type is not a contract order type, set the\n                        // first bit of the error buffer to true.\n                        assembly {\n                            invalidNativeOfferItemErrorBuffer := or(\n                                invalidNativeOfferItemErrorBuffer,\n                                lt(mload(offerItem), isNonContract)\n                            )\n                        }\n\n                        // Apply order fill fraction to offer item end amount.\n                        uint256 endAmount = _getFraction(\n                            numerator,\n                            denominator,\n                            offerItem.endAmount\n                        );\n\n                        // Reuse same fraction if start & end amounts are equal.\n                        if (offerItem.startAmount == offerItem.endAmount) {\n                            // Apply derived amount to both start & end amount.\n                            offerItem.startAmount = endAmount;\n                        } else {\n                            // Apply order fill fraction to item start amount.\n                            offerItem.startAmount = _getFraction(\n                                numerator,\n                                denominator,\n                                offerItem.startAmount\n                            );\n                        }\n\n                        // Adjust offer amount using current time; round down.\n                        uint256 currentAmount = _locateCurrentAmount(\n                            offerItem.startAmount,\n                            endAmount,\n                            startTime,\n                            endTime,\n                            _runTimeConstantFalse() // round down\n                        );\n\n                        // Update amounts in memory to match the current amount.\n                        // Note the end amount is used to track spent amounts.\n                        offerItem.startAmount = currentAmount;\n                        offerItem.endAmount = currentAmount;\n                    }\n\n                    // Retrieve consideration item array for order in question.\n                    ConsiderationItem[] memory consideration = (\n                        advancedOrder.parameters.consideration\n                    );\n\n                    // Read length of consideration array and place on stack.\n                    uint256 totalConsiderationItems = consideration.length;\n\n                    // Iterate over each consideration item on the order.\n                    for (uint256 j = 0; j < totalConsiderationItems; ++j) {\n                        // Retrieve the consideration item.\n                        ConsiderationItem memory considerationItem = (\n                            consideration[j]\n                        );\n\n                        // Apply fraction to consideration item end amount.\n                        uint256 endAmount = _getFraction(\n                            numerator,\n                            denominator,\n                            considerationItem.endAmount\n                        );\n\n                        // Reuse same fraction if start & end amounts are equal.\n                        if (\n                            considerationItem.startAmount ==\n                            considerationItem.endAmount\n                        ) {\n                            // Apply derived amount to both start & end amount.\n                            considerationItem.startAmount = endAmount;\n                        } else {\n                            // Apply fraction to item start amount.\n                            considerationItem.startAmount = _getFraction(\n                                numerator,\n                                denominator,\n                                considerationItem.startAmount\n                            );\n                        }\n\n                        // Adjust amount using current time; round up.\n                        uint256 currentAmount = (\n                            _locateCurrentAmount(\n                                considerationItem.startAmount,\n                                endAmount,\n                                startTime,\n                                endTime,\n                                _runTimeConstantTrue() // round up\n                            )\n                        );\n\n                        // Set the start amount as equal to the current amount.\n                        considerationItem.startAmount = currentAmount;\n\n                        // Utilize assembly to manually \"shift\" the recipient\n                        // value, then copy the start amount to the recipient.\n                        // Note that this sets up the memory layout that is\n                        // subsequently relied upon by\n                        // _aggregateValidFulfillmentConsiderationItems as well\n                        // as during comparison to generated contract orders.\n                        assembly {\n                            // Derive pointer to the recipient using the item\n                            // pointer along with the offset to the recipient.\n                            let considerationItemRecipientPtr := add(\n                                considerationItem,\n                                ConsiderationItem_recipient_offset\n                            )\n\n                            // Write recipient to endAmount, as endAmount is not\n                            // used from this point on and can be repurposed to\n                            // fit the layout of a ReceivedItem.\n                            mstore(\n                                add(\n                                    considerationItem,\n                                    // Note that this value used to be endAmount\n                                    ReceivedItem_recipient_offset\n                                ),\n                                mload(considerationItemRecipientPtr)\n                            )\n\n                            // Write startAmount to recipient, as recipient is\n                            // not used from this point on and can be repurposed\n                            // to track received amounts.\n                            mstore(considerationItemRecipientPtr, currentAmount)\n                        }\n                    }\n                }\n            }\n\n            // If the first bit is set, a native offer item was encountered on\n            // an order that is not a contract order. If the 231st bit is set in\n            // the error buffer, the current function is not matchOrders or\n            // matchAdvancedOrders. If the value is 1 + (1 << 230), then both\n            // 1st and 231st bits were set; in that case, revert with an error.\n            if (\n                invalidNativeOfferItemErrorBuffer ==\n                NonMatchSelector_InvalidErrorValue\n            ) {\n                _revertInvalidNativeOfferItem();\n            }\n        }\n\n        // Apply criteria resolvers to each order as applicable.\n        _applyCriteriaResolvers(advancedOrders, criteriaResolvers);\n\n        // Iterate over each order to check authorization status (for restricted\n        // orders), generate orders (for contract orders), and emit events (for\n        // all available orders) signifying that they have been fulfilled.\n        // Skip overflow checks as all for loops are indexed starting at zero.\n        unchecked {\n            // Declare stack variable outside of the loop to track order hash.\n            bytes32 orderHash;\n\n            // Track whether any orders are still available for fulfillment.\n            bool someOrderAvailable = false;\n\n            // Iterate over each order.\n            for (uint256 i = OneWord; i < terminalMemoryOffset; i += OneWord) {\n                // Retrieve order hash, bypassing out-of-range check.\n                assembly {\n                    orderHash := mload(add(orderHashes, i))\n                }\n\n                // Do not emit an event if no order hash is present.\n                if (orderHash == bytes32(0)) {\n                    continue;\n                }\n\n                // Retrieve order using pointer libraries to bypass out-of-range\n                // check & cast function to avoid additional memory allocation.\n                AdvancedOrder memory advancedOrder = (\n                    _getReadAdvancedOrderByOffset()(advancedOrders, i)\n                );\n\n                // Determine if max number orders have already been fulfilled.\n                if (maximumFulfilled == 0) {\n                    // If so, set the order hash to zero.\n                    assembly {\n                        mstore(add(orderHashes, i), 0)\n                    }\n\n                    // Set the numerator to zero to signal to skip the order.\n                    advancedOrder.numerator = 0;\n\n                    // Continue iterating through the remaining orders.\n                    continue;\n                }\n\n                // Handle final checks and status updates based on order type.\n                if (advancedOrder.parameters.orderType != OrderType.CONTRACT) {\n                    // Check authorization for restricted orders.\n                    if (\n                        !_checkRestrictedAdvancedOrderAuthorization(\n                            advancedOrder,\n                            orderHashes,\n                            orderHash,\n                            (i >> OneWordShift) - 1,\n                            revertOnInvalid\n                        )\n                    ) {\n                        // If authorization check fails, set order hash to zero.\n                        assembly {\n                            mstore(add(orderHashes, i), 0)\n                        }\n\n                        // Set numerator to zero to signal to skip the order.\n                        advancedOrder.numerator = 0;\n\n                        // Continue iterating through the remaining orders.\n                        continue;\n                    }\n\n                    // Update status as long as some fraction is available.\n                    if (\n                        !_updateStatus(\n                            orderHash,\n                            advancedOrder.numerator,\n                            advancedOrder.denominator,\n                            _revertOnFailedUpdate(\n                                advancedOrder.parameters,\n                                revertOnInvalid\n                            )\n                        )\n                    ) {\n                        // If status update fails, set the order hash to zero.\n                        assembly {\n                            mstore(add(orderHashes, i), 0)\n                        }\n\n                        // Set numerator to zero to signal to skip the order.\n                        advancedOrder.numerator = 0;\n\n                        // Continue iterating through the remaining orders.\n                        continue;\n                    }\n                } else {\n                    // Return the generated order based on the order params and\n                    // the provided extra data. If revertOnInvalid is true, the\n                    // function will revert if the input is invalid.\n                    orderHash = _getGeneratedOrder(\n                        advancedOrder.parameters,\n                        advancedOrder.extraData,\n                        revertOnInvalid\n                    );\n\n                    // Write the derived order hash to the order hashes array.\n                    assembly {\n                        mstore(add(orderHashes, i), orderHash)\n                    }\n\n                    // Handle invalid orders, indicated by a zero order hash.\n                    if (orderHash == bytes32(0)) {\n                        // Set numerator to zero to signal to skip the order.\n                        advancedOrder.numerator = 0;\n\n                        // Continue iterating through the remaining orders.\n                        continue;\n                    }\n                }\n\n                // Decrement the number of fulfilled orders.\n                // Skip underflow check as the condition before\n                // implies that maximumFulfilled > 0.\n                --maximumFulfilled;\n\n                // Retrieve parameters for the order in question.\n                OrderParameters memory orderParameters = (\n                    advancedOrder.parameters\n                );\n\n                // Emit an OrderFulfilled event.\n                _emitOrderFulfilledEvent(\n                    orderHash,\n                    orderParameters.offerer,\n                    orderParameters.zone,\n                    recipient,\n                    orderParameters.offer,\n                    orderParameters.consideration\n                );\n\n                // Set the flag indicating that some order is available.\n                someOrderAvailable = true;\n            }\n\n            // Revert if no orders are available.\n            if (!someOrderAvailable) {\n                _revertNoSpecifiedOrdersAvailable();\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to fulfill a group of validated orders, fully or\n     *      partially, with an arbitrary number of items for offer and\n     *      consideration per order and to execute transfers. Any order that is\n     *      not currently active, has already been fully filled, or has been\n     *      cancelled will be omitted. Remaining offer and consideration items\n     *      will then be aggregated where possible as indicated by the supplied\n     *      offer and consideration component arrays and aggregated items will\n     *      be transferred to the fulfiller or to each intended recipient,\n     *      respectively. Note that a failing item transfer or an issue with\n     *      order formatting will cause the entire batch to fail.\n     *\n     * @param advancedOrders            The orders to fulfill along with the\n     *                                  fraction of those orders to attempt to\n     *                                  fill. Note that both the offerer and the\n     *                                  fulfiller must first approve this\n     *                                  contract (or the conduit if indicated by\n     *                                  the order) to transfer any relevant\n     *                                  tokens on their behalf and that\n     *                                  contracts must implement\n     *                                  `onERC1155Received` in order to receive\n     *                                  ERC1155 tokens as consideration. Also\n     *                                  note that all offer and consideration\n     *                                  components must have no remainder after\n     *                                  multiplication of the respective amount\n     *                                  with the supplied fraction for an\n     *                                  order's partial fill amount to be\n     *                                  considered valid.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used, with\n     *                                  direct approvals set on Consideration.\n     * @param recipient                 The intended recipient for all items\n     *                                  that do not already have a designated\n     *                                  recipient and are not already used as\n     *                                  part of a provided fulfillment.\n     * @param orderHashes               An array of order hashes for each order.\n     * @param containsNonOpen           A boolean indicating whether any\n     *                                  restricted or contract orders are\n     *                                  present within the provided array of\n     *                                  advanced orders.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders.\n     */\n    function _executeAvailableFulfillments(\n        AdvancedOrder[] memory advancedOrders,\n        FulfillmentComponent[][] memory offerFulfillments,\n        FulfillmentComponent[][] memory considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        address recipient,\n        bytes32[] memory orderHashes,\n        bool containsNonOpen\n    )\n        internal\n        returns (bool[] memory availableOrders, Execution[] memory executions)\n    {\n        // Retrieve length of offer fulfillments array and place on the stack.\n        uint256 totalOfferFulfillments = offerFulfillments.length;\n\n        // Retrieve length of consideration fulfillments array & place on stack.\n        uint256 totalConsiderationFulfillments = (\n            considerationFulfillments.length\n        );\n\n        // Allocate an execution for each offer and consideration fulfillment.\n        executions = new Execution[](\n            totalOfferFulfillments + totalConsiderationFulfillments\n        );\n\n        // Skip overflow checks as all for loops are indexed starting at zero.\n        unchecked {\n            // Iterate over each offer fulfillment.\n            for (uint256 i = 0; i < totalOfferFulfillments; ++i) {\n                // Derive aggregated execution corresponding with fulfillment\n                // and assign it to the executions array.\n                executions[i] = _aggregateAvailable(\n                    advancedOrders,\n                    Side.OFFER,\n                    offerFulfillments[i],\n                    fulfillerConduitKey,\n                    recipient\n                );\n            }\n\n            // Iterate over each consideration fulfillment.\n            for (uint256 i = 0; i < totalConsiderationFulfillments; ++i) {\n                // Derive aggregated execution corresponding with fulfillment\n                // and assign it to the executions array.\n                executions[i + totalOfferFulfillments] = _aggregateAvailable(\n                    advancedOrders,\n                    Side.CONSIDERATION,\n                    considerationFulfillments[i],\n                    fulfillerConduitKey,\n                    address(0) // unused\n                );\n            }\n        }\n\n        // Perform final checks and return.\n        availableOrders = _performFinalChecksAndExecuteOrders(\n            advancedOrders,\n            executions,\n            orderHashes,\n            recipient,\n            containsNonOpen\n        );\n\n        return (availableOrders, executions);\n    }\n\n    /**\n     * @dev Internal function to perform a final check that each consideration\n     *      item for an arbitrary number of fulfilled orders has been met and to\n     *      trigger associated executions, transferring the respective items.\n     *\n     * @param advancedOrders  The orders to check and perform executions for.\n     * @param executions      An array of elements indicating the sequence of\n     *                        transfers to perform when fulfilling the given\n     *                        orders.\n     * @param orderHashes     An array of order hashes for each order.\n     * @param recipient       The intended recipient for all items that do not\n     *                        already have a designated recipient and are not\n     *                        used as part of a provided fulfillment.\n     * @param containsNonOpen A boolean indicating whether any restricted or\n     *                        contract orders are present within the provided\n     *                        array of advanced orders.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     */\n    function _performFinalChecksAndExecuteOrders(\n        AdvancedOrder[] memory advancedOrders,\n        Execution[] memory executions,\n        bytes32[] memory orderHashes,\n        address recipient,\n        bool containsNonOpen\n    ) internal returns (bool[] memory /* availableOrders */) {\n        // Retrieve the length of the advanced orders array and place on stack.\n        uint256 totalOrders = advancedOrders.length;\n\n        // Initialize array for tracking available orders.\n        bool[] memory availableOrders = new bool[](totalOrders);\n\n        // Initialize an accumulator array. From this point forward, no new\n        // memory regions can be safely allocated until the accumulator is no\n        // longer being utilized, as the accumulator operates in an open-ended\n        // fashion from this memory pointer; existing memory may still be\n        // accessed and modified, however.\n        bytes memory accumulator = new bytes(AccumulatorDisarmed);\n\n        // Skip overflow check: loop index & executions length are both bounded.\n        unchecked {\n            // Determine the memory offset to terminate on during loops.\n            uint256 terminalMemoryOffset = ((executions.length + 1) <<\n                OneWordShift);\n\n            // Iterate over each execution.\n            for (uint256 i = OneWord; i < terminalMemoryOffset; i += OneWord) {\n                // Get execution using pointer libraries to bypass out-of-range\n                // check & cast function to avoid additional memory allocation.\n                Execution memory execution = (\n                    _getReadExecutionByOffset()(executions, i)\n                );\n\n                // Retrieve the associated received item and amount.\n                ReceivedItem memory item = execution.item;\n                uint256 amount = item.amount;\n\n                // Transfer the item specified by the execution as long as the\n                // execution is not a zero-amount execution (which can occur if\n                // the corresponding fulfillment contained only items on orders\n                // that are unavailable or are out of range of the respective\n                // item array).\n                if (amount != 0) {\n                    // Utilize assembly to check for native token balance.\n                    assembly {\n                        // Ensure a sufficient native balance if relevant.\n                        if and(\n                            iszero(mload(item)), // itemType == ItemType.NATIVE\n                            // item.amount > address(this).balance\n                            gt(amount, selfbalance())\n                        ) {\n                            // Store left-padded selector with push4,\n                            // mem[28:32] = selector\n                            mstore(\n                                0,\n                                InsufficientNativeTokensSupplied_error_selector\n                            )\n\n                            // revert(abi.encodeWithSignature(\n                            //   \"InsufficientNativeTokensSupplied()\"\n                            // ))\n                            revert(\n                                Error_selector_offset,\n                                InsufficientNativeTokensSupplied_error_length\n                            )\n                        }\n                    }\n\n                    // Transfer the item specified by the execution.\n                    _transfer(\n                        item,\n                        execution.offerer,\n                        execution.conduitKey,\n                        accumulator\n                    );\n                }\n            }\n        }\n\n        // Skip overflow checks as all for loops are indexed starting at zero.\n        unchecked {\n            // Iterate over each order.\n            for (uint256 i = 0; i < totalOrders; ++i) {\n                // Retrieve the order in question.\n                AdvancedOrder memory advancedOrder = advancedOrders[i];\n\n                // Skip the order in question if not being not fulfilled.\n                if (advancedOrder.numerator == 0) {\n                    // Explicitly set availableOrders at the given index to\n                    // guard against the possibility of dirtied memory.\n                    availableOrders[i] = false;\n                    continue;\n                }\n\n                // Mark the order as available.\n                availableOrders[i] = true;\n\n                // Retrieve the order parameters.\n                OrderParameters memory parameters = advancedOrder.parameters;\n\n                {\n                    // Retrieve offer items.\n                    OfferItem[] memory offer = parameters.offer;\n\n                    // Read length of offer array & place on the stack.\n                    uint256 totalOfferItems = offer.length;\n\n                    // Iterate over each offer item to restore it.\n                    for (uint256 j = 0; j < totalOfferItems; ++j) {\n                        // Retrieve the offer item in question.\n                        OfferItem memory offerItem = offer[j];\n\n                        // Transfer to recipient if unspent amount is not zero.\n                        // Note that the transfer will not be reflected in the\n                        // executions array.\n                        if (offerItem.startAmount != 0) {\n                            // Replace endAmount parameter with the recipient to\n                            // make offerItem compatible with the ReceivedItem\n                            // input to _transfer & cache the original endAmount\n                            // so it can be restored after the transfer.\n                            uint256 originalEndAmount = (\n                                _replaceEndAmountWithRecipient(\n                                    offerItem,\n                                    recipient\n                                )\n                            );\n\n                            // Transfer excess offer item amount to recipient.\n                            _toOfferItemInput(_transfer)(\n                                offerItem,\n                                parameters.offerer,\n                                parameters.conduitKey,\n                                accumulator\n                            );\n\n                            // Restore the original endAmount in offerItem.\n                            assembly {\n                                mstore(\n                                    add(\n                                        offerItem,\n                                        ReceivedItem_recipient_offset\n                                    ),\n                                    originalEndAmount\n                                )\n                            }\n                        }\n\n                        // Restore original amount on the offer item.\n                        offerItem.startAmount = offerItem.endAmount;\n                    }\n                }\n\n                {\n                    // Read consideration items & ensure they are fulfilled.\n                    ConsiderationItem[] memory consideration = (\n                        parameters.consideration\n                    );\n\n                    // Read length of consideration array & place on stack.\n                    uint256 totalConsiderationItems = consideration.length;\n\n                    // Iterate over each consideration item.\n                    for (uint256 j = 0; j < totalConsiderationItems; ++j) {\n                        ConsiderationItem memory considerationItem = (\n                            consideration[j]\n                        );\n\n                        // Retrieve remaining amount on consideration item.\n                        uint256 unmetAmount = considerationItem.startAmount;\n\n                        // Revert if the remaining amount is not zero.\n                        if (unmetAmount != 0) {\n                            _revertConsiderationNotMet(i, j, unmetAmount);\n                        }\n\n                        // Utilize assembly to restore the original value.\n                        assembly {\n                            // Write recipient to startAmount.\n                            mstore(\n                                add(\n                                    considerationItem,\n                                    ReceivedItem_amount_offset\n                                ),\n                                mload(\n                                    add(\n                                        considerationItem,\n                                        ConsiderationItem_recipient_offset\n                                    )\n                                )\n                            )\n                        }\n                    }\n                }\n            }\n        }\n\n        // Trigger any accumulated transfers via call to the conduit.\n        _triggerIfArmed(accumulator);\n\n        // Determine whether any native token balance remains.\n        uint256 remainingNativeTokenBalance;\n        assembly {\n            remainingNativeTokenBalance := selfbalance()\n        }\n\n        // Return any remaining native token balance to the caller.\n        if (remainingNativeTokenBalance != 0) {\n            _transferNativeTokens(\n                payable(msg.sender),\n                remainingNativeTokenBalance\n            );\n        }\n\n        // If any restricted or contract orders are present in the group of\n        // orders being fulfilled, perform any validateOrder or ratifyOrder\n        // calls after all executions and related transfers are complete.\n        if (containsNonOpen) {\n            // Iterate over each order a second time.\n            for (uint256 i = 0; i < totalOrders; ) {\n                // Ensure the order in question is being fulfilled.\n                if (availableOrders[i]) {\n                    // Check restricted orders and contract orders.\n                    _assertRestrictedAdvancedOrderValidity(\n                        advancedOrders[i],\n                        orderHashes,\n                        orderHashes[i]\n                    );\n                }\n\n                // Skip overflow checks as for loop is indexed starting at zero.\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n\n        // Clear the reentrancy guard.\n        _clearReentrancyGuard();\n\n        // Return the array containing available orders.\n        return availableOrders;\n    }\n\n    /**\n     * @dev Internal function to emit an OrdersMatched event using the same\n     *      memory region as the existing order hash array.\n     *\n     * @param orderHashes An array of order hashes to include as an argument for\n     *                    the OrdersMatched event.\n     */\n    function _emitOrdersMatched(bytes32[] memory orderHashes) internal {\n        assembly {\n            // Load the array length from memory.\n            let length := mload(orderHashes)\n\n            // Get the full size of the event data - one word for the offset,\n            // one for the array length and one per hash.\n            let dataSize := add(TwoWords, shl(OneWordShift, length))\n\n            // Get pointer to start of data, reusing word before array length\n            // for the offset.\n            let dataPointer := sub(orderHashes, OneWord)\n\n            // Cache the existing word in memory at the offset pointer.\n            let cache := mload(dataPointer)\n\n            // Write an offset of 32.\n            mstore(dataPointer, OneWord)\n\n            // Emit the OrdersMatched event.\n            log1(dataPointer, dataSize, OrdersMatchedTopic0)\n\n            // Restore the cached word.\n            mstore(dataPointer, cache)\n        }\n    }\n\n    /**\n     * @dev Internal function to match an arbitrary number of full or partial\n     *      orders, each with an arbitrary number of items for offer and\n     *      consideration, supplying criteria resolvers containing specific\n     *      token identifiers and associated proofs as well as fulfillments\n     *      allocating offer components to consideration components.\n     *\n     * @param advancedOrders    The advanced orders to match. Note that both the\n     *                          offerer and fulfiller on each order must first\n     *                          approve this contract (or their conduit if\n     *                          indicated by the order) to transfer any relevant\n     *                          tokens on their behalf and each consideration\n     *                          recipient must implement `onERC1155Received` in\n     *                          order to receive ERC1155 tokens. Also note that\n     *                          the offer and consideration components for each\n     *                          order must have no remainder after multiplying\n     *                          the respective amount with the supplied fraction\n     *                          in order for the group of partial fills to be\n     *                          considered valid.\n     * @param criteriaResolvers An array where each element contains a reference\n     *                          to a specific order as well as that order's\n     *                          offer or consideration, a token identifier, and\n     *                          a proof that the supplied token identifier is\n     *                          contained in the order's merkle root. Note that\n     *                          an empty root indicates that any (transferable)\n     *                          token identifier is valid and that no associated\n     *                          proof needs to be supplied.\n     * @param fulfillments      An array of elements allocating offer components\n     *                          to consideration components. Note that each\n     *                          consideration component must be fully met in\n     *                          order for the match operation to be valid.\n     * @param recipient         The intended recipient for all unspent offer\n     *                          item amounts.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders.\n     */\n    function _matchAdvancedOrders(\n        AdvancedOrder[] memory advancedOrders,\n        CriteriaResolver[] memory criteriaResolvers,\n        Fulfillment[] memory fulfillments,\n        address recipient\n    ) internal returns (Execution[] memory /* executions */) {\n        // Create a `true` boolean variable to indicate that invalid orders\n        // should revert. Does not use a constant to avoid function\n        // specialization in solc that would increase contract size.\n        bool revertOnInvalid = _runTimeConstantTrue();\n        // Validate orders, update order status, and determine item amounts.\n        (\n            bytes32[] memory orderHashes,\n            bool containsNonOpen\n        ) = _validateOrdersAndPrepareToFulfill(\n                advancedOrders,\n                criteriaResolvers,\n                revertOnInvalid,\n                advancedOrders.length,\n                recipient\n            );\n\n        // Emit OrdersMatched event, providing an array of matched order hashes.\n        _emitOrdersMatched(orderHashes);\n\n        // Fulfill the orders using the supplied fulfillments and recipient.\n        return\n            _fulfillAdvancedOrders(\n                advancedOrders,\n                fulfillments,\n                orderHashes,\n                recipient,\n                containsNonOpen\n            );\n    }\n\n    /**\n     * @dev Internal function to fulfill an arbitrary number of orders, either\n     *      full or partial, after validating, adjusting amounts, and applying\n     *      criteria resolvers.\n     *\n     * @param advancedOrders  The orders to match, including a fraction to\n     *                        attempt to fill for each order.\n     * @param fulfillments    An array of elements allocating offer components\n     *                        to consideration components. Note that the final\n     *                        amount of each consideration component must be\n     *                        zero for a match operation to be considered valid.\n     * @param orderHashes     An array of order hashes for each order.\n     * @param recipient       The intended recipient for all items that do not\n     *                        already have a designated recipient and are not\n     *                        used as part of a provided fulfillment.\n     * @param containsNonOpen A boolean indicating whether any restricted or\n     *                        contract orders are present within the provided\n     *                        array of advanced orders.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders.\n     */\n    function _fulfillAdvancedOrders(\n        AdvancedOrder[] memory advancedOrders,\n        Fulfillment[] memory fulfillments,\n        bytes32[] memory orderHashes,\n        address recipient,\n        bool containsNonOpen\n    ) internal returns (Execution[] memory executions) {\n        // Retrieve fulfillments array length and place on the stack.\n        uint256 totalFulfillments = fulfillments.length;\n\n        // Allocate executions by fulfillment and apply them to each execution.\n        executions = new Execution[](totalFulfillments);\n\n        // Skip overflow checks as all for loops are indexed starting at zero.\n        unchecked {\n            // Iterate over each fulfillment.\n            for (uint256 i = 0; i < totalFulfillments; ++i) {\n                /// Retrieve the fulfillment in question.\n                Fulfillment memory fulfillment = fulfillments[i];\n\n                // Derive the execution corresponding with the fulfillment and\n                // assign it to the executions array.\n                executions[i] = _applyFulfillment(\n                    advancedOrders,\n                    fulfillment.offerComponents,\n                    fulfillment.considerationComponents,\n                    i\n                );\n            }\n        }\n\n        // Perform final checks and execute orders.\n        _performFinalChecksAndExecuteOrders(\n            advancedOrders,\n            executions,\n            orderHashes,\n            recipient,\n            containsNonOpen\n        );\n\n        // Return the executions array.\n        return executions;\n    }\n\n    /**\n     * @dev Internal view function to determine whether a status update failure\n     *      should cause a revert or allow a skipped order. The call must revert\n     *      if an `authorizeOrder` call has been successfully performed and the\n     *      status update cannot be performed, regardless of whether the order\n     *      could be otherwise marked as skipped. Note that a revert is not\n     *      required on a failed update if the call originates from the zone, as\n     *      no `authorizeOrder` call is performed in that case.\n     *\n     * @param orderParameters The order parameters in question.\n     * @param revertOnInvalid A boolean indicating whether the call should\n     *                        revert for non-restricted order types.\n     *\n     * @return revertOnFailedUpdate A boolean indicating whether the order\n     *                              should revert on a failed status update.\n     */\n    function _revertOnFailedUpdate(\n        OrderParameters memory orderParameters,\n        bool revertOnInvalid\n    ) internal view returns (bool revertOnFailedUpdate) {\n        OrderType orderType = orderParameters.orderType;\n        address zone = orderParameters.zone;\n        assembly {\n            revertOnFailedUpdate := or(\n                revertOnInvalid,\n                and(gt(orderType, 1), iszero(eq(caller(), zone)))\n            )\n        }\n    }\n}\n"},"src/lib/CounterManager.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ConsiderationEventsAndErrors\n} from \"seaport-types/src/interfaces/ConsiderationEventsAndErrors.sol\";\n\nimport { ReentrancyGuard } from \"./ReentrancyGuard.sol\";\n\nimport {\n    Counter_blockhash_shift,\n    OneWord,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\n/**\n * @title CounterManager\n * @author 0age\n * @notice CounterManager contains a storage mapping and related functionality\n *         for retrieving and incrementing a per-offerer counter.\n */\ncontract CounterManager is ConsiderationEventsAndErrors, ReentrancyGuard {\n    // Only orders signed using an offerer's current counter are fulfillable.\n    mapping(address => uint256) private _counters;\n\n    /**\n     * @dev Internal function to cancel all orders from a given offerer in bulk\n     *      by incrementing a counter by a large, quasi-random interval. Note\n     *      that only the offerer may increment the counter. Note that the\n     *      counter is incremented by a large, quasi-random interval, which\n     *      makes it infeasible to \"activate\" signed orders by incrementing the\n     *      counter.  This activation functionality can be achieved instead with\n     *      restricted orders or contract orders.\n     *\n     * @return newCounter The new counter.\n     */\n    function _incrementCounter() internal returns (uint256 newCounter) {\n        // Ensure that the reentrancy guard is not currently set.\n        _assertNonReentrant();\n\n        // Utilize assembly to access counters storage mapping directly. Skip\n        // overflow check as counter cannot be incremented that far.\n        assembly {\n            // Use second half of previous block hash as a quasi-random number.\n            let quasiRandomNumber := shr(\n                Counter_blockhash_shift,\n                blockhash(sub(number(), 1))\n            )\n\n            // Write the caller to scratch space.\n            mstore(0, caller())\n\n            // Write the storage slot for _counters to scratch space.\n            mstore(OneWord, _counters.slot)\n\n            // Derive the storage pointer for the counter value.\n            let storagePointer := keccak256(0, TwoWords)\n\n            // Derive new counter value using random number and original value.\n            newCounter := add(quasiRandomNumber, sload(storagePointer))\n\n            // Store the updated counter value.\n            sstore(storagePointer, newCounter)\n        }\n\n        // Emit an event containing the new counter.\n        emit CounterIncremented(newCounter, msg.sender);\n    }\n\n    /**\n     * @dev Internal view function to retrieve the current counter for a given\n     *      offerer.\n     *\n     * @param offerer The offerer in question.\n     *\n     * @return currentCounter The current counter.\n     */\n    function _getCounter(\n        address offerer\n    ) internal view returns (uint256 currentCounter) {\n        // Return the counter for the supplied offerer.\n        currentCounter = _counters[offerer];\n    }\n}\n"},"src/lib/OrderFulfiller.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ItemType,\n    OrderType\n} from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    ConsiderationItem,\n    CriteriaResolver,\n    OfferItem,\n    OrderParameters,\n    ReceivedItem,\n    SpentItem\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { BasicOrderFulfiller } from \"./BasicOrderFulfiller.sol\";\n\nimport { CriteriaResolution } from \"./CriteriaResolution.sol\";\n\nimport { AmountDeriver } from \"./AmountDeriver.sol\";\n\nimport {\n    _revertInsufficientNativeTokensSupplied,\n    _revertInvalidNativeOfferItem\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    AccumulatorDisarmed,\n    ConsiderationItem_recipient_offset,\n    ReceivedItem_amount_offset,\n    ReceivedItem_recipient_offset\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\n/**\n * @title OrderFulfiller\n * @author 0age\n * @notice OrderFulfiller contains logic related to order fulfillment where a\n *         single order is being fulfilled and where basic order fulfillment is\n *         not available as an option.\n */\ncontract OrderFulfiller is\n    BasicOrderFulfiller,\n    CriteriaResolution,\n    AmountDeriver\n{\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(\n        address conduitController\n    ) BasicOrderFulfiller(conduitController) {}\n\n    /**\n     * @dev Internal function to validate an order and update its status, adjust\n     *      prices based on current time, apply criteria resolvers, determine\n     *      what portion to fill, and transfer relevant tokens.\n     *\n     * @param advancedOrder       The order to fulfill as well as the fraction\n     *                            to fill. Note that all offer and consideration\n     *                            components must divide with no remainder for\n     *                            the partial fill to be valid.\n     * @param criteriaResolvers   An array where each element contains a\n     *                            reference to a specific offer or\n     *                            consideration, a token identifier, and a proof\n     *                            that the supplied token identifier is\n     *                            contained in the order's merkle root. Note\n     *                            that a criteria of zero indicates that any\n     *                            (transferable) token identifier is valid and\n     *                            that no proof needs to be supplied.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     * @param recipient           The intended recipient for all received items.\n     *\n     * @return A boolean indicating whether the order has been fulfilled.\n     */\n    function _validateAndFulfillAdvancedOrder(\n        AdvancedOrder memory advancedOrder,\n        CriteriaResolver[] memory criteriaResolvers,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) internal returns (bool) {\n        // Retrieve the order parameters and order type.\n        OrderParameters memory orderParameters = advancedOrder.parameters;\n        OrderType orderType = orderParameters.orderType;\n\n        // Ensure this function cannot be triggered during a reentrant call.\n        _setReentrancyGuard(\n            // Native tokens accepted during execution for contract order types.\n            orderType == OrderType.CONTRACT\n        );\n\n        // Validate order, update status, and determine fraction to fill.\n        (\n            bytes32 orderHash,\n            uint256 fillNumerator,\n            uint256 fillDenominator\n        ) = _validateOrder(advancedOrder, _runTimeConstantTrue());\n\n        // Create an array with length 1 containing the order.\n        AdvancedOrder[] memory advancedOrders = new AdvancedOrder[](1);\n\n        // Populate the order as the first and only element of the new array.\n        advancedOrders[0] = advancedOrder;\n\n        // Apply criteria resolvers using generated orders and details arrays.\n        _applyCriteriaResolvers(advancedOrders, criteriaResolvers);\n\n        // Derive each item transfer with the appropriate fractional amount.\n        _applyFractions(\n            orderParameters,\n            fillNumerator,\n            fillDenominator,\n            recipient\n        );\n\n        // Declare an empty length-1 array to hold the order hash, but do not\n        // write to it until after the order has been authorized or generated.\n        bytes32[] memory orderHashes = new bytes32[](1);\n\n        // Declare a boolean that cannot be optimized out by the compiler\n        // outside of the if-else statement so it can be used in either.\n        bool _true = _runTimeConstantTrue();\n        if (orderType != OrderType.CONTRACT) {\n            _assertRestrictedAdvancedOrderAuthorization(\n                advancedOrder,\n                orderHashes,\n                orderHash,\n                0\n            );\n\n            _updateStatus(orderHash, fillNumerator, fillDenominator, _true);\n        } else {\n            // Return the generated order based on the order params and the\n            // provided extra data.\n            orderHash = _getGeneratedOrder(\n                orderParameters,\n                advancedOrder.extraData,\n                _true\n            );\n        }\n\n        _transferEach(orderParameters, fulfillerConduitKey, recipient);\n\n        // Write the order hash to the orderHashes array.\n        orderHashes[0] = orderHash;\n\n        // Ensure restricted orders have a valid submitter or pass a zone check.\n        _assertRestrictedAdvancedOrderValidity(\n            advancedOrder,\n            orderHashes,\n            orderHash\n        );\n\n        // Emit an event signifying that the order has been fulfilled.\n        _emitOrderFulfilledEvent(\n            orderHash,\n            orderParameters.offerer,\n            orderParameters.zone,\n            recipient,\n            orderParameters.offer,\n            orderParameters.consideration\n        );\n\n        // Clear the reentrancy guard.\n        _clearReentrancyGuard();\n\n        return true;\n    }\n\n    /**\n     * @dev Internal function to derive the amount to transfer for each item in\n     *      a given order based on the fraction to fill and the current time.\n     *\n     * @param orderParameters     The parameters for the fulfilled order.\n     * @param numerator           A value indicating the portion of the order\n     *                            that should be filled.\n     * @param denominator         A value indicating the total order size.\n     * @param recipient           The intended recipient for all received items.\n     */\n    function _applyFractions(\n        OrderParameters memory orderParameters,\n        uint256 numerator,\n        uint256 denominator,\n        address recipient\n    ) internal view {\n        // Read start time & end time from order parameters and place on stack.\n        uint256 startTime = orderParameters.startTime;\n        uint256 endTime = orderParameters.endTime;\n\n        // As of solidity 0.6.0, inline assembly cannot directly access function\n        // definitions, but can still access locally scoped function variables.\n        // This means that a local variable to reference the internal function\n        // definition (using the same type), along with a local variable with\n        // the desired type, must first be created. Then, the original function\n        // pointer can be recast to the desired type.\n\n        /**\n         * Repurpose existing OfferItem memory regions on the offer array for\n         * the order by overriding the _transfer function pointer to accept a\n         * modified OfferItem argument in place of the usual ReceivedItem:\n         *\n         *   ========= OfferItem ==========   ====== ReceivedItem ======\n         *   ItemType itemType; ------------> ItemType itemType;\n         *   address token; ----------------> address token;\n         *   uint256 identifierOrCriteria; -> uint256 identifier;\n         *   uint256 startAmount; ----------> uint256 amount;\n         *   uint256 endAmount; ------------> address recipient;\n         */\n\n        // Declare a nested scope to minimize stack depth.\n        unchecked {\n            // Read offer array length from memory and place on stack.\n            uint256 totalOfferItems = orderParameters.offer.length;\n\n            // Create a variable to indicate whether the order has any\n            // native offer items\n            uint256 anyNativeItems;\n\n            // Iterate over each offer on the order.\n            // Skip overflow check as for loop is indexed starting at zero.\n            for (uint256 i = 0; i < totalOfferItems; ++i) {\n                // Retrieve the offer item.\n                OfferItem memory offerItem = orderParameters.offer[i];\n\n                // Offer items for the native token can not be received outside\n                // of a match order function except as part of a contract order.\n                {\n                    ItemType itemType = offerItem.itemType;\n                    assembly {\n                        anyNativeItems := or(anyNativeItems, iszero(itemType))\n                    }\n                }\n\n                // Declare an additional nested scope to minimize stack depth.\n                {\n                    // Apply fill fraction to get offer item amount to transfer.\n                    uint256 amount = _applyFraction(\n                        offerItem.startAmount,\n                        offerItem.endAmount,\n                        numerator,\n                        denominator,\n                        startTime,\n                        endTime,\n                        _runTimeConstantFalse()\n                    );\n\n                    // Utilize assembly to set overloaded offerItem arguments.\n                    assembly {\n                        // Write new fractional amount to startAmount as amount.\n                        mstore(\n                            add(offerItem, ReceivedItem_amount_offset),\n                            amount\n                        )\n\n                        // Write recipient to endAmount.\n                        mstore(\n                            add(offerItem, ReceivedItem_recipient_offset),\n                            recipient\n                        )\n                    }\n                }\n            }\n\n            // If a non-contract order has native offer items, throw with an\n            // `InvalidNativeOfferItem` custom error.\n            {\n                OrderType orderType = orderParameters.orderType;\n                uint256 invalidNativeOfferItem;\n                assembly {\n                    invalidNativeOfferItem := and(\n                        // Note that this check requires that there are no\n                        // order types beyond the current set (0-4). It will\n                        // need to be modified when adding more order types.\n                        lt(orderType, 4),\n                        anyNativeItems\n                    )\n                }\n                if (invalidNativeOfferItem != 0) {\n                    _revertInvalidNativeOfferItem();\n                }\n            }\n        }\n\n        /**\n         * Repurpose existing ConsiderationItem memory regions on the\n         * consideration array for the order by overriding the _transfer\n         * function pointer to accept a modified ConsiderationItem argument in\n         * place of the usual ReceivedItem:\n         *\n         *   ====== ConsiderationItem =====   ====== ReceivedItem ======\n         *   ItemType itemType; ------------> ItemType itemType;\n         *   address token; ----------------> address token;\n         *   uint256 identifierOrCriteria;--> uint256 identifier;\n         *   uint256 startAmount; ----------> uint256 amount;\n         *   uint256 endAmount;        /----> address recipient;\n         *   address recipient; ------/\n         */\n\n        // Declare a nested scope to minimize stack depth.\n        unchecked {\n            // Read consideration array length from memory and place on stack.\n            uint256 totalConsiderationItems = orderParameters\n                .consideration\n                .length;\n\n            // Iterate over each consideration item on the order.\n            // Skip overflow check as for loop is indexed starting at zero.\n            for (uint256 i = 0; i < totalConsiderationItems; ++i) {\n                // Retrieve the consideration item.\n                ConsiderationItem memory considerationItem = (\n                    orderParameters.consideration[i]\n                );\n\n                // Apply fraction & derive considerationItem amount to transfer.\n                uint256 amount = _applyFraction(\n                    considerationItem.startAmount,\n                    considerationItem.endAmount,\n                    numerator,\n                    denominator,\n                    startTime,\n                    endTime,\n                    _runTimeConstantTrue()\n                );\n\n                // Use assembly to set overloaded considerationItem arguments.\n                assembly {\n                    // Write derived fractional amount to startAmount as amount.\n                    mstore(\n                        add(considerationItem, ReceivedItem_amount_offset),\n                        amount\n                    )\n\n                    // Write original recipient to endAmount as recipient.\n                    mstore(\n                        add(considerationItem, ReceivedItem_recipient_offset),\n                        mload(\n                            add(\n                                considerationItem,\n                                ConsiderationItem_recipient_offset\n                            )\n                        )\n                    )\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer each item contained in a given single\n     *      order fulfillment.\n     *\n     * @param orderParameters     The parameters for the fulfilled order.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     * @param recipient           The intended recipient for all received items.\n     */\n    function _transferEach(\n        OrderParameters memory orderParameters,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) internal {\n        // Initialize an accumulator array. From this point forward, no new\n        // memory regions can be safely allocated until the accumulator is no\n        // longer being utilized, as the accumulator operates in an open-ended\n        // fashion from this memory pointer; existing memory may still be\n        // accessed and modified, however.\n        bytes memory accumulator = new bytes(AccumulatorDisarmed);\n\n        // As of solidity 0.6.0, inline assembly cannot directly access function\n        // definitions, but can still access locally scoped function variables.\n        // This means that a local variable to reference the internal function\n        // definition (using the same type), along with a local variable with\n        // the desired type, must first be created. Then, the original function\n        // pointer can be recast to the desired type.\n\n        /**\n         * Repurpose existing OfferItem memory regions on the offer array for\n         * the order by overriding the _transfer function pointer to accept a\n         * modified OfferItem argument in place of the usual ReceivedItem:\n         *\n         *   ========= OfferItem ==========   ====== ReceivedItem ======\n         *   ItemType itemType; ------------> ItemType itemType;\n         *   address token; ----------------> address token;\n         *   uint256 identifierOrCriteria; -> uint256 identifier;\n         *   uint256 startAmount; ----------> uint256 amount;\n         *   uint256 endAmount; ------------> address recipient;\n         */\n\n        // Declare a nested scope to minimize stack depth.\n        unchecked {\n            // Read offer array length from memory and place on stack.\n            uint256 totalOfferItems = orderParameters.offer.length;\n\n            // Iterate over each offer on the order.\n            // Skip overflow check as for loop is indexed starting at zero.\n            for (uint256 i = 0; i < totalOfferItems; ++i) {\n                // Retrieve the offer item.\n                OfferItem memory offerItem = orderParameters.offer[i];\n\n                // Utilize assembly to set overloaded offerItem arguments.\n                assembly {\n                    // Write recipient to endAmount.\n                    mstore(\n                        add(offerItem, ReceivedItem_recipient_offset),\n                        recipient\n                    )\n                }\n\n                // Transfer the item from the offerer to the recipient.\n                _toOfferItemInput(_transfer)(\n                    offerItem,\n                    orderParameters.offerer,\n                    orderParameters.conduitKey,\n                    accumulator\n                );\n            }\n        }\n\n        // Declare a variable for the available native token balance.\n        uint256 nativeTokenBalance;\n\n        /**\n         * Repurpose existing ConsiderationItem memory regions on the\n         * consideration array for the order by overriding the _transfer\n         * function pointer to accept a modified ConsiderationItem argument in\n         * place of the usual ReceivedItem:\n         *\n         *   ====== ConsiderationItem =====   ====== ReceivedItem ======\n         *   ItemType itemType; ------------> ItemType itemType;\n         *   address token; ----------------> address token;\n         *   uint256 identifierOrCriteria;--> uint256 identifier;\n         *   uint256 startAmount; ----------> uint256 amount;\n         *   uint256 endAmount;        /----> address recipient;\n         *   address recipient; ------/\n         */\n\n        // Declare a nested scope to minimize stack depth.\n        unchecked {\n            // Read consideration array length from memory and place on stack.\n            uint256 totalConsiderationItems = orderParameters\n                .consideration\n                .length;\n\n            // Iterate over each consideration item on the order.\n            // Skip overflow check as for loop is indexed starting at zero.\n            for (uint256 i = 0; i < totalConsiderationItems; ++i) {\n                // Retrieve the consideration item.\n                ConsiderationItem memory considerationItem = (\n                    orderParameters.consideration[i]\n                );\n\n                if (considerationItem.itemType == ItemType.NATIVE) {\n                    // Get the current available balance of native tokens.\n                    assembly {\n                        nativeTokenBalance := selfbalance()\n                    }\n\n                    // Ensure that sufficient native tokens are still available.\n                    if (considerationItem.startAmount > nativeTokenBalance) {\n                        _revertInsufficientNativeTokensSupplied();\n                    }\n                }\n\n                // Transfer item from caller to recipient specified by the item.\n                _toConsiderationItemInput(_transfer)(\n                    considerationItem,\n                    msg.sender,\n                    fulfillerConduitKey,\n                    accumulator\n                );\n            }\n        }\n\n        // Trigger any remaining accumulated transfers via call to the conduit.\n        _triggerIfArmed(accumulator);\n\n        // Determine whether any native token balance remains.\n        assembly {\n            nativeTokenBalance := selfbalance()\n        }\n\n        // Return any remaining native token balance to the caller.\n        if (nativeTokenBalance != 0) {\n            _transferNativeTokens(payable(msg.sender), nativeTokenBalance);\n        }\n    }\n\n    /**\n     * @dev Internal function to emit an OrderFulfilled event. OfferItems are\n     *      translated into SpentItems and ConsiderationItems are translated\n     *      into ReceivedItems.\n     *\n     * @param orderHash     The order hash.\n     * @param offerer       The offerer for the order.\n     * @param zone          The zone for the order.\n     * @param recipient     The recipient of the order, or the null address if\n     *                      the order was fulfilled via order matching.\n     * @param offer         The offer items for the order.\n     * @param consideration The consideration items for the order.\n     */\n    function _emitOrderFulfilledEvent(\n        bytes32 orderHash,\n        address offerer,\n        address zone,\n        address recipient,\n        OfferItem[] memory offer,\n        ConsiderationItem[] memory consideration\n    ) internal {\n        // Cast already-modified offer memory region as spent items.\n        SpentItem[] memory spentItems;\n        assembly {\n            spentItems := offer\n        }\n\n        // Cast already-modified consideration memory region as received items.\n        ReceivedItem[] memory receivedItems;\n        assembly {\n            receivedItems := consideration\n        }\n\n        // Emit an event signifying that the order has been fulfilled.\n        emit OrderFulfilled(\n            orderHash,\n            offerer,\n            zone,\n            recipient,\n            spentItems,\n            receivedItems\n        );\n    }\n}\n"},"src/lib/OrderValidator.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport { OrderType } from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    ConsiderationItem,\n    OfferItem,\n    Order,\n    OrderComponents,\n    OrderParameters,\n    OrderStatus\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    _revertBadFraction,\n    _revertCannotCancelOrder,\n    _revertConsiderationLengthNotEqualToTotalOriginal,\n    _revertInvalidContractOrder,\n    _revertPartialFillsNotEnabledForOrder\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport { Executor } from \"./Executor.sol\";\n\nimport { ZoneInteraction } from \"./ZoneInteraction.sol\";\n\nimport { MemoryPointer } from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\nimport {\n    AdvancedOrder_denominator_offset,\n    AdvancedOrder_numerator_offset,\n    BasicOrder_basicOrderParameters_cd_offset,\n    BasicOrder_offerer_cdPtr,\n    BasicOrder_signature_cdPtr,\n    Common_amount_offset,\n    Common_endAmount_offset,\n    Common_identifier_offset,\n    Common_token_offset,\n    ConsiderItem_recipient_offset,\n    ContractOrder_orderHash_offerer_shift,\n    MaxUint120,\n    OrderStatus_filledDenominator_offset,\n    OrderStatus_filledNumerator_offset,\n    OrderStatus_ValidatedAndNotCancelled,\n    OrderStatus_ValidatedAndNotCancelledAndFullyFilled,\n    ReceivedItem_recipient_offset\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    Panic_arithmetic,\n    Panic_error_code_ptr,\n    Panic_error_length,\n    Panic_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\nimport {\n    CalldataPointer\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\n/**\n * @title OrderValidator\n * @author 0age\n * @notice OrderValidator contains functionality related to validating orders\n *         and updating their status.\n */\ncontract OrderValidator is Executor, ZoneInteraction {\n    // Track status of each order (validated, cancelled, and fraction filled).\n    mapping(bytes32 => OrderStatus) private _orderStatus;\n\n    // Track nonces for contract offerers.\n    mapping(address => uint256) internal _contractNonces;\n\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) Executor(conduitController) {}\n\n    /**\n     * @dev Internal function to verify the status of a basic order.\n     *      Note that this function may only be safely called as part of basic\n     *      orders, as it assumes a specific calldata encoding structure that\n     *      must first be validated.\n     *\n     * @param orderHash The hash of the order.\n     */\n    function _validateBasicOrder(\n        bytes32 orderHash\n    ) internal view returns (OrderStatus storage orderStatus) {\n        // Retrieve offerer directly using fixed calldata offset based on strict\n        // basic parameter encoding.\n        address offerer;\n        assembly {\n            offerer := calldataload(BasicOrder_offerer_cdPtr)\n        }\n\n        // Retrieve the order status for the given order hash.\n        orderStatus = _orderStatus[orderHash];\n\n        // Ensure order is fillable and is not cancelled.\n        _verifyOrderStatus(\n            orderHash,\n            orderStatus,\n            true, // Only allow unused orders when fulfilling basic orders.\n            _runTimeConstantTrue() // Signifies to revert if order is invalid.\n        );\n\n        unchecked {\n            // If the order is not already validated, verify supplied signature.\n            if (!orderStatus.isValidated) {\n                _verifySignature(\n                    offerer,\n                    orderHash,\n                    _toBytesReturnType(_decodeBytes)(\n                        // Wrap the absolute pointer to the order signature as a\n                        // CalldataPointer.\n                        CalldataPointer.wrap(\n                            // Read the relative pointer to the order signature.\n                            CalldataPointer\n                                .wrap(BasicOrder_signature_cdPtr)\n                                .readMaskedUint256() +\n                                // Add the BasicOrderParameters struct offset to\n                                // the relative pointer.\n                                BasicOrder_basicOrderParameters_cd_offset\n                        )\n                    )\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to update the status of a basic order, assuming\n     *      all validation has already been performed.\n     *\n     * @param orderStatus A storage pointer referencing the order status.\n     */\n    function _updateBasicOrderStatus(OrderStatus storage orderStatus) internal {\n        // Utilize assembly to efficiently update the order status.\n        assembly {\n            // Update order status as validated, not cancelled, & fully filled.\n            sstore(\n                orderStatus.slot,\n                OrderStatus_ValidatedAndNotCancelledAndFullyFilled\n            )\n        }\n    }\n\n    /**\n     * @dev Internal function to validate an order, determine what portion to\n     *      fill, and update its status. The desired fill amount is supplied as\n     *      a fraction, as is the returned amount to fill.\n     *\n     * @param advancedOrder     The order to fulfill as well as the fraction to\n     *                          fill. Note that all offer and consideration\n     *                          amounts must divide with no remainder in order\n     *                          for a partial fill to be valid.\n     * @param revertOnInvalid   A boolean indicating whether to revert if the\n     *                          order is invalid due to the time or status.\n     *\n     * @return orderHash      The order hash.\n     * @return numerator      A value indicating the portion of the order that\n     *                        will be filled.\n     * @return denominator    A value indicating the total size of the order.\n     */\n    function _validateOrder(\n        AdvancedOrder memory advancedOrder,\n        bool revertOnInvalid\n    )\n        internal\n        view\n        returns (bytes32 orderHash, uint256 numerator, uint256 denominator)\n    {\n        // Retrieve the parameters for the order.\n        OrderParameters memory orderParameters = advancedOrder.parameters;\n\n        // Ensure current timestamp falls between order start time and end time.\n        if (\n            !_verifyTime(\n                orderParameters.startTime,\n                orderParameters.endTime,\n                revertOnInvalid\n            )\n        ) {\n            // Assuming an invalid time and no revert, return zeroed out values.\n            return (bytes32(0), 0, 0);\n        }\n\n        // Read numerator and denominator from memory and place on the stack.\n        // Note that overflowed values are masked.\n        assembly {\n            numerator := and(\n                mload(add(advancedOrder, AdvancedOrder_numerator_offset)),\n                MaxUint120\n            )\n\n            denominator := and(\n                mload(add(advancedOrder, AdvancedOrder_denominator_offset)),\n                MaxUint120\n            )\n        }\n\n        // Declare variable for tracking the validity of the supplied fraction.\n        bool invalidFraction;\n\n        // If the order is a contract order, return the generated order.\n        if (orderParameters.orderType == OrderType.CONTRACT) {\n            // Ensure that the numerator and denominator are both equal to 1.\n            assembly {\n                // (1 ^ nd =/= 0) => (nd =/= 1) => (n =/= 1) || (d =/= 1)\n                // It's important that the values are 120-bit masked before\n                // multiplication is applied. Otherwise, the last implication\n                // above is not correct (mod 2^256).\n                invalidFraction := xor(mul(numerator, denominator), 1)\n            }\n\n            // Revert if the supplied numerator and denominator are not valid.\n            if (invalidFraction) {\n                _revertBadFraction();\n            }\n            // Return a placeholder orderHash and a fill fraction of 1/1.\n            // The real orderHash will be returned by _getGeneratedOrder.\n            return (bytes32(uint256(1)), 1, 1);\n        }\n\n        // Ensure numerator does not exceed denominator and is not zero.\n        assembly {\n            invalidFraction := or(gt(numerator, denominator), iszero(numerator))\n        }\n\n        // Revert if the supplied numerator and denominator are not valid.\n        if (invalidFraction) {\n            _revertBadFraction();\n        }\n\n        // If attempting partial fill (n < d) check order type & ensure support.\n        if (\n            _doesNotSupportPartialFills(\n                orderParameters.orderType,\n                numerator,\n                denominator\n            )\n        ) {\n            // Revert if partial fill was attempted on an unsupported order.\n            _revertPartialFillsNotEnabledForOrder();\n        }\n\n        // Retrieve current counter & use it w/ parameters to derive order hash.\n        orderHash = _assertConsiderationLengthAndGetOrderHash(orderParameters);\n\n        // Retrieve the order status using the derived order hash.\n        OrderStatus storage orderStatus = _orderStatus[orderHash];\n\n        // Ensure order is fillable and is not cancelled.\n        if (\n            // Allow partially used orders to be filled.\n            !_verifyOrderStatus(orderHash, orderStatus, false, revertOnInvalid)\n        ) {\n            // Assuming an invalid order status and no revert, return zero fill.\n            return (orderHash, 0, 0);\n        }\n\n        // If the order is not already validated, verify the supplied signature.\n        if (!orderStatus.isValidated) {\n            _verifySignature(\n                orderParameters.offerer,\n                orderHash,\n                advancedOrder.signature\n            );\n        }\n\n        // Utilize assembly to determine the fraction to fill and update status.\n        assembly {\n            let orderStatusSlot := orderStatus.slot\n            // Read filled amount as numerator and denominator and put on stack.\n            let filledNumerator := sload(orderStatusSlot)\n            let filledDenominator := shr(\n                OrderStatus_filledDenominator_offset,\n                filledNumerator\n            )\n\n            // \"Loop\" until the appropriate fill fraction has been determined.\n            for {\n\n            } 1 {\n\n            } {\n                // If no portion of the order has been filled yet...\n                if iszero(filledDenominator) {\n                    // fill the full supplied fraction.\n                    filledNumerator := numerator\n\n                    // Exit the \"loop\" early.\n                    break\n                }\n\n                // Shift and mask to calculate the current filled numerator.\n                filledNumerator := and(\n                    shr(OrderStatus_filledNumerator_offset, filledNumerator),\n                    MaxUint120\n                )\n\n                // If denominator of 1 supplied, fill entire remaining amount.\n                if eq(denominator, 1) {\n                    // Set the amount to fill to the remaining amount.\n                    numerator := sub(filledDenominator, filledNumerator)\n\n                    // Set the fill size to the current size.\n                    denominator := filledDenominator\n\n                    // Exit the \"loop\" early.\n                    break\n                }\n\n                // If supplied denominator is equal to the current one:\n                if eq(denominator, filledDenominator) {\n                    // Increment the filled numerator by the new numerator.\n                    filledNumerator := add(numerator, filledNumerator)\n\n                    // Once adjusted, if current + supplied numerator exceeds\n                    // the denominator:\n                    let carry := mul(\n                        sub(filledNumerator, denominator),\n                        gt(filledNumerator, denominator)\n                    )\n\n                    // reduce the amount to fill by the excess.\n                    numerator := sub(numerator, carry)\n\n                    // Exit the \"loop\" early.\n                    break\n                }\n\n                // Otherwise, if supplied denominator differs from current one:\n                // Scale the filled amount up by the supplied size.\n                filledNumerator := mul(filledNumerator, denominator)\n\n                // Scale the supplied amount and size up by the current size.\n                numerator := mul(numerator, filledDenominator)\n                denominator := mul(denominator, filledDenominator)\n\n                // Increment the filled numerator by the new numerator.\n                filledNumerator := add(numerator, filledNumerator)\n\n                // Once adjusted, if current + supplied numerator exceeds\n                // denominator:\n                let carry := mul(\n                    sub(filledNumerator, denominator),\n                    gt(filledNumerator, denominator)\n                )\n\n                // reduce the amount to fill by the excess.\n                numerator := sub(numerator, carry)\n\n                // Reduce the filled amount by the excess as well.\n                filledNumerator := sub(filledNumerator, carry)\n\n                // Check denominator for uint120 overflow.\n                if gt(denominator, MaxUint120) {\n                    // Derive greatest common divisor using euclidean algorithm.\n                    function gcd(_a, _b) -> out {\n                        // \"Loop\" until only one non-zero value remains.\n                        for {\n\n                        } _b {\n\n                        } {\n                            // Assign the second value to a temporary variable.\n                            let _c := _b\n\n                            // Derive the modulus of the two values.\n                            _b := mod(_a, _c)\n\n                            // Set the first value to the temporary value.\n                            _a := _c\n                        }\n\n                        // Return the remaining non-zero value.\n                        out := _a\n                    }\n\n                    // Determine the amount to scale down the fill fractions.\n                    let scaleDown := gcd(\n                        numerator,\n                        gcd(filledNumerator, denominator)\n                    )\n\n                    // Ensure that the divisor is at least one.\n                    let safeScaleDown := add(scaleDown, iszero(scaleDown))\n\n                    // Scale fractional values down by gcd.\n                    numerator := div(numerator, safeScaleDown)\n                    denominator := div(denominator, safeScaleDown)\n\n                    // Perform the overflow check a second time.\n                    if gt(denominator, MaxUint120) {\n                        // Store the Panic error signature.\n                        mstore(0, Panic_error_selector)\n                        // Store the arithmetic (0x11) panic code.\n                        mstore(Panic_error_code_ptr, Panic_arithmetic)\n\n                        // revert(abi.encodeWithSignature(\n                        //     \"Panic(uint256)\", 0x11\n                        // ))\n                        revert(Error_selector_offset, Panic_error_length)\n                    }\n                }\n\n                // Exit the \"loop\" now that all evaluation is complete.\n                break\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to update the status of an order by applying the\n     *      supplied fill fraction to the remaining order fraction. If\n     *      revertOnInvalid is true, the function will revert if the order is\n     *      unavailable or if it is not possible to apply the supplied fill\n     *      fraction to the remaining amount (e.g., if there is not enough\n     *      of the order remaining to fill the supplied fraction, or if the\n     *      fractions cannot be represented by two uint120 values).\n     *\n     * @param orderHash       The hash of the order.\n     * @param numerator       The numerator of the fraction filled to write to\n     *                        the order status.\n     * @param denominator     The denominator of the fraction filled to write to\n     *                        the order status.\n     * @param revertOnInvalid Whether to revert if an order is already filled.\n     */\n    function _updateStatus(\n        bytes32 orderHash,\n        uint256 numerator,\n        uint256 denominator,\n        bool revertOnInvalid\n    ) internal returns (bool) {\n        // Retrieve the order status using the derived order hash.\n        OrderStatus storage orderStatus = _orderStatus[orderHash];\n\n        bool hasCarry = false;\n\n        uint256 orderStatusSlot;\n        uint256 filledNumerator;\n\n        // Utilize assembly to determine the fraction to fill and update status.\n        assembly {\n            orderStatusSlot := orderStatus.slot\n            // Read filled amount as numerator and denominator and put on stack.\n            filledNumerator := sload(orderStatusSlot)\n            let filledDenominator := shr(\n                OrderStatus_filledDenominator_offset,\n                filledNumerator\n            )\n\n            // \"Loop\" until the appropriate fill fraction has been determined.\n            for {\n\n            } 1 {\n\n            } {\n                // If no portion of the order has been filled yet...\n                if iszero(filledDenominator) {\n                    // fill the full supplied fraction.\n                    filledNumerator := numerator\n\n                    // Exit the \"loop\" early.\n                    break\n                }\n\n                // Shift and mask to calculate the current filled numerator.\n                filledNumerator := and(\n                    shr(OrderStatus_filledNumerator_offset, filledNumerator),\n                    MaxUint120\n                )\n\n                // If supplied denominator is equal to the current one:\n                if eq(denominator, filledDenominator) {\n                    // Increment the filled numerator by the new numerator.\n                    filledNumerator := add(numerator, filledNumerator)\n\n                    hasCarry := gt(filledNumerator, denominator)\n\n                    // Exit the \"loop\" early.\n                    break\n                }\n\n                // Otherwise, if supplied denominator differs from current one:\n                // Scale the filled amount up by the supplied size.\n                filledNumerator := mul(filledNumerator, denominator)\n\n                // Scale the supplied amount and size up by the current size.\n                numerator := mul(numerator, filledDenominator)\n                denominator := mul(denominator, filledDenominator)\n\n                // Increment the filled numerator by the new numerator.\n                filledNumerator := add(numerator, filledNumerator)\n\n                hasCarry := gt(filledNumerator, denominator)\n\n                // Check filledNumerator and denominator for uint120 overflow.\n                if or(\n                    gt(filledNumerator, MaxUint120),\n                    gt(denominator, MaxUint120)\n                ) {\n                    // Derive greatest common divisor using euclidean algorithm.\n                    function gcd(_a, _b) -> out {\n                        // \"Loop\" until only one non-zero value remains.\n                        for {\n\n                        } _b {\n\n                        } {\n                            // Assign the second value to a temporary variable.\n                            let _c := _b\n\n                            // Derive the modulus of the two values.\n                            _b := mod(_a, _c)\n\n                            // Set the first value to the temporary value.\n                            _a := _c\n                        }\n\n                        // Return the remaining non-zero value.\n                        out := _a\n                    }\n\n                    // Determine amount to scale down the new filled fraction.\n                    let scaleDown := gcd(filledNumerator, denominator)\n\n                    // Ensure that the divisor is at least one.\n                    let safeScaleDown := add(scaleDown, iszero(scaleDown))\n\n                    // Scale new filled fractional values down by gcd.\n                    filledNumerator := div(filledNumerator, safeScaleDown)\n                    denominator := div(denominator, safeScaleDown)\n\n                    // Perform the overflow check a second time.\n                    if or(\n                        gt(filledNumerator, MaxUint120),\n                        gt(denominator, MaxUint120)\n                    ) {\n                        // Store the Panic error signature.\n                        mstore(0, Panic_error_selector)\n                        // Store the arithmetic (0x11) panic code.\n                        mstore(Panic_error_code_ptr, Panic_arithmetic)\n\n                        // revert(abi.encodeWithSignature(\n                        //     \"Panic(uint256)\", 0x11\n                        // ))\n                        revert(Error_selector_offset, Panic_error_length)\n                    }\n                }\n\n                // Exit the \"loop\" now that all evaluation is complete.\n                break\n            }\n        }\n\n        if (hasCarry) {\n            if (revertOnInvalid) {\n                revert OrderAlreadyFilled(orderHash);\n            } else {\n                return false;\n            }\n        }\n\n        assembly {\n            // Update order status and fill amount, packing struct values.\n            // [denominator: 15 bytes] [numerator: 15 bytes]\n            // [isCancelled: 1 byte] [isValidated: 1 byte]\n            sstore(\n                orderStatusSlot,\n                or(\n                    OrderStatus_ValidatedAndNotCancelled,\n                    or(\n                        shl(\n                            OrderStatus_filledNumerator_offset,\n                            filledNumerator\n                        ),\n                        shl(OrderStatus_filledDenominator_offset, denominator)\n                    )\n                )\n            )\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Internal function to generate a contract order. When a\n     *      collection-wide criteria-based item (criteria = 0) is provided as an\n     *      input to a contract order, the contract offerer has full latitude to\n     *      choose any identifier it wants mid-flight, which differs from the\n     *      usual behavior.  For regular criteria-based orders with\n     *      identifierOrCriteria = 0, the fulfiller can pick which identifier to\n     *      receive by providing a CriteriaResolver. For contract offers with\n     *      identifierOrCriteria = 0, Seaport does not expect a corresponding\n     *      CriteriaResolver, and will revert if one is provided.\n     *\n     * @param orderParameters The parameters for the order.\n     * @param context         The context for generating the order.\n     * @param revertOnInvalid Whether to revert on invalid input.\n     *\n     * @return orderHash   The order hash.\n     */\n    function _getGeneratedOrder(\n        OrderParameters memory orderParameters,\n        bytes memory context,\n        bool revertOnInvalid\n    ) internal returns (bytes32 orderHash) {\n        // Ensure that consideration array length is equal to the total original\n        // consideration items value.\n        if (\n            orderParameters.consideration.length !=\n            orderParameters.totalOriginalConsiderationItems\n        ) {\n            _revertConsiderationLengthNotEqualToTotalOriginal();\n        }\n\n        {\n            address offerer = orderParameters.offerer;\n            bool success;\n            (MemoryPointer cdPtr, uint256 size) = _encodeGenerateOrder(\n                orderParameters,\n                context\n            );\n            assembly {\n                success := call(gas(), offerer, 0, cdPtr, size, 0, 0)\n            }\n\n            {\n                // Note: overflow impossible; nonce can't increment that high.\n                uint256 contractNonce;\n                unchecked {\n                    // Note: nonce will be incremented even for skipped orders,\n                    // and even if generateOrder's return data does not satisfy\n                    // all the constraints. This is the case when errorBuffer\n                    // != 0 and revertOnInvalid == false.\n                    contractNonce = _contractNonces[offerer]++;\n                }\n\n                assembly {\n                    // Shift offerer address up 96 bytes and combine with nonce.\n                    orderHash := xor(\n                        contractNonce,\n                        shl(ContractOrder_orderHash_offerer_shift, offerer)\n                    )\n                }\n            }\n\n            // Revert or skip if the call to generate the contract order failed.\n            if (!success) {\n                if (revertOnInvalid) {\n                    _revertWithReasonIfOneIsReturned();\n\n                    _revertInvalidContractOrder(orderHash);\n                }\n\n                return bytes32(0);\n            }\n        }\n\n        // From this point onward, do not allow for skipping orders as the\n        // contract offerer may have modified state in expectation of any named\n        // consideration items being sent to their designated recipients.\n\n        // Decode the returned contract order and/or update the error buffer.\n        (\n            uint256 errorBuffer,\n            OfferItem[] memory offer,\n            ConsiderationItem[] memory consideration\n        ) = _convertGetGeneratedOrderResult(_decodeGenerateOrderReturndata)(\n                orderParameters.offer,\n                orderParameters.consideration\n            );\n\n        // Revert if the returndata could not be decoded correctly.\n        if (errorBuffer != 0) {\n            _revertInvalidContractOrder(orderHash);\n        }\n\n        // Assign the returned offer item in place of the original item.\n        orderParameters.offer = offer;\n\n        // Assign returned consideration item in place of the original item.\n        orderParameters.consideration = consideration;\n\n        // Return the order hash.\n        return orderHash;\n    }\n\n    /**\n     * @dev Internal function to cancel an arbitrary number of orders. Note that\n     *      only the offerer or the zone of a given order may cancel it. Callers\n     *      should ensure that the intended order was cancelled by calling\n     *      `getOrderStatus` and confirming that `isCancelled` returns `true`.\n     *      Also note that contract orders are not cancellable.\n     *\n     * @param orders The orders to cancel.\n     *\n     * @return cancelled A boolean indicating whether the supplied orders were\n     *                   successfully cancelled.\n     */\n    function _cancel(\n        OrderComponents[] calldata orders\n    ) internal returns (bool cancelled) {\n        // Ensure that the reentrancy guard is not currently set.\n        _assertNonReentrant();\n\n        // Declare variables outside of the loop.\n        OrderStatus storage orderStatus;\n\n        // Declare a variable for tracking invariants in the loop.\n        bool anyInvalidCallerOrContractOrder;\n\n        // Skip overflow check as for loop is indexed starting at zero.\n        unchecked {\n            // Read length of the orders array from memory and place on stack.\n            uint256 totalOrders = orders.length;\n\n            // Iterate over each order.\n            for (uint256 i = 0; i < totalOrders; ) {\n                // Retrieve the order.\n                OrderComponents calldata order = orders[i];\n\n                address offerer = order.offerer;\n                address zone = order.zone;\n                OrderType orderType = order.orderType;\n\n                assembly {\n                    // If caller is neither the offerer nor zone, or a contract\n                    // order is present, flag anyInvalidCallerOrContractOrder.\n                    anyInvalidCallerOrContractOrder := or(\n                        anyInvalidCallerOrContractOrder,\n                        // orderType == CONTRACT ||\n                        // !(caller == offerer || caller == zone)\n                        or(\n                            eq(orderType, 4),\n                            iszero(\n                                or(eq(caller(), offerer), eq(caller(), zone))\n                            )\n                        )\n                    )\n                }\n\n                bytes32 orderHash = _deriveOrderHash(\n                    _toOrderParametersReturnType(\n                        _decodeOrderComponentsAsOrderParameters\n                    )(order.toCalldataPointer()),\n                    order.counter\n                );\n\n                // Retrieve the order status using the derived order hash.\n                orderStatus = _orderStatus[orderHash];\n\n                // Update the order status as not valid and cancelled.\n                orderStatus.isValidated = false;\n                orderStatus.isCancelled = true;\n\n                // Emit an event signifying that the order has been cancelled.\n                emit OrderCancelled(orderHash, offerer, zone);\n\n                // Increment counter inside body of loop for gas efficiency.\n                ++i;\n            }\n        }\n\n        if (anyInvalidCallerOrContractOrder) {\n            _revertCannotCancelOrder();\n        }\n\n        // Return a boolean indicating that orders were successfully cancelled.\n        cancelled = true;\n    }\n\n    /**\n     * @dev Internal function to validate an arbitrary number of orders, thereby\n     *      registering their signatures as valid and allowing the fulfiller to\n     *      skip signature verification on fulfillment. Note that validated\n     *      orders may still be unfulfillable due to invalid item amounts or\n     *      other factors; callers should determine whether validated orders are\n     *      fulfillable by simulating the fulfillment call prior to execution.\n     *      Also note that anyone can validate a signed order, but only the\n     *      offerer can validate an order without supplying a signature.\n     *\n     * @param orders The orders to validate.\n     *\n     * @return validated A boolean indicating whether the supplied orders were\n     *                   successfully validated.\n     */\n    function _validate(\n        Order[] memory orders\n    ) internal returns (bool validated) {\n        // Ensure that the reentrancy guard is not currently set.\n        _assertNonReentrant();\n\n        // Declare variables outside of the loop.\n        OrderStatus storage orderStatus;\n        bytes32 orderHash;\n        address offerer;\n\n        // Skip overflow check as for loop is indexed starting at zero.\n        unchecked {\n            // Read length of the orders array from memory and place on stack.\n            uint256 totalOrders = orders.length;\n\n            // Iterate over each order.\n            for (uint256 i = 0; i < totalOrders; ++i) {\n                // Retrieve the order.\n                Order memory order = orders[i];\n\n                // Retrieve the order parameters.\n                OrderParameters memory orderParameters = order.parameters;\n\n                // Skip contract orders.\n                if (orderParameters.orderType == OrderType.CONTRACT) {\n                    continue;\n                }\n\n                // Move offerer from memory to the stack.\n                offerer = orderParameters.offerer;\n\n                // Get current counter & use it w/ params to derive order hash.\n                orderHash = _assertConsiderationLengthAndGetOrderHash(\n                    orderParameters\n                );\n\n                // Retrieve the order status using the derived order hash.\n                orderStatus = _orderStatus[orderHash];\n\n                // Ensure order is fillable and retrieve the filled amount.\n                _verifyOrderStatus(\n                    orderHash,\n                    orderStatus,\n                    false, // Signifies that partially filled orders are valid.\n                    _runTimeConstantTrue() // Revert if order is invalid.\n                );\n\n                // If the order has not already been validated...\n                if (!orderStatus.isValidated) {\n                    // Ensure that consideration array length is equal to the\n                    // total original consideration items value.\n                    if (\n                        orderParameters.consideration.length !=\n                        orderParameters.totalOriginalConsiderationItems\n                    ) {\n                        _revertConsiderationLengthNotEqualToTotalOriginal();\n                    }\n\n                    // Verify the supplied signature.\n                    _verifySignature(offerer, orderHash, order.signature);\n\n                    // Update order status to mark the order as valid.\n                    orderStatus.isValidated = true;\n\n                    // Emit an event signifying the order has been validated.\n                    emit OrderValidated(orderHash, orderParameters);\n                }\n            }\n        }\n\n        // Return a boolean indicating that orders were successfully validated.\n        validated = true;\n    }\n\n    /**\n     * @dev Internal view function to retrieve the status of a given order by\n     *      hash, including whether the order has been cancelled or validated\n     *      and the fraction of the order that has been filled.\n     *\n     * @param orderHash The order hash in question.\n     *\n     * @return isValidated A boolean indicating whether the order in question\n     *                     has been validated (i.e. previously approved or\n     *                     partially filled).\n     * @return isCancelled A boolean indicating whether the order in question\n     *                     has been cancelled.\n     * @return totalFilled The total portion of the order that has been filled\n     *                     (i.e. the \"numerator\").\n     * @return totalSize   The total size of the order that is either filled or\n     *                     unfilled (i.e. the \"denominator\").\n     */\n    function _getOrderStatus(\n        bytes32 orderHash\n    )\n        internal\n        view\n        returns (\n            bool isValidated,\n            bool isCancelled,\n            uint256 totalFilled,\n            uint256 totalSize\n        )\n    {\n        // Retrieve the order status using the order hash.\n        OrderStatus storage orderStatus = _orderStatus[orderHash];\n\n        // Return the fields on the order status.\n        return (\n            orderStatus.isValidated,\n            orderStatus.isCancelled,\n            orderStatus.numerator,\n            orderStatus.denominator\n        );\n    }\n\n    /**\n     * @dev Internal pure function to check whether a given order type indicates\n     *      that partial fills are not supported (e.g. only \"full fills\" are\n     *      allowed for the order in question).\n     *\n     * @param orderType   The order type in question.\n     * @param numerator   The numerator in question.\n     * @param denominator The denominator in question.\n     *\n     * @return isFullOrder A boolean indicating whether the order type only\n     *                     supports full fills.\n     */\n    function _doesNotSupportPartialFills(\n        OrderType orderType,\n        uint256 numerator,\n        uint256 denominator\n    ) internal pure returns (bool isFullOrder) {\n        // The \"full\" order types are even, while \"partial\" order types are odd.\n        // Bitwise and by 1 is equivalent to modulo by 2, but 2 gas cheaper. The\n        // check is only necessary if numerator is less than denominator.\n        assembly {\n            // Equivalent to `uint256(orderType) & 1 == 0`.\n            isFullOrder := and(\n                lt(numerator, denominator),\n                iszero(and(orderType, 1))\n            )\n        }\n    }\n}\n"},"src/lib/LowLevelHelpers.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    CostPerWord,\n    ExtraGasBuffer,\n    FreeMemoryPointerSlot,\n    MemoryExpansionCoefficientShift,\n    OneWord,\n    OneWordShift,\n    ThirtyOneBytes\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    MemoryPointer,\n    MemoryPointerLib\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\nimport {\n    AdvancedOrder,\n    Execution\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\n/**\n * @title LowLevelHelpers\n * @author 0age\n * @notice LowLevelHelpers contains logic for performing various low-level\n *         operations.\n */\ncontract LowLevelHelpers {\n    /**\n     * @dev Internal view function to revert and pass along the revert reason if\n     *      data was returned by the last call and that the size of that data\n     *      does not exceed the currently allocated memory size.\n     */\n    function _revertWithReasonIfOneIsReturned() internal view {\n        assembly {\n            // If it returned a message, bubble it up as long as sufficient gas\n            // remains to do so:\n            if returndatasize() {\n                // Ensure that sufficient gas is available to copy returndata\n                // while expanding memory where necessary. Start by computing\n                // the word size of returndata and allocated memory.\n                let returnDataWords := shr(\n                    OneWordShift,\n                    add(returndatasize(), ThirtyOneBytes)\n                )\n\n                // Note: use the free memory pointer in place of msize() to work\n                // around a Yul warning that prevents accessing msize directly\n                // when the IR pipeline is activated.\n                let msizeWords := shr(\n                    OneWordShift,\n                    mload(FreeMemoryPointerSlot)\n                )\n\n                // Next, compute the cost of the returndatacopy.\n                let cost := mul(CostPerWord, returnDataWords)\n\n                // Then, compute cost of new memory allocation.\n                if gt(returnDataWords, msizeWords) {\n                    cost := add(\n                        cost,\n                        add(\n                            mul(sub(returnDataWords, msizeWords), CostPerWord),\n                            shr(\n                                MemoryExpansionCoefficientShift,\n                                sub(\n                                    mul(returnDataWords, returnDataWords),\n                                    mul(msizeWords, msizeWords)\n                                )\n                            )\n                        )\n                    )\n                }\n\n                // Finally, add a small constant and compare to gas remaining;\n                // bubble up the revert data if enough gas is still available.\n                if lt(add(cost, ExtraGasBuffer), gas()) {\n                    // Copy returndata to memory; overwrite existing memory.\n                    returndatacopy(0, 0, returndatasize())\n\n                    // Revert, specifying memory region with copied returndata.\n                    revert(0, returndatasize())\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Internal view function to branchlessly select either the caller (if\n     *      a supplied recipient is equal to zero) or the supplied recipient (if\n     *      that recipient is a nonzero value).\n     *\n     * @param recipient The supplied recipient.\n     *\n     * @return updatedRecipient The updated recipient.\n     */\n    function _substituteCallerForEmptyRecipient(\n        address recipient\n    ) internal view returns (address updatedRecipient) {\n        // Utilize assembly to perform a branchless operation on the recipient.\n        assembly {\n            // Add caller to recipient if recipient equals 0; otherwise add 0.\n            updatedRecipient := add(recipient, mul(iszero(recipient), caller()))\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    /**\n     * @dev Internal pure function to cast the `pptrOffset` function from\n     *      `MemoryPointerLib` to a function that takes a memory array of\n     *      `AdvancedOrder` and an offset in memory and returns the\n     *      `AdvancedOrder` whose pointer is stored at that offset from the\n     *      array length.\n     */\n    function _getReadAdvancedOrderByOffset()\n        internal\n        pure\n        returns (\n            function(AdvancedOrder[] memory, uint256)\n                internal\n                pure\n                returns (AdvancedOrder memory) fn2\n        )\n    {\n        function(MemoryPointer, uint256)\n            internal\n            pure\n            returns (MemoryPointer) fn1 = MemoryPointerLib.pptrOffset;\n\n        assembly {\n            fn2 := fn1\n        }\n    }\n\n    /**\n     * @dev Internal pure function to cast the `pptrOffset` function from\n     *      `MemoryPointerLib` to a function that takes a memory array of\n     *      `Execution` and an offset in memory and returns the\n     *      `Execution` whose pointer is stored at that offset from the\n     *      array length.\n     */\n    function _getReadExecutionByOffset()\n        internal\n        pure\n        returns (\n            function(Execution[] memory, uint256)\n                internal\n                pure\n                returns (Execution memory) fn2\n        )\n    {\n        function(MemoryPointer, uint256)\n            internal\n            pure\n            returns (MemoryPointer) fn1 = MemoryPointerLib.pptrOffset;\n\n        assembly {\n            fn2 := fn1\n        }\n    }\n\n    /**\n     * @dev Internal pure function to return a `true` value that solc\n     *      will not recognize as a compile time constant.\n     *\n     *      This function is used to bypass function specialization for\n     *      functions which take a constant boolean as an input parameter.\n     *\n     *      This should only be used in cases where specialization has a\n     *      negligible impact on the gas cost of the function.\n     *\n     *      Note: assumes the calldatasize is non-zero.\n     */\n    function _runTimeConstantTrue() internal pure returns (bool) {\n        return msg.data.length > 0;\n    }\n\n    /**\n     * @dev Internal pure function to return a `false` value that solc\n     *      will not recognize as a compile time constant.\n     *\n     *      This function is used to bypass function specialization for\n     *      functions which take a constant boolean as an input parameter.\n     *\n     *      This should only be used in cases where specialization has a\n     *      negligible impact on the gas cost of the function.\n     *\n     *      Note: assumes the calldatasize is non-zero.\n     */\n    function _runTimeConstantFalse() internal pure returns (bool) {\n        return msg.data.length == 0;\n    }\n}\n"},"src/lib/ReentrancyGuard.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ReentrancyErrors\n} from \"seaport-types/src/interfaces/ReentrancyErrors.sol\";\n\nimport { LowLevelHelpers } from \"./LowLevelHelpers.sol\";\n\nimport {\n    _revertInvalidMsgValue,\n    _revertNoReentrantCalls\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_SSTORE,\n    _ENTERED_SSTORE,\n    _NOT_ENTERED_SSTORE,\n    _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_TSTORE,\n    _ENTERED_TSTORE,\n    _NOT_ENTERED_TSTORE,\n    _TSTORE_ENABLED_SSTORE,\n    _REENTRANCY_GUARD_SLOT,\n    _TLOAD_TEST_PAYLOAD,\n    _TLOAD_TEST_PAYLOAD_OFFSET,\n    _TLOAD_TEST_PAYLOAD_LENGTH\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    InvalidMsgValue_error_selector,\n    InvalidMsgValue_error_length,\n    InvalidMsgValue_error_value_ptr,\n    NoReentrantCalls_error_selector,\n    NoReentrantCalls_error_length,\n    Error_selector_offset\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title ReentrancyGuard\n * @author 0age\n * @notice ReentrancyGuard contains a storage variable (or a transient storage\n *         variable in EVM environments that support it once activated) and\n *         related functionality for protecting against reentrancy.\n */\ncontract ReentrancyGuard is ReentrancyErrors, LowLevelHelpers {\n    // Declare an immutable variable to store the initial TSTORE support status.\n    bool private immutable _tstoreInitialSupport;\n\n    // Declare an immutable variable to store the tstore test contract address.\n    address private immutable _tloadTestContract;\n\n    /**\n     * @dev Initialize the reentrancy guard during deployment. This involves\n     *      attempting to deploy a contract that utilizes TLOAD as part of the\n     *      contract construction bytecode, and configuring initial support for\n     *      using TSTORE in place of SSTORE for the reentrancy lock based on the\n     *      result.\n     */\n    constructor() {\n        // Deploy the contract testing TLOAD support and store the address.\n        address tloadTestContract = _prepareTloadTest();\n\n        // Ensure the deployment was successful.\n        if (tloadTestContract == address(0)) {\n            revert TloadTestContractDeploymentFailed();\n        }\n\n        // Determine if TSTORE is supported.\n        bool tstoreInitialSupport = _testTload(tloadTestContract);\n\n        // Store the result as an immutable.\n        _tstoreInitialSupport = tstoreInitialSupport;\n\n        // Set the address of the deployed TLOAD test contract as an immutable.\n        _tloadTestContract = tloadTestContract;\n\n        // If not using TSTORE (where _NOT_ENTERED_TSTORE = 0), set initial\n        // sentinel value (where _NOT_ENTERED_SSTORE = 1).\n        if (!tstoreInitialSupport) {\n            // Initialize storage for the reentrancy guard in a cleared state.\n            assembly {\n                sstore(_REENTRANCY_GUARD_SLOT, _NOT_ENTERED_SSTORE)\n            }\n        }\n    }\n\n    /**\n     * @dev External function to activate TSTORE usage for the reentrancy guard.\n     *      Does not need to be called if TSTORE is supported from deployment,\n     *      and only needs to be called once. Reverts if TSTORE has already been\n     *      activated, if the opcode is not available, or if the reentrancy\n     *      guard is currently set.\n     */\n    function __activateTstore() external {\n        // Determine if TSTORE can potentially be activated. If it has already\n        // been activated, or if the reentrancy guard is currently set, then\n        // it cannot be activated.\n        bool tstoreActivatable;\n        assembly {\n            tstoreActivatable := eq(\n                sload(_REENTRANCY_GUARD_SLOT),\n                _NOT_ENTERED_SSTORE\n            )\n        }\n\n        // Revert if TSTORE is already activated or not activatable.\n        if (_tstoreInitialSupport || !tstoreActivatable) {\n            revert TStoreAlreadyActivated();\n        }\n\n        // Determine if TSTORE can be activated and revert if not.\n        if (!_testTload(_tloadTestContract)) {\n            revert TStoreNotSupported();\n        }\n\n        // Mark TSTORE as activated.\n        assembly {\n            sstore(_REENTRANCY_GUARD_SLOT, _TSTORE_ENABLED_SSTORE)\n        }\n    }\n\n    /**\n     * @dev Internal function to ensure that a sentinel value for the reentrancy\n     *      guard is not currently set and, if not, to set a sentinel value for\n     *      the reentrancy guard based on whether or not native tokens may be\n     *      received during execution or not.\n     *\n     * @param acceptNativeTokens A boolean indicating whether native tokens may\n     *                           be received during execution or not.\n     */\n    function _setReentrancyGuard(bool acceptNativeTokens) internal {\n        // Place immutable variable on the stack access within inline assembly.\n        bool tstoreInitialSupport = _tstoreInitialSupport;\n\n        // Utilize assembly to set the reentrancy guard based on tstore support.\n        assembly {\n            // \"Loop\" over three possible cases for setting the reentrancy guard\n            // based on tstore support and state, exiting once the respective\n            // state has been identified and a corresponding guard has been set.\n            for {} 1 {} {\n                // 1: handle case where tstore is supported from the start.\n                if tstoreInitialSupport {\n                    // Ensure that the reentrancy guard is not already set.\n                    if tload(_REENTRANCY_GUARD_SLOT) {\n                        // Store left-padded selector with push4,\n                        // mem[28:32] = selector\n                        mstore(0, NoReentrantCalls_error_selector)\n\n                        // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                        revert(\n                            Error_selector_offset,\n                            NoReentrantCalls_error_length\n                        )\n                    }\n\n                    // Set the reentrancy guard. A value of 1 indicates that\n                    // native tokens may not be accepted during execution,\n                    // whereas a value of 2 indicates that they will be accepted\n                    // (returning any remaining native tokens to the caller).\n                    tstore(\n                        _REENTRANCY_GUARD_SLOT,\n                        add(_ENTERED_TSTORE, acceptNativeTokens)\n                    )\n\n                    // Exit the loop.\n                    break\n                }\n\n                // Retrieve the reentrancy guard sentinel value.\n                let reentrancyGuard := sload(_REENTRANCY_GUARD_SLOT)\n\n                // 2: handle tstore support that was activated post-deployment.\n                if iszero(reentrancyGuard) {\n                    // Ensure that the reentrancy guard is not already set.\n                    if tload(_REENTRANCY_GUARD_SLOT) {\n                        // Store left-padded selector with push4,\n                        // mem[28:32] = selector\n                        mstore(0, NoReentrantCalls_error_selector)\n\n                        // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                        revert(\n                            Error_selector_offset,\n                            NoReentrantCalls_error_length\n                        )\n                    }\n\n                    // Set the reentrancy guard. A value of 1 indicates that\n                    // native tokens may not be accepted during execution,\n                    // whereas a value of 2 indicates that they will be accepted\n                    // (returning any remaining native tokens to the caller).\n                    tstore(\n                        _REENTRANCY_GUARD_SLOT,\n                        add(_ENTERED_TSTORE, acceptNativeTokens)\n                    )\n\n                    // Exit the loop.\n                    break\n                }\n\n                // 3: handle case where tstore support has not been activated.\n                // Ensure that the reentrancy guard is not already set.\n                if iszero(eq(reentrancyGuard, _NOT_ENTERED_SSTORE)) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, NoReentrantCalls_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                    revert(Error_selector_offset, NoReentrantCalls_error_length)\n                }\n\n                // Set the reentrancy guard. A value of 2 indicates that native\n                // tokens may not be accepted during execution, whereas a value\n                // of 3 indicates that they will be accepted (with any remaining\n                // native tokens returned to the caller).\n                sstore(\n                    _REENTRANCY_GUARD_SLOT,\n                    add(_ENTERED_SSTORE, acceptNativeTokens)\n                )\n\n                // Exit the loop.\n                break\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to unset the reentrancy guard sentinel value.\n     */\n    function _clearReentrancyGuard() internal {\n        // Place immutable variable on the stack access within inline assembly.\n        bool tstoreInitialSupport = _tstoreInitialSupport;\n\n        // Utilize assembly to clear reentrancy guard based on tstore support.\n        assembly {\n            // \"Loop\" over three possible cases for clearing reentrancy guard\n            // based on tstore support and state, exiting once the respective\n            // state has been identified and corresponding guard cleared.\n            for {} 1 {} {\n                // 1: handle case where tstore is supported from the start.\n                if tstoreInitialSupport {\n                    // Clear the reentrancy guard.\n                    tstore(_REENTRANCY_GUARD_SLOT, _NOT_ENTERED_TSTORE)\n\n                    // Exit the loop.\n                    break\n                }\n\n                // Retrieve the reentrancy guard sentinel value.\n                let reentrancyGuard := sload(_REENTRANCY_GUARD_SLOT)\n\n                // 2: handle tstore support that was activated post-deployment.\n                if iszero(reentrancyGuard) {\n                    // Clear the reentrancy guard.\n                    tstore(_REENTRANCY_GUARD_SLOT, _NOT_ENTERED_TSTORE)\n\n                    // Exit the loop.\n                    break\n                }\n\n                // 3: handle case where tstore support has not been activated.\n                // Clear the reentrancy guard.\n                sstore(_REENTRANCY_GUARD_SLOT, _NOT_ENTERED_SSTORE)\n\n                // Exit the loop.\n                break\n            }\n        }\n    }\n\n    /**\n     * @dev Internal view function to ensure that a sentinel value for the\n     *      reentrancy guard is not currently set.\n     */\n    function _assertNonReentrant() internal view {\n        // Place immutable variable on the stack access within inline assembly.\n        bool tstoreInitialSupport = _tstoreInitialSupport;\n\n        // Utilize assembly to check reentrancy guard based on tstore support.\n        assembly {\n            // 1: handle case where tstore is supported from the start.\n            if tstoreInitialSupport {\n                // Ensure that the reentrancy guard is not currently set.\n                if tload(_REENTRANCY_GUARD_SLOT) {\n                    // Store left-padded selector with push4,\n                    // mem[28:32] = selector\n                    mstore(0, NoReentrantCalls_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                    revert(Error_selector_offset, NoReentrantCalls_error_length)\n                }\n            }\n\n            // Handle cases where tstore is not initially supported.\n            if iszero(tstoreInitialSupport) {\n                // Retrieve the reentrancy guard sentinel value.\n                let reentrancyGuard := sload(_REENTRANCY_GUARD_SLOT)\n\n                // 2: handle tstore support that was activated post-deployment.\n                if iszero(reentrancyGuard) {\n                    // Ensure that the reentrancy guard is not currently set.\n                    if tload(_REENTRANCY_GUARD_SLOT) {\n                        // Store left-padded selector with push4,\n                        // mem[28:32] = selector\n                        mstore(0, NoReentrantCalls_error_selector)\n\n                        // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                        revert(\n                            Error_selector_offset,\n                            NoReentrantCalls_error_length\n                        )\n                    }\n                }\n\n                // 3: handle case where tstore support has not been activated.\n                // Ensure that the reentrancy guard is not currently set.\n                if gt(reentrancyGuard, _NOT_ENTERED_SSTORE) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, NoReentrantCalls_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n                    revert(Error_selector_offset, NoReentrantCalls_error_length)\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Internal view function to ensure that the sentinel value indicating\n     *      native tokens may be received during execution is currently set.\n     */\n    function _assertAcceptingNativeTokens() internal view {\n        // Place immutable variable on the stack access within inline assembly.\n        bool tstoreInitialSupport = _tstoreInitialSupport;\n\n        // Utilize assembly to check reentrancy guard based on tstore support.\n        assembly {\n            // 1: handle case where tstore is supported from the start.\n            if tstoreInitialSupport {\n                // Ensure reentrancy guard is set to accept native tokens.\n                if iszero(\n                    eq(\n                        tload(_REENTRANCY_GUARD_SLOT),\n                        _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_TSTORE\n                    )\n                ) {\n                    // Store left-padded selector with push4,\n                    // mem[28:32] = selector\n                    mstore(0, InvalidMsgValue_error_selector)\n\n                    // Store argument.\n                    mstore(InvalidMsgValue_error_value_ptr, callvalue())\n\n                    // revert(abi.encodeWithSignature(\n                    //   \"InvalidMsgValue(uint256)\", value)\n                    // )\n                    revert(Error_selector_offset, InvalidMsgValue_error_length)\n                }\n            }\n\n            // Handle cases where tstore is not initially supported.\n            if iszero(tstoreInitialSupport) {\n                // Retrieve the reentrancy guard sentinel value.\n                let reentrancyGuard := sload(_REENTRANCY_GUARD_SLOT)\n\n                // 2: handle tstore support that was activated post-deployment.\n                if iszero(reentrancyGuard) {\n                    // Ensure reentrancy guard is set to accept native tokens.\n                    if iszero(\n                        eq(\n                            tload(_REENTRANCY_GUARD_SLOT),\n                            _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_TSTORE\n                        )\n                    ) {\n                        // Store left-padded selector with push4,\n                        // mem[28:32] = selector\n                        mstore(0, InvalidMsgValue_error_selector)\n\n                        // Store argument.\n                        mstore(InvalidMsgValue_error_value_ptr, callvalue())\n\n                        // revert(abi.encodeWithSignature(\n                        //   \"InvalidMsgValue(uint256)\", value)\n                        // )\n                        revert(\n                            Error_selector_offset,\n                            InvalidMsgValue_error_length\n                        )\n                    }\n                }\n\n                // 3: handle case where tstore support has not been activated.\n                // Ensure reentrancy guard is set to accepting native tokens.\n                if and(\n                    iszero(iszero(reentrancyGuard)),\n                    iszero(\n                        eq(\n                            reentrancyGuard,\n                            _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_SSTORE\n                        )\n                    )\n                ) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, InvalidMsgValue_error_selector)\n\n                    // Store argument.\n                    mstore(InvalidMsgValue_error_value_ptr, callvalue())\n\n                    // revert(abi.encodeWithSignature(\n                    //   \"InvalidMsgValue(uint256)\", value)\n                    // )\n                    revert(Error_selector_offset, InvalidMsgValue_error_length)\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Private function to deploy a test contract that utilizes TLOAD as\n     *      part of its fallback logic.\n     */\n    function _prepareTloadTest() private returns (address contractAddress) {\n        // Utilize assembly to deploy a contract testing TLOAD support.\n        assembly {\n            // Write the contract deployment code payload to scratch space.\n            mstore(0, _TLOAD_TEST_PAYLOAD)\n\n            // Deploy the contract.\n            contractAddress := create(\n                0,\n                _TLOAD_TEST_PAYLOAD_OFFSET,\n                _TLOAD_TEST_PAYLOAD_LENGTH\n            )\n        }\n    }\n\n    /**\n     * @dev Private view function to determine if TSTORE/TLOAD are supported by\n     *      the current EVM implementation by attempting to call the test\n     *      contract, which utilizes TLOAD as part of its fallback logic.\n     */\n    function _testTload(\n        address tloadTestContract\n    ) private view returns (bool ok) {\n        // Call the test contract, which will perform a TLOAD test. If the call\n        // does not revert, then TLOAD/TSTORE is supported. Do not forward all\n        // available gas, as all forwarded gas will be consumed on revert.\n        (ok, ) = tloadTestContract.staticcall{ gas: gasleft() / 10 }(\"\");\n    }\n}\n"},"src/lib/ZoneInteraction.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport { OrderType } from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    BasicOrderParameters,\n    OrderParameters\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    ZoneInteractionErrors\n} from \"seaport-types/src/interfaces/ZoneInteractionErrors.sol\";\n\nimport { LowLevelHelpers } from \"./LowLevelHelpers.sol\";\n\nimport { ConsiderationEncoder } from \"./ConsiderationEncoder.sol\";\n\nimport {\n    CalldataPointer,\n    MemoryPointer,\n    OffsetOrLengthMask,\n    ZeroSlotPtr\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\nimport {\n    authorizeOrder_selector_offset,\n    BasicOrder_zone_cdPtr,\n    ContractOrder_orderHash_offerer_shift,\n    MaskOverFirstFourBytes,\n    OneWord,\n    OrderParameters_salt_offset,\n    OrderParameters_zone_offset,\n    validateOrder_selector_offset\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    InvalidContractOrder_error_selector,\n    InvalidRestrictedOrder_error_length,\n    InvalidRestrictedOrder_error_orderHash_ptr,\n    InvalidRestrictedOrder_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title ZoneInteraction\n * @author 0age\n * @notice ZoneInteraction contains logic related to interacting with zones.\n */\ncontract ZoneInteraction is\n    ConsiderationEncoder,\n    ZoneInteractionErrors,\n    LowLevelHelpers\n{\n    /**\n     * @dev Internal function to determine if an order has a restricted order\n     *      type and, if so, to ensure that either the zone is the caller or\n     *      that a call to `validateOrder` on the zone returns a magic value\n     *      indicating that the order is currently valid. Note that contract\n     *      orders are not accessible via the basic fulfillment method.\n     *\n     * @param orderHash  The hash of the order.\n     * @param orderType  The order type.\n     */\n    function _assertRestrictedBasicOrderAuthorization(\n        bytes32 orderHash,\n        OrderType orderType\n    ) internal returns (uint256 callDataPointer) {\n        // Order type 2-3 require zone be caller or zone to approve.\n        // Note that in cases where fulfiller == zone, the restricted order\n        // validation will be skipped.\n        if (\n            _isRestrictedAndCallerNotZone(\n                orderType,\n                CalldataPointer.wrap(BasicOrder_zone_cdPtr).readAddress()\n            )\n        ) {\n            // Encode the `authorizeOrder` call in memory.\n            (\n                MemoryPointer callData,\n                uint256 size,\n                uint256 memoryLocationForOrderHashes\n            ) = _encodeAuthorizeBasicOrder(orderHash);\n\n            // Write the error selector to memory at the zero slot where it can\n            // be used to revert with a specific error message.\n            ZeroSlotPtr.write(InvalidRestrictedOrder_error_selector);\n\n            // Perform `authorizeOrder` call & ensure magic value was returned.\n            _callAndCheckStatus(\n                CalldataPointer.wrap(BasicOrder_zone_cdPtr).readAddress(),\n                orderHash,\n                callData.offset(authorizeOrder_selector_offset),\n                size\n            );\n\n            // Restore the zero slot.\n            ZeroSlotPtr.write(0);\n\n            // Register the calldata pointer for the encoded calldata.\n            callDataPointer = MemoryPointer.unwrap(callData);\n\n            // Utilize unchecked logic as size value cannot be so large as to\n            // cause an overflow.\n            unchecked {\n                // Write the packed encoding of size and memory location for\n                // order hashes to memory at the head of the encoded calldata.\n                callData.write(\n                    ((size + OneWord) << 128) | memoryLocationForOrderHashes\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to determine if an order has a restricted order\n     *      type and, if so, to ensure that either the zone is the caller or\n     *      that a call to `validateOrder` on the zone returns a magic value\n     *      indicating that the order is currently valid. Note that contract\n     *      orders are not accessible via the basic fulfillment method.\n     *\n     * @param orderHash   The hash of the order.\n     * @param orderType   The order type.\n     * @param callDataPtr The pointer to the call data for the basic order.\n     *                    Note that the initial value will contain the size\n     *                    and the memory location for order hashes length.\n     */\n    function _assertRestrictedBasicOrderValidity(\n        bytes32 orderHash,\n        OrderType orderType,\n        uint256 callDataPtr\n    ) internal {\n        // Order type 2-3 require zone be caller or zone to approve.\n        // Note that in cases where fulfiller == zone, the restricted order\n        // validation will be skipped.\n        if (\n            _isRestrictedAndCallerNotZone(\n                orderType,\n                CalldataPointer.wrap(BasicOrder_zone_cdPtr).readAddress()\n            )\n        ) {\n            // Cast the call data pointer to a memory pointer.\n            MemoryPointer callData = MemoryPointer.wrap(callDataPtr);\n\n            // Retrieve the size and memory location for order hashes from the\n            // head of the encoded calldata where it was previously written.\n            uint256 sizeAndMemoryLocationForOrderHashes = (\n                callData.readUint256()\n            );\n\n            // Split the packed encoding to retrieve size and memory location.\n            uint256 size = sizeAndMemoryLocationForOrderHashes >> 128;\n            uint256 memoryLocationForOrderHashes = (\n                sizeAndMemoryLocationForOrderHashes & OffsetOrLengthMask\n            );\n\n            // Encode the `validateOrder` call in memory.\n            _encodeValidateBasicOrder(callData, memoryLocationForOrderHashes);\n\n            // Account for the offset of the selector in the encoded call data.\n            callData = callData.offset(validateOrder_selector_offset);\n\n            // Write the error selector to memory at the zero slot where it can\n            // be used to revert with a specific error message.\n            ZeroSlotPtr.write(InvalidRestrictedOrder_error_selector);\n\n            // Perform `validateOrder` call and ensure magic value was returned.\n            _callAndCheckStatus(\n                CalldataPointer.wrap(BasicOrder_zone_cdPtr).readAddress(),\n                orderHash,\n                callData,\n                size\n            );\n\n            // Restore the zero slot.\n            ZeroSlotPtr.write(0);\n        }\n    }\n\n    /**\n     * @dev Internal function to determine the pre-execution validity of\n     *      restricted orders, signaling whether or not the order is valid.\n     *      Restricted orders where the caller is not the zone must\n     *      successfully call `authorizeOrder` with the correct magic value\n     *      returned.\n     *\n     * @param advancedOrder   The advanced order in question.\n     * @param orderHashes     The order hashes of each order included as part\n     *                        of the current fulfillment.\n     * @param orderHash       The hash of the order.\n     * @param orderIndex      The index of the order.\n     * @param revertOnInvalid Whether to revert if the call is invalid.\n     *\n     * @return isValid True if the order is valid, false otherwise (unless\n     *                 revertOnInvalid is true, in which case this function\n     *                 will revert).\n     */\n    function _checkRestrictedAdvancedOrderAuthorization(\n        AdvancedOrder memory advancedOrder,\n        bytes32[] memory orderHashes,\n        bytes32 orderHash,\n        uint256 orderIndex,\n        bool revertOnInvalid\n    ) internal returns (bool isValid) {\n        // Retrieve the parameters of the order in question.\n        OrderParameters memory parameters = advancedOrder.parameters;\n\n        // OrderType 2-3 require zone to be caller or approve via validateOrder.\n        if (\n            _isRestrictedAndCallerNotZone(parameters.orderType, parameters.zone)\n        ) {\n            // Encode the `validateOrder` call in memory.\n            (MemoryPointer callData, uint256 size) = _encodeAuthorizeOrder(\n                orderHash,\n                parameters,\n                advancedOrder.extraData,\n                orderHashes,\n                orderIndex\n            );\n\n            // Perform call and ensure a corresponding magic value was returned.\n            return\n                _callAndCheckStatusWithSkip(\n                    parameters.zone,\n                    orderHash,\n                    callData,\n                    size,\n                    InvalidRestrictedOrder_error_selector,\n                    revertOnInvalid\n                );\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Internal function to determine the pre-execution validity of\n     *      restricted orders and to revert if the order is invalid.\n     *      Restricted orders where the caller is not the zone must\n     *      successfully call `authorizeOrder` with the correct magic value\n     *      returned.\n     *\n     * @param advancedOrder   The advanced order in question.\n     * @param orderHashes     The order hashes of each order included as part\n     *                        of the current fulfillment.\n     * @param orderHash       The hash of the order.\n     * @param orderIndex      The index of the order.\n     */\n    function _assertRestrictedAdvancedOrderAuthorization(\n        AdvancedOrder memory advancedOrder,\n        bytes32[] memory orderHashes,\n        bytes32 orderHash,\n        uint256 orderIndex\n    ) internal {\n        // Retrieve the parameters of the order in question.\n        OrderParameters memory parameters = advancedOrder.parameters;\n\n        // OrderType 2-3 requires zone to call or approve via authorizeOrder.\n        if (\n            _isRestrictedAndCallerNotZone(parameters.orderType, parameters.zone)\n        ) {\n            // Encode the `authorizeOrder` call in memory.\n            (MemoryPointer callData, uint256 size) = _encodeAuthorizeOrder(\n                orderHash,\n                parameters,\n                advancedOrder.extraData,\n                orderHashes,\n                orderIndex\n            );\n\n            // Write the error selector to memory at the zero slot where it can\n            // be used to revert with a specific error message.\n            ZeroSlotPtr.write(InvalidRestrictedOrder_error_selector);\n\n            // Perform call and ensure a corresponding magic value was returned.\n            _callAndCheckStatus(parameters.zone, orderHash, callData, size);\n\n            // Restore the zero slot.\n            ZeroSlotPtr.write(0);\n        }\n    }\n\n    /**\n     * @dev Internal function to determine the post-execution validity of\n     *      restricted and contract orders. Restricted orders where the caller\n     *      is not the zone must successfully call `validateOrder` with the\n     *      correct magic value returned. Contract orders must successfully call\n     *      `ratifyOrder` with the correct magic value returned.\n     *\n     * @param advancedOrder The advanced order in question.\n     * @param orderHashes   The order hashes of each order included as part of\n     *                      the current fulfillment.\n     * @param orderHash     The hash of the order.\n     */\n    function _assertRestrictedAdvancedOrderValidity(\n        AdvancedOrder memory advancedOrder,\n        bytes32[] memory orderHashes,\n        bytes32 orderHash\n    ) internal {\n        // Declare variables that will be assigned based on the order type.\n        address target;\n        uint256 errorSelector;\n        MemoryPointer callData;\n        uint256 size;\n\n        // Retrieve the parameters of the order in question.\n        OrderParameters memory parameters = advancedOrder.parameters;\n\n        // OrderType 2-3 require zone to be caller or approve via validateOrder.\n        if (\n            _isRestrictedAndCallerNotZone(parameters.orderType, parameters.zone)\n        ) {\n            // Encode the `validateOrder` call in memory.\n            (callData, size) = _encodeValidateOrder(\n                parameters\n                    .toMemoryPointer()\n                    .offset(OrderParameters_salt_offset)\n                    .readUint256(),\n                orderHashes\n            );\n\n            // Set the target to the zone.\n            target = (\n                parameters\n                    .toMemoryPointer()\n                    .offset(OrderParameters_zone_offset)\n                    .readAddress()\n            );\n\n            // Set the restricted-order-specific error selector.\n            errorSelector = InvalidRestrictedOrder_error_selector;\n        } else if (parameters.orderType == OrderType.CONTRACT) {\n            // Set the target to the offerer (note the offerer has no offset).\n            target = parameters.toMemoryPointer().readAddress();\n\n            // Shift the target 96 bits to the left.\n            uint256 shiftedOfferer;\n            assembly {\n                shiftedOfferer := shl(\n                    ContractOrder_orderHash_offerer_shift,\n                    target\n                )\n            }\n\n            // Encode the `ratifyOrder` call in memory.\n            (callData, size) = _encodeRatifyOrder(\n                orderHash,\n                parameters,\n                advancedOrder.extraData,\n                orderHashes,\n                shiftedOfferer\n            );\n\n            // Set the contract-order-specific error selector.\n            errorSelector = InvalidContractOrder_error_selector;\n        } else {\n            return;\n        }\n\n        // Write the error selector to memory at the zero slot where it can be\n        // used to revert with a specific error message.\n        ZeroSlotPtr.write(errorSelector);\n\n        // Perform call and ensure a corresponding magic value was returned.\n        _callAndCheckStatus(target, orderHash, callData, size);\n\n        // Restore the zero slot.\n        ZeroSlotPtr.write(0);\n    }\n\n    /**\n     * @dev Determines whether the specified order type is restricted and the\n     *      caller is not the specified zone.\n     *\n     * @param orderType     The type of the order to check.\n     * @param zone          The address of the zone to check against.\n     *\n     * @return mustValidate True if the order type is restricted and the caller\n     *                      is not the specified zone, false otherwise.\n     */\n    function _isRestrictedAndCallerNotZone(\n        OrderType orderType,\n        address zone\n    ) internal view returns (bool mustValidate) {\n        // Utilize assembly to efficiently perform the check.\n        assembly {\n            mustValidate := and(\n                // Note that this check requires that there are no order\n                // types beyond the current set (0-4).  It will need to be\n                // modified if more order types are added.\n                and(lt(orderType, 4), gt(orderType, 1)),\n                iszero(eq(caller(), zone))\n            )\n        }\n    }\n\n    /**\n     * @dev Calls the specified target with the given data and checks the status\n     *      of the call. Revert reasons will be \"bubbled up\" if one is returned,\n     *      otherwise reverting calls will throw a generic error based on the\n     *      supplied error handler. Note that the custom error selector must\n     *      already be in memory at the zero slot when this function is called.\n     *\n     * @param target        The address of the contract to call.\n     * @param orderHash     The hash of the order associated with the call.\n     * @param callData      The data to pass to the contract call.\n     * @param size          The size of calldata.\n     */\n    function _callAndCheckStatus(\n        address target,\n        bytes32 orderHash,\n        MemoryPointer callData,\n        uint256 size\n    ) internal {\n        bool success;\n        bool magicMatch;\n        assembly {\n            // Get magic value from the selector at start of provided calldata.\n            let magic := and(mload(callData), MaskOverFirstFourBytes)\n\n            // Clear the start of scratch space.\n            mstore(0, 0)\n\n            // Perform call, placing result in the first word of scratch space.\n            success := call(gas(), target, 0, callData, size, 0, OneWord)\n\n            // Determine if returned magic value matches the calldata selector.\n            magicMatch := eq(magic, mload(0))\n        }\n\n        // Revert if the call was not successful.\n        if (!success) {\n            // Revert and pass reason along if one was returned.\n            _revertWithReasonIfOneIsReturned();\n\n            // If no reason was returned, revert with supplied error selector.\n            assembly {\n                // The error selector is already in memory at the zero slot.\n                mstore(0x80, orderHash)\n                // revert(abi.encodeWithSelector(\n                //     \"InvalidRestrictedOrder(bytes32)\",\n                //     orderHash\n                // ))\n                revert(0x7c, InvalidRestrictedOrder_error_length)\n            }\n        }\n\n        // Revert if the correct magic value was not returned.\n        if (!magicMatch) {\n            // Revert with a generic error message.\n            assembly {\n                // The error selector is already in memory at the zero slot.\n                mstore(0x80, orderHash)\n                // revert(abi.encodeWithSelector(\n                //     \"InvalidRestrictedOrder(bytes32)\",\n                //     orderHash\n                // ))\n                revert(0x7c, InvalidRestrictedOrder_error_length)\n            }\n        }\n    }\n\n    /**\n     * @dev Calls the specified target with the given data and checks the status\n     *      of the call. Revert reasons will be \"bubbled up\" if one is returned,\n     *      otherwise reverting calls will throw a generic error based on the\n     *      supplied error handler.\n     *\n     * @param target          The address of the contract to call.\n     * @param orderHash       The hash of the order associated with the call.\n     * @param callData        The data to pass to the contract call.\n     * @param size            The size of calldata.\n     * @param errorSelector   The error handling function to call if the call\n     *                        fails or the magic value does not match.\n     * @param revertOnInvalid Whether to revert if the call is invalid. Must\n     *                        still revert if the call returns invalid data.\n     */\n    function _callAndCheckStatusWithSkip(\n        address target,\n        bytes32 orderHash,\n        MemoryPointer callData,\n        uint256 size,\n        uint256 errorSelector,\n        bool revertOnInvalid\n    ) internal returns (bool) {\n        bool success;\n        bool magicMatch;\n        assembly {\n            // Get magic value from the selector at start of provided calldata.\n            let magic := and(mload(callData), MaskOverFirstFourBytes)\n\n            // Clear the start of scratch space.\n            mstore(0, 0)\n\n            // Perform call, placing result in the first word of scratch space.\n            success := call(gas(), target, 0, callData, size, 0, OneWord)\n\n            // Determine if returned magic value matches the calldata selector.\n            magicMatch := eq(magic, mload(0))\n        }\n\n        // Revert or return false if the call was not successful.\n        if (!success) {\n            if (!revertOnInvalid) {\n                return false;\n            }\n\n            // Revert and pass reason along if one was returned.\n            _revertWithReasonIfOneIsReturned();\n\n            // If no reason was returned, revert with supplied error selector.\n            assembly {\n                mstore(0, errorSelector)\n                mstore(InvalidRestrictedOrder_error_orderHash_ptr, orderHash)\n                // revert(abi.encodeWithSelector(\n                //     \"InvalidRestrictedOrder(bytes32)\",\n                //     orderHash\n                // ))\n                revert(\n                    Error_selector_offset,\n                    InvalidRestrictedOrder_error_length\n                )\n            }\n        }\n\n        // Revert if the correct magic value was not returned.\n        if (!magicMatch) {\n            // Revert with a generic error message.\n            assembly {\n                mstore(0, errorSelector)\n                mstore(InvalidRestrictedOrder_error_orderHash_ptr, orderHash)\n\n                // revert(abi.encodeWithSelector(\n                //     \"InvalidRestrictedOrder(bytes32)\",\n                //     orderHash\n                // ))\n                revert(\n                    Error_selector_offset,\n                    InvalidRestrictedOrder_error_length\n                )\n            }\n        }\n\n        return true;\n    }\n}\n"},"src/lib/TokenTransferrer.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {\n    BadReturnValueFromERC20OnTransfer_error_amount_ptr,\n    BadReturnValueFromERC20OnTransfer_error_from_ptr,\n    BadReturnValueFromERC20OnTransfer_error_length,\n    BadReturnValueFromERC20OnTransfer_error_selector,\n    BadReturnValueFromERC20OnTransfer_error_to_ptr,\n    BadReturnValueFromERC20OnTransfer_error_token_ptr,\n    BatchTransfer1155Params_amounts_head_ptr,\n    BatchTransfer1155Params_calldata_baseSize,\n    BatchTransfer1155Params_data_head_ptr,\n    BatchTransfer1155Params_data_length_basePtr,\n    BatchTransfer1155Params_ids_head_ptr,\n    BatchTransfer1155Params_ids_length_offset,\n    BatchTransfer1155Params_ids_length_ptr,\n    BatchTransfer1155Params_ptr,\n    ConduitBatch1155Transfer_amounts_length_baseOffset,\n    ConduitBatch1155Transfer_from_offset,\n    ConduitBatch1155Transfer_ids_head_offset,\n    ConduitBatch1155Transfer_ids_length_offset,\n    ConduitBatch1155Transfer_usable_head_size,\n    ConduitBatchTransfer_amounts_head_offset,\n    CostPerWord,\n    DefaultFreeMemoryPointer,\n    ERC1155_safeBatchTransferFrom_signature,\n    ERC1155_safeTransferFrom_amount_ptr,\n    ERC1155_safeTransferFrom_data_length_offset,\n    ERC1155_safeTransferFrom_data_length_ptr,\n    ERC1155_safeTransferFrom_data_offset_ptr,\n    ERC1155_safeTransferFrom_from_ptr,\n    ERC1155_safeTransferFrom_id_ptr,\n    ERC1155_safeTransferFrom_length,\n    ERC1155_safeTransferFrom_sig_ptr,\n    ERC1155_safeTransferFrom_signature,\n    ERC1155_safeTransferFrom_to_ptr,\n    ERC1155BatchTransferGenericFailure_error_signature,\n    ERC1155BatchTransferGenericFailure_ids_offset,\n    ERC1155BatchTransferGenericFailure_token_ptr,\n    ERC20_transferFrom_amount_ptr,\n    ERC20_transferFrom_from_ptr,\n    ERC20_transferFrom_length,\n    ERC20_transferFrom_sig_ptr,\n    ERC20_transferFrom_signature,\n    ERC20_transferFrom_to_ptr,\n    ERC721_transferFrom_from_ptr,\n    ERC721_transferFrom_id_ptr,\n    ERC721_transferFrom_length,\n    ERC721_transferFrom_sig_ptr,\n    ERC721_transferFrom_signature,\n    ERC721_transferFrom_to_ptr,\n    ExtraGasBuffer,\n    FreeMemoryPointerSlot,\n    Generic_error_selector_offset,\n    Invalid1155BatchTransferEncoding_length,\n    Invalid1155BatchTransferEncoding_ptr,\n    Invalid1155BatchTransferEncoding_selector,\n    MemoryExpansionCoefficientShift,\n    NoContract_error_account_ptr,\n    NoContract_error_length,\n    NoContract_error_selector,\n    OneWord,\n    OneWordShift,\n    Slot0x80,\n    Slot0xA0,\n    Slot0xC0,\n    ThirtyOneBytes,\n    TokenTransferGenericFailure_err_identifier_ptr,\n    TokenTransferGenericFailure_error_amount_ptr,\n    TokenTransferGenericFailure_error_from_ptr,\n    TokenTransferGenericFailure_error_identifier_ptr,\n    TokenTransferGenericFailure_error_length,\n    TokenTransferGenericFailure_error_selector,\n    TokenTransferGenericFailure_error_to_ptr,\n    TokenTransferGenericFailure_error_token_ptr,\n    TwoWords,\n    TwoWordsShift,\n    ZeroSlot\n} from \"seaport-types/src/lib/TokenTransferrerConstants.sol\";\n\nimport {\n    TokenTransferrerErrors\n} from \"seaport-types/src/interfaces/TokenTransferrerErrors.sol\";\n\nimport {\n    ConduitBatch1155Transfer\n} from \"seaport-types/src/conduit/lib/ConduitStructs.sol\";\n\n/**\n * @title TokenTransferrer\n * @author 0age\n * @custom:coauthor d1ll0n\n * @custom:coauthor transmissions11\n * @notice TokenTransferrer is a library for performing optimized ERC20, ERC721,\n *         ERC1155, and batch ERC1155 transfers, used by both Seaport as well as\n *         by conduits deployed by the ConduitController. Use great caution when\n *         considering these functions for use in other codebases, as there are\n *         significant side effects and edge cases that need to be thoroughly\n *         understood and carefully addressed.\n */\ncontract TokenTransferrer is TokenTransferrerErrors {\n    /**\n     * @dev Internal function to transfer ERC20 tokens from a given originator\n     *      to a given recipient. Sufficient approvals must be set on the\n     *      contract performing the transfer.\n     *\n     * @param token      The ERC20 token to transfer.\n     * @param from       The originator of the transfer.\n     * @param to         The recipient of the transfer.\n     * @param amount     The amount to transfer.\n     */\n    function _performERC20Transfer(\n        address token,\n        address from,\n        address to,\n        uint256 amount\n    ) internal {\n        // Utilize assembly to perform an optimized ERC20 token transfer.\n        assembly {\n            // The free memory pointer memory slot will be used when populating\n            // call data for the transfer; read the value and restore it later.\n            let memPointer := mload(FreeMemoryPointerSlot)\n\n            // Write call data into memory, starting with function selector.\n            mstore(ERC20_transferFrom_sig_ptr, ERC20_transferFrom_signature)\n            mstore(ERC20_transferFrom_from_ptr, from)\n            mstore(ERC20_transferFrom_to_ptr, to)\n            mstore(ERC20_transferFrom_amount_ptr, amount)\n\n            // Make call & copy up to 32 bytes of return data to scratch space.\n            // Scratch space does not need to be cleared ahead of time, as the\n            // subsequent check will ensure that either at least a full word of\n            // return data is received (in which case it will be overwritten) or\n            // that no data is received (in which case scratch space will be\n            // ignored) on a successful call to the given token.\n            let callStatus := call(\n                gas(),\n                token,\n                0,\n                ERC20_transferFrom_sig_ptr,\n                ERC20_transferFrom_length,\n                0,\n                OneWord\n            )\n\n            // Determine whether transfer was successful using status & result.\n            let success := and(\n                // Set success to whether the call reverted, if not check it\n                // either returned exactly 1 (can't just be non-zero data),\n                // or had no return data.\n                or(\n                    and(eq(mload(0), 1), gt(returndatasize(), 31)),\n                    iszero(returndatasize())\n                ),\n                callStatus\n            )\n\n            // Handle cases where either the transfer failed or no data was\n            // returned. Group these, as most transfers will succeed with data.\n            // Equivalent to `or(iszero(success), iszero(returndatasize()))`\n            // but after it's inverted for JUMPI this expression is cheaper.\n            if iszero(and(success, iszero(iszero(returndatasize())))) {\n                // If the token has no code or the transfer failed: Equivalent\n                // to `or(iszero(success), iszero(extcodesize(token)))` but\n                // after it's inverted for JUMPI this expression is cheaper.\n                if iszero(and(iszero(iszero(extcodesize(token))), success)) {\n                    // If the transfer failed:\n                    if iszero(success) {\n                        // If it was due to a revert:\n                        if iszero(callStatus) {\n                            // If it returned a message, bubble it up as long as\n                            // sufficient gas remains to do so:\n                            if returndatasize() {\n                                // Ensure that sufficient gas is available to\n                                // copy returndata while expanding memory where\n                                // necessary. Start by computing the word size\n                                // of returndata and allocated memory. Round up\n                                // to the nearest full word.\n                                let returnDataWords := shr(\n                                    OneWordShift,\n                                    add(returndatasize(), ThirtyOneBytes)\n                                )\n\n                                // Note: use the free memory pointer in place of\n                                // msize() to work around a Yul warning that\n                                // prevents accessing msize directly when the IR\n                                // pipeline is activated.\n                                let msizeWords := shr(OneWordShift, memPointer)\n\n                                // Next, compute the cost of the returndatacopy.\n                                let cost := mul(CostPerWord, returnDataWords)\n\n                                // Then, compute cost of new memory allocation.\n                                if gt(returnDataWords, msizeWords) {\n                                    cost := add(\n                                        cost,\n                                        add(\n                                            mul(\n                                                sub(\n                                                    returnDataWords,\n                                                    msizeWords\n                                                ),\n                                                CostPerWord\n                                            ),\n                                            shr(\n                                                MemoryExpansionCoefficientShift,\n                                                sub(\n                                                    mul(\n                                                        returnDataWords,\n                                                        returnDataWords\n                                                    ),\n                                                    mul(msizeWords, msizeWords)\n                                                )\n                                            )\n                                        )\n                                    )\n                                }\n\n                                // Finally, add a small constant and compare to\n                                // gas remaining; bubble up the revert data if\n                                // enough gas is still available.\n                                if lt(add(cost, ExtraGasBuffer), gas()) {\n                                    // Copy returndata to memory; overwrite\n                                    // existing memory.\n                                    returndatacopy(0, 0, returndatasize())\n\n                                    // Revert, specifying memory region with\n                                    // copied returndata.\n                                    revert(0, returndatasize())\n                                }\n                            }\n\n                            // Store left-padded selector with push4, mem[28:32]\n                            mstore(\n                                0,\n                                TokenTransferGenericFailure_error_selector\n                            )\n                            mstore(\n                                TokenTransferGenericFailure_error_token_ptr,\n                                token\n                            )\n                            mstore(\n                                TokenTransferGenericFailure_error_from_ptr,\n                                from\n                            )\n                            mstore(TokenTransferGenericFailure_error_to_ptr, to)\n                            mstore(\n                                TokenTransferGenericFailure_err_identifier_ptr,\n                                0\n                            )\n                            mstore(\n                                TokenTransferGenericFailure_error_amount_ptr,\n                                amount\n                            )\n\n                            // revert(abi.encodeWithSignature(\n                            //     \"TokenTransferGenericFailure(\n                            //         address,address,address,uint256,uint256\n                            //     )\", token, from, to, identifier, amount\n                            // ))\n                            revert(\n                                Generic_error_selector_offset,\n                                TokenTransferGenericFailure_error_length\n                            )\n                        }\n\n                        // Otherwise revert with a message about the token\n                        // returning false or non-compliant return values.\n\n                        // Store left-padded selector with push4, mem[28:32]\n                        mstore(\n                            0,\n                            BadReturnValueFromERC20OnTransfer_error_selector\n                        )\n                        mstore(\n                            BadReturnValueFromERC20OnTransfer_error_token_ptr,\n                            token\n                        )\n                        mstore(\n                            BadReturnValueFromERC20OnTransfer_error_from_ptr,\n                            from\n                        )\n                        mstore(\n                            BadReturnValueFromERC20OnTransfer_error_to_ptr,\n                            to\n                        )\n                        mstore(\n                            BadReturnValueFromERC20OnTransfer_error_amount_ptr,\n                            amount\n                        )\n\n                        // revert(abi.encodeWithSignature(\n                        //     \"BadReturnValueFromERC20OnTransfer(\n                        //         address,address,address,uint256\n                        //     )\", token, from, to, amount\n                        // ))\n                        revert(\n                            Generic_error_selector_offset,\n                            BadReturnValueFromERC20OnTransfer_error_length\n                        )\n                    }\n\n                    // Otherwise, revert with error about token not having code:\n                    // Store left-padded selector with push4, mem[28:32]\n                    mstore(0, NoContract_error_selector)\n                    mstore(NoContract_error_account_ptr, token)\n\n                    // revert(abi.encodeWithSignature(\n                    //      \"NoContract(address)\", account\n                    // ))\n                    revert(\n                        Generic_error_selector_offset,\n                        NoContract_error_length\n                    )\n                }\n\n                // Otherwise, the token just returned no data despite the call\n                // having succeeded; no need to optimize for this as it's not\n                // technically ERC20 compliant.\n            }\n\n            // Restore the original free memory pointer.\n            mstore(FreeMemoryPointerSlot, memPointer)\n\n            // Restore the zero slot to zero.\n            mstore(ZeroSlot, 0)\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer an ERC721 token from a given\n     *      originator to a given recipient. Sufficient approvals must be set on\n     *      the contract performing the transfer. Note that this function does\n     *      not check whether the receiver can accept the ERC721 token (i.e. it\n     *      does not use `safeTransferFrom`).\n     *\n     * @param token      The ERC721 token to transfer.\n     * @param from       The originator of the transfer.\n     * @param to         The recipient of the transfer.\n     * @param identifier The tokenId to transfer.\n     */\n    function _performERC721Transfer(\n        address token,\n        address from,\n        address to,\n        uint256 identifier\n    ) internal {\n        // Utilize assembly to perform an optimized ERC721 token transfer.\n        assembly {\n            // If the token has no code, revert.\n            if iszero(extcodesize(token)) {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, NoContract_error_selector)\n                mstore(NoContract_error_account_ptr, token)\n\n                // revert(abi.encodeWithSignature(\n                //     \"NoContract(address)\", account\n                // ))\n                revert(Generic_error_selector_offset, NoContract_error_length)\n            }\n\n            // The free memory pointer memory slot will be used when populating\n            // call data for the transfer; read the value and restore it later.\n            let memPointer := mload(FreeMemoryPointerSlot)\n\n            // Write call data to memory starting with function selector.\n            mstore(ERC721_transferFrom_sig_ptr, ERC721_transferFrom_signature)\n            mstore(ERC721_transferFrom_from_ptr, from)\n            mstore(ERC721_transferFrom_to_ptr, to)\n            mstore(ERC721_transferFrom_id_ptr, identifier)\n\n            // Perform the call, ignoring return data.\n            let success := call(\n                gas(),\n                token,\n                0,\n                ERC721_transferFrom_sig_ptr,\n                ERC721_transferFrom_length,\n                0,\n                0\n            )\n\n            // If the transfer reverted:\n            if iszero(success) {\n                // If it returned a message, bubble it up as long as sufficient\n                // gas remains to do so:\n                if returndatasize() {\n                    // Ensure that sufficient gas is available to copy\n                    // returndata while expanding memory where necessary. Start\n                    // by computing word size of returndata & allocated memory.\n                    // Round up to the nearest full word.\n                    let returnDataWords := shr(\n                        OneWordShift,\n                        add(returndatasize(), ThirtyOneBytes)\n                    )\n\n                    // Note: use the free memory pointer in place of msize() to\n                    // work around a Yul warning that prevents accessing msize\n                    // directly when the IR pipeline is activated.\n                    let msizeWords := shr(OneWordShift, memPointer)\n\n                    // Next, compute the cost of the returndatacopy.\n                    let cost := mul(CostPerWord, returnDataWords)\n\n                    // Then, compute cost of new memory allocation.\n                    if gt(returnDataWords, msizeWords) {\n                        cost := add(\n                            cost,\n                            add(\n                                mul(\n                                    sub(returnDataWords, msizeWords),\n                                    CostPerWord\n                                ),\n                                shr(\n                                    MemoryExpansionCoefficientShift,\n                                    sub(\n                                        mul(returnDataWords, returnDataWords),\n                                        mul(msizeWords, msizeWords)\n                                    )\n                                )\n                            )\n                        )\n                    }\n\n                    // Finally, add a small constant and compare to gas\n                    // remaining; bubble up the revert data if enough gas is\n                    // still available.\n                    if lt(add(cost, ExtraGasBuffer), gas()) {\n                        // Copy returndata to memory; overwrite existing memory.\n                        returndatacopy(0, 0, returndatasize())\n\n                        // Revert, giving memory region with copied returndata.\n                        revert(0, returndatasize())\n                    }\n                }\n\n                // Otherwise revert with a generic error message.\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, TokenTransferGenericFailure_error_selector)\n                mstore(TokenTransferGenericFailure_error_token_ptr, token)\n                mstore(TokenTransferGenericFailure_error_from_ptr, from)\n                mstore(TokenTransferGenericFailure_error_to_ptr, to)\n                mstore(\n                    TokenTransferGenericFailure_error_identifier_ptr,\n                    identifier\n                )\n                mstore(TokenTransferGenericFailure_error_amount_ptr, 1)\n\n                // revert(abi.encodeWithSignature(\n                //     \"TokenTransferGenericFailure(\n                //         address,address,address,uint256,uint256\n                //     )\", token, from, to, identifier, amount\n                // ))\n                revert(\n                    Generic_error_selector_offset,\n                    TokenTransferGenericFailure_error_length\n                )\n            }\n\n            // Restore the original free memory pointer.\n            mstore(FreeMemoryPointerSlot, memPointer)\n\n            // Restore the zero slot to zero.\n            mstore(ZeroSlot, 0)\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer ERC1155 tokens from a given\n     *      originator to a given recipient. Sufficient approvals must be set on\n     *      the contract performing the transfer and contract recipients must\n     *      implement the ERC1155TokenReceiver interface to indicate that they\n     *      are willing to accept the transfer.\n     *\n     * @param token      The ERC1155 token to transfer.\n     * @param from       The originator of the transfer.\n     * @param to         The recipient of the transfer.\n     * @param identifier The id to transfer.\n     * @param amount     The amount to transfer.\n     */\n    function _performERC1155Transfer(\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount\n    ) internal {\n        // Utilize assembly to perform an optimized ERC1155 token transfer.\n        assembly {\n            // If the token has no code, revert.\n            if iszero(extcodesize(token)) {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, NoContract_error_selector)\n                mstore(NoContract_error_account_ptr, token)\n\n                // revert(abi.encodeWithSignature(\n                //     \"NoContract(address)\", account\n                // ))\n                revert(Generic_error_selector_offset, NoContract_error_length)\n            }\n\n            // The following memory slots will be used when populating call data\n            // for the transfer; read the values and restore them later.\n            let memPointer := mload(FreeMemoryPointerSlot)\n            let slot0x80 := mload(Slot0x80)\n            let slot0xA0 := mload(Slot0xA0)\n            let slot0xC0 := mload(Slot0xC0)\n\n            // Write call data into memory, beginning with function selector.\n            mstore(\n                ERC1155_safeTransferFrom_sig_ptr,\n                ERC1155_safeTransferFrom_signature\n            )\n            mstore(ERC1155_safeTransferFrom_from_ptr, from)\n            mstore(ERC1155_safeTransferFrom_to_ptr, to)\n            mstore(ERC1155_safeTransferFrom_id_ptr, identifier)\n            mstore(ERC1155_safeTransferFrom_amount_ptr, amount)\n            mstore(\n                ERC1155_safeTransferFrom_data_offset_ptr,\n                ERC1155_safeTransferFrom_data_length_offset\n            )\n            mstore(ERC1155_safeTransferFrom_data_length_ptr, 0)\n\n            // Perform the call, ignoring return data.\n            let success := call(\n                gas(),\n                token,\n                0,\n                ERC1155_safeTransferFrom_sig_ptr,\n                ERC1155_safeTransferFrom_length,\n                0,\n                0\n            )\n\n            // If the transfer reverted:\n            if iszero(success) {\n                // If it returned a message, bubble it up as long as sufficient\n                // gas remains to do so:\n                if returndatasize() {\n                    // Ensure that sufficient gas is available to copy\n                    // returndata while expanding memory where necessary. Start\n                    // by computing word size of returndata & allocated memory.\n                    // Round up to the nearest full word.\n                    let returnDataWords := shr(\n                        OneWordShift,\n                        add(returndatasize(), ThirtyOneBytes)\n                    )\n\n                    // Note: use the free memory pointer in place of msize() to\n                    // work around a Yul warning that prevents accessing msize\n                    // directly when the IR pipeline is activated.\n                    let msizeWords := shr(OneWordShift, memPointer)\n\n                    // Next, compute the cost of the returndatacopy.\n                    let cost := mul(CostPerWord, returnDataWords)\n\n                    // Then, compute cost of new memory allocation.\n                    if gt(returnDataWords, msizeWords) {\n                        cost := add(\n                            cost,\n                            add(\n                                mul(\n                                    sub(returnDataWords, msizeWords),\n                                    CostPerWord\n                                ),\n                                shr(\n                                    MemoryExpansionCoefficientShift,\n                                    sub(\n                                        mul(returnDataWords, returnDataWords),\n                                        mul(msizeWords, msizeWords)\n                                    )\n                                )\n                            )\n                        )\n                    }\n\n                    // Finally, add a small constant and compare to gas\n                    // remaining; bubble up the revert data if enough gas is\n                    // still available.\n                    if lt(add(cost, ExtraGasBuffer), gas()) {\n                        // Copy returndata to memory; overwrite existing memory.\n                        returndatacopy(0, 0, returndatasize())\n\n                        // Revert, giving memory region with copied returndata.\n                        revert(0, returndatasize())\n                    }\n                }\n\n                // Otherwise revert with a generic error message.\n\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, TokenTransferGenericFailure_error_selector)\n                mstore(TokenTransferGenericFailure_error_token_ptr, token)\n                mstore(TokenTransferGenericFailure_error_from_ptr, from)\n                mstore(TokenTransferGenericFailure_error_to_ptr, to)\n                mstore(\n                    TokenTransferGenericFailure_error_identifier_ptr,\n                    identifier\n                )\n                mstore(TokenTransferGenericFailure_error_amount_ptr, amount)\n\n                // revert(abi.encodeWithSignature(\n                //     \"TokenTransferGenericFailure(\n                //         address,address,address,uint256,uint256\n                //     )\", token, from, to, identifier, amount\n                // ))\n                revert(\n                    Generic_error_selector_offset,\n                    TokenTransferGenericFailure_error_length\n                )\n            }\n\n            mstore(Slot0x80, slot0x80) // Restore slot 0x80.\n            mstore(Slot0xA0, slot0xA0) // Restore slot 0xA0.\n            mstore(Slot0xC0, slot0xC0) // Restore slot 0xC0.\n\n            // Restore the original free memory pointer.\n            mstore(FreeMemoryPointerSlot, memPointer)\n\n            // Restore the zero slot to zero.\n            mstore(ZeroSlot, 0)\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer ERC1155 tokens from a given\n     *      originator to a given recipient. Sufficient approvals must be set on\n     *      the contract performing the transfer and contract recipients must\n     *      implement the ERC1155TokenReceiver interface to indicate that they\n     *      are willing to accept the transfer. NOTE: this function is not\n     *      memory-safe; it will overwrite existing memory, restore the free\n     *      memory pointer to the default value, and overwrite the zero slot.\n     *      This function should only be called once memory is no longer\n     *      required and when uninitialized arrays are not utilized, and memory\n     *      should be considered fully corrupted (aside from the existence of a\n     *      default-value free memory pointer) after calling this function.\n     *\n     * @param batchTransfers The group of 1155 batch transfers to perform.\n     */\n    function _performERC1155BatchTransfers(\n        ConduitBatch1155Transfer[] calldata batchTransfers\n    ) internal {\n        // Utilize assembly to perform optimized batch 1155 transfers.\n        assembly {\n            let len := batchTransfers.length\n            // Pointer to first head in the array, which is offset to the struct\n            // at each index. This gets incremented after each loop to avoid\n            // multiplying by 32 to get the offset for each element.\n            let nextElementHeadPtr := batchTransfers.offset\n\n            // Pointer to beginning of the head of the array. This is the\n            // reference position each offset references. It's held static to\n            // let each loop calculate the data position for an element.\n            let arrayHeadPtr := nextElementHeadPtr\n\n            // Write the function selector, which will be reused for each call:\n            // safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\n            mstore(\n                ConduitBatch1155Transfer_from_offset,\n                ERC1155_safeBatchTransferFrom_signature\n            )\n\n            // Iterate over each batch transfer.\n            for {\n                let i := 0\n            } lt(i, len) {\n                i := add(i, 1)\n            } {\n                // Read the offset to the beginning of the element and add\n                // it to pointer to the beginning of the array head to get\n                // the absolute position of the element in calldata.\n                let elementPtr := add(\n                    arrayHeadPtr,\n                    calldataload(nextElementHeadPtr)\n                )\n\n                // Retrieve the token from calldata.\n                let token := calldataload(elementPtr)\n\n                // If the token has no code, revert.\n                if iszero(extcodesize(token)) {\n                    // Store left-padded selector with push4, mem[28:32]\n                    mstore(0, NoContract_error_selector)\n                    mstore(NoContract_error_account_ptr, token)\n\n                    // revert(abi.encodeWithSignature(\n                    //     \"NoContract(address)\", account\n                    // ))\n                    revert(\n                        Generic_error_selector_offset,\n                        NoContract_error_length\n                    )\n                }\n\n                // Get the total number of supplied ids.\n                let idsLength := calldataload(\n                    add(elementPtr, ConduitBatch1155Transfer_ids_length_offset)\n                )\n\n                // Determine the expected offset for the amounts array.\n                let expectedAmountsOffset := add(\n                    ConduitBatch1155Transfer_amounts_length_baseOffset,\n                    shl(OneWordShift, idsLength)\n                )\n\n                // Validate struct encoding.\n                let invalidEncoding := iszero(\n                    and(\n                        // ids.length == amounts.length\n                        eq(\n                            idsLength,\n                            calldataload(add(elementPtr, expectedAmountsOffset))\n                        ),\n                        and(\n                            // ids_offset == 0xa0\n                            eq(\n                                calldataload(\n                                    add(\n                                        elementPtr,\n                                        ConduitBatch1155Transfer_ids_head_offset\n                                    )\n                                ),\n                                ConduitBatch1155Transfer_ids_length_offset\n                            ),\n                            // amounts_offset == 0xc0 + ids.length*32\n                            eq(\n                                calldataload(\n                                    add(\n                                        elementPtr,\n                                        ConduitBatchTransfer_amounts_head_offset\n                                    )\n                                ),\n                                expectedAmountsOffset\n                            )\n                        )\n                    )\n                )\n\n                // Revert with an error if the encoding is not valid.\n                if invalidEncoding {\n                    // Store left-padded selector with push4, mem[28:32]\n                    mstore(\n                        Invalid1155BatchTransferEncoding_ptr,\n                        Invalid1155BatchTransferEncoding_selector\n                    )\n\n                    // revert(abi.encodeWithSignature(\n                    //     \"Invalid1155BatchTransferEncoding()\"\n                    // ))\n                    revert(\n                        Invalid1155BatchTransferEncoding_ptr,\n                        Invalid1155BatchTransferEncoding_length\n                    )\n                }\n\n                // Update the offset position for the next loop\n                nextElementHeadPtr := add(nextElementHeadPtr, OneWord)\n\n                // Copy the first section of calldata (before dynamic values).\n                calldatacopy(\n                    BatchTransfer1155Params_ptr,\n                    add(elementPtr, ConduitBatch1155Transfer_from_offset),\n                    ConduitBatch1155Transfer_usable_head_size\n                )\n\n                // Determine size of calldata required for ids and amounts. Note\n                // that the size includes both lengths as well as the data.\n                let idsAndAmountsSize := add(\n                    TwoWords,\n                    shl(TwoWordsShift, idsLength)\n                )\n\n                // Update the offset for the data array in memory.\n                mstore(\n                    BatchTransfer1155Params_data_head_ptr,\n                    add(\n                        BatchTransfer1155Params_ids_length_offset,\n                        idsAndAmountsSize\n                    )\n                )\n\n                // Set the length of the data array in memory to zero.\n                mstore(\n                    add(\n                        BatchTransfer1155Params_data_length_basePtr,\n                        idsAndAmountsSize\n                    ),\n                    0\n                )\n\n                // Determine the total calldata size for the call to transfer.\n                let transferDataSize := add(\n                    BatchTransfer1155Params_calldata_baseSize,\n                    idsAndAmountsSize\n                )\n\n                // Copy second section of calldata (including dynamic values).\n                calldatacopy(\n                    BatchTransfer1155Params_ids_length_ptr,\n                    add(elementPtr, ConduitBatch1155Transfer_ids_length_offset),\n                    idsAndAmountsSize\n                )\n\n                // Perform the call to transfer 1155 tokens.\n                let success := call(\n                    gas(),\n                    token,\n                    0,\n                    ConduitBatch1155Transfer_from_offset, // Data start.\n                    transferDataSize, // Location of the length of callData.\n                    0,\n                    0\n                )\n\n                // If the transfer reverted:\n                if iszero(success) {\n                    // If it returned a message, bubble it up as long as\n                    // sufficient gas remains to do so:\n                    if returndatasize() {\n                        // Ensure that sufficient gas is available to copy\n                        // returndata while expanding memory where necessary.\n                        // Start by computing word size of returndata and\n                        // allocated memory. Round up to the nearest full word.\n                        let returnDataWords := shr(\n                            OneWordShift,\n                            add(returndatasize(), ThirtyOneBytes)\n                        )\n\n                        // Note: use transferDataSize in place of msize() to\n                        // work around a Yul warning that prevents accessing\n                        // msize directly when the IR pipeline is activated.\n                        // The free memory pointer is not used here because\n                        // this function does almost all memory management\n                        // manually and does not update it, and transferDataSize\n                        // should be the largest memory value used (unless a\n                        // previous batch was larger).\n                        let msizeWords := shr(OneWordShift, transferDataSize)\n\n                        // Next, compute the cost of the returndatacopy.\n                        let cost := mul(CostPerWord, returnDataWords)\n\n                        // Then, compute cost of new memory allocation.\n                        if gt(returnDataWords, msizeWords) {\n                            cost := add(\n                                cost,\n                                add(\n                                    mul(\n                                        sub(returnDataWords, msizeWords),\n                                        CostPerWord\n                                    ),\n                                    shr(\n                                        MemoryExpansionCoefficientShift,\n                                        sub(\n                                            mul(\n                                                returnDataWords,\n                                                returnDataWords\n                                            ),\n                                            mul(msizeWords, msizeWords)\n                                        )\n                                    )\n                                )\n                            )\n                        }\n\n                        // Finally, add a small constant and compare to gas\n                        // remaining; bubble up the revert data if enough gas is\n                        // still available.\n                        if lt(add(cost, ExtraGasBuffer), gas()) {\n                            // Copy returndata to memory; overwrite existing.\n                            returndatacopy(0, 0, returndatasize())\n\n                            // Revert with memory region containing returndata.\n                            revert(0, returndatasize())\n                        }\n                    }\n\n                    // Set the error signature.\n                    mstore(\n                        0,\n                        ERC1155BatchTransferGenericFailure_error_signature\n                    )\n\n                    // Write the token.\n                    mstore(ERC1155BatchTransferGenericFailure_token_ptr, token)\n\n                    // Increase the offset to ids by 32.\n                    mstore(\n                        BatchTransfer1155Params_ids_head_ptr,\n                        ERC1155BatchTransferGenericFailure_ids_offset\n                    )\n\n                    // Increase the offset to amounts by 32.\n                    mstore(\n                        BatchTransfer1155Params_amounts_head_ptr,\n                        add(\n                            OneWord,\n                            mload(BatchTransfer1155Params_amounts_head_ptr)\n                        )\n                    )\n\n                    // Return modified region. The total size stays the same as\n                    // `token` uses the same number of bytes as `data.length`.\n                    revert(0, transferDataSize)\n                }\n            }\n\n            // Reset the free memory pointer to the default value; memory must\n            // be assumed to be dirtied and not reused from this point forward.\n            // Also note that the zero slot is not reset to zero, meaning empty\n            // arrays cannot be safely created or utilized until it is restored.\n            mstore(FreeMemoryPointerSlot, DefaultFreeMemoryPointer)\n        }\n    }\n}\n"},"src/lib/ConsiderationBase.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ConduitControllerInterface\n} from \"seaport-types/src/interfaces/ConduitControllerInterface.sol\";\n\nimport {\n    ConsiderationEventsAndErrors\n} from \"seaport-types/src/interfaces/ConsiderationEventsAndErrors.sol\";\n\nimport {\n    BulkOrder_Typehash_Height_One,\n    BulkOrder_Typehash_Height_Two,\n    BulkOrder_Typehash_Height_Three,\n    BulkOrder_Typehash_Height_Four,\n    BulkOrder_Typehash_Height_Five,\n    BulkOrder_Typehash_Height_Six,\n    BulkOrder_Typehash_Height_Seven,\n    BulkOrder_Typehash_Height_Eight,\n    BulkOrder_Typehash_Height_Nine,\n    BulkOrder_Typehash_Height_Ten,\n    BulkOrder_Typehash_Height_Eleven,\n    BulkOrder_Typehash_Height_Twelve,\n    BulkOrder_Typehash_Height_Thirteen,\n    BulkOrder_Typehash_Height_Fourteen,\n    BulkOrder_Typehash_Height_Fifteen,\n    BulkOrder_Typehash_Height_Sixteen,\n    BulkOrder_Typehash_Height_Seventeen,\n    BulkOrder_Typehash_Height_Eighteen,\n    BulkOrder_Typehash_Height_Nineteen,\n    BulkOrder_Typehash_Height_Twenty,\n    BulkOrder_Typehash_Height_TwentyOne,\n    BulkOrder_Typehash_Height_TwentyTwo,\n    BulkOrder_Typehash_Height_TwentyThree,\n    BulkOrder_Typehash_Height_TwentyFour,\n    EIP712_domainData_chainId_offset,\n    EIP712_domainData_nameHash_offset,\n    EIP712_domainData_size,\n    EIP712_domainData_verifyingContract_offset,\n    EIP712_domainData_versionHash_offset,\n    FreeMemoryPointerSlot,\n    NameLengthPtr,\n    NameWithLength,\n    OneWord,\n    Slot0x80,\n    ThreeWords,\n    ZeroSlot\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport { ConsiderationDecoder } from \"./ConsiderationDecoder.sol\";\n\nimport { ConsiderationEncoder } from \"./ConsiderationEncoder.sol\";\n\n/**\n * @title ConsiderationBase\n * @author 0age\n * @notice ConsiderationBase contains immutable constants and constructor logic.\n */\ncontract ConsiderationBase is\n    ConsiderationDecoder,\n    ConsiderationEncoder,\n    ConsiderationEventsAndErrors\n{\n    // Precompute hashes, original chainId, and domain separator on deployment.\n    bytes32 internal immutable _NAME_HASH;\n    bytes32 internal immutable _VERSION_HASH;\n    bytes32 internal immutable _EIP_712_DOMAIN_TYPEHASH;\n    bytes32 internal immutable _OFFER_ITEM_TYPEHASH;\n    bytes32 internal immutable _CONSIDERATION_ITEM_TYPEHASH;\n    bytes32 internal immutable _ORDER_TYPEHASH;\n    uint256 internal immutable _CHAIN_ID;\n    bytes32 internal immutable _DOMAIN_SEPARATOR;\n\n    // Allow for interaction with the conduit controller.\n    ConduitControllerInterface internal immutable _CONDUIT_CONTROLLER;\n\n    // Cache the conduit creation code hash used by the conduit controller.\n    bytes32 internal immutable _CONDUIT_CREATION_CODE_HASH;\n\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) {\n        // Derive name and version hashes alongside required EIP-712 typehashes.\n        (\n            _NAME_HASH,\n            _VERSION_HASH,\n            _EIP_712_DOMAIN_TYPEHASH,\n            _OFFER_ITEM_TYPEHASH,\n            _CONSIDERATION_ITEM_TYPEHASH,\n            _ORDER_TYPEHASH\n        ) = _deriveTypehashes();\n\n        // Store the current chainId and derive the current domain separator.\n        _CHAIN_ID = block.chainid;\n        _DOMAIN_SEPARATOR = _deriveDomainSeparator();\n\n        // Set the supplied conduit controller.\n        _CONDUIT_CONTROLLER = ConduitControllerInterface(conduitController);\n\n        // Retrieve the conduit creation code hash from the supplied controller.\n        (_CONDUIT_CREATION_CODE_HASH, ) = (\n            _CONDUIT_CONTROLLER.getConduitCodeHashes()\n        );\n    }\n\n    /**\n     * @dev Internal view function to derive the EIP-712 domain separator.\n     *\n     * @return domainSeparator The derived domain separator.\n     */\n    function _deriveDomainSeparator()\n        internal\n        view\n        returns (bytes32 domainSeparator)\n    {\n        bytes32 typehash = _EIP_712_DOMAIN_TYPEHASH;\n        bytes32 nameHash = _NAME_HASH;\n        bytes32 versionHash = _VERSION_HASH;\n\n        // Leverage scratch space and other memory to perform an efficient hash.\n        assembly {\n            // Retrieve the free memory pointer; it will be replaced afterwards.\n            let freeMemoryPointer := mload(FreeMemoryPointerSlot)\n\n            // Retrieve value at 0x80; it will also be replaced afterwards.\n            let slot0x80 := mload(Slot0x80)\n\n            // Place typehash, name hash, and version hash at start of memory.\n            mstore(0, typehash)\n            mstore(EIP712_domainData_nameHash_offset, nameHash)\n            mstore(EIP712_domainData_versionHash_offset, versionHash)\n\n            // Place chainId in the next memory location.\n            mstore(EIP712_domainData_chainId_offset, chainid())\n\n            // Place the address of this contract in the next memory location.\n            mstore(EIP712_domainData_verifyingContract_offset, address())\n\n            // Hash relevant region of memory to derive the domain separator.\n            domainSeparator := keccak256(0, EIP712_domainData_size)\n\n            // Restore the free memory pointer.\n            mstore(FreeMemoryPointerSlot, freeMemoryPointer)\n\n            // Restore the zero slot to zero.\n            mstore(ZeroSlot, 0)\n\n            // Restore the value at 0x80.\n            mstore(Slot0x80, slot0x80)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to retrieve the default name of this\n     *      contract and return.\n     *\n     * @return The name of this contract.\n     */\n    function _name() internal pure virtual returns (string memory) {\n        // Return the name of the contract.\n        assembly {\n            // First element is the offset for the returned string. Offset the\n            // value in memory by one word so that the free memory pointer will\n            // be overwritten by the next write.\n            mstore(OneWord, OneWord)\n\n            // Name is right padded, so it touches the length which is left\n            // padded. This enables writing both values at once. The free memory\n            // pointer will be overwritten in the process.\n            mstore(NameLengthPtr, NameWithLength)\n\n            // Standard ABI encoding pads returned data to the nearest word. Use\n            // the already empty zero slot memory region for this purpose and\n            // return the final name string, offset by the original single word.\n            return(OneWord, ThreeWords)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to retrieve the default name of this contract\n     *      as a string that can be used internally.\n     *\n     * @return The name of this contract.\n     */\n    function _nameString() internal pure virtual returns (string memory) {\n        // Return the name of the contract.\n        return \"Consideration\";\n    }\n\n    /**\n     * @dev Internal pure function to derive required EIP-712 typehashes and\n     *      other hashes during contract creation.\n     *\n     * @return nameHash                  The hash of the name of the contract.\n     * @return versionHash               The hash of the version string of the\n     *                                   contract.\n     * @return eip712DomainTypehash      The primary EIP-712 domain typehash.\n     * @return offerItemTypehash         The EIP-712 typehash for OfferItem\n     *                                   types.\n     * @return considerationItemTypehash The EIP-712 typehash for\n     *                                   ConsiderationItem types.\n     * @return orderTypehash             The EIP-712 typehash for Order types.\n     */\n    function _deriveTypehashes()\n        internal\n        pure\n        returns (\n            bytes32 nameHash,\n            bytes32 versionHash,\n            bytes32 eip712DomainTypehash,\n            bytes32 offerItemTypehash,\n            bytes32 considerationItemTypehash,\n            bytes32 orderTypehash\n        )\n    {\n        // Derive hash of the name of the contract.\n        nameHash = keccak256(bytes(_nameString()));\n\n        // Derive hash of the version string of the contract.\n        versionHash = keccak256(bytes(\"1.6\"));\n\n        // Construct the OfferItem type string.\n        bytes memory offerItemTypeString = bytes(\n            \"OfferItem(\"\n            \"uint8 itemType,\"\n            \"address token,\"\n            \"uint256 identifierOrCriteria,\"\n            \"uint256 startAmount,\"\n            \"uint256 endAmount\"\n            \")\"\n        );\n\n        // Construct the ConsiderationItem type string.\n        bytes memory considerationItemTypeString = bytes(\n            \"ConsiderationItem(\"\n            \"uint8 itemType,\"\n            \"address token,\"\n            \"uint256 identifierOrCriteria,\"\n            \"uint256 startAmount,\"\n            \"uint256 endAmount,\"\n            \"address recipient\"\n            \")\"\n        );\n\n        // Construct the OrderComponents type string, not including the above.\n        bytes memory orderComponentsPartialTypeString = bytes(\n            \"OrderComponents(\"\n            \"address offerer,\"\n            \"address zone,\"\n            \"OfferItem[] offer,\"\n            \"ConsiderationItem[] consideration,\"\n            \"uint8 orderType,\"\n            \"uint256 startTime,\"\n            \"uint256 endTime,\"\n            \"bytes32 zoneHash,\"\n            \"uint256 salt,\"\n            \"bytes32 conduitKey,\"\n            \"uint256 counter\"\n            \")\"\n        );\n\n        // Construct the primary EIP-712 domain type string.\n        eip712DomainTypehash = keccak256(\n            bytes(\n                \"EIP712Domain(\"\n                \"string name,\"\n                \"string version,\"\n                \"uint256 chainId,\"\n                \"address verifyingContract\"\n                \")\"\n            )\n        );\n\n        // Derive the OfferItem type hash using the corresponding type string.\n        offerItemTypehash = keccak256(offerItemTypeString);\n\n        // Derive ConsiderationItem type hash using corresponding type string.\n        considerationItemTypehash = keccak256(considerationItemTypeString);\n\n        bytes memory orderTypeString = bytes.concat(\n            orderComponentsPartialTypeString,\n            considerationItemTypeString,\n            offerItemTypeString\n        );\n\n        // Derive OrderItem type hash via combination of relevant type strings.\n        orderTypehash = keccak256(orderTypeString);\n    }\n\n    /**\n     * @dev Internal pure function to look up one of twenty-four potential bulk\n     *      order typehash constants based on the height of the bulk order tree.\n     *      Note that values between one and twenty-four are supported, which is\n     *      enforced by _isValidBulkOrderSize.\n     *\n     * @param _treeHeight The height of the bulk order tree. The value must be\n     *                    between one and twenty-four.\n     *\n     * @return _typeHash The EIP-712 typehash for the bulk order type with the\n     *                   given height.\n     */\n    function _lookupBulkOrderTypehash(\n        uint256 _treeHeight\n    ) internal pure returns (bytes32 _typeHash) {\n        // Utilize assembly to efficiently retrieve correct bulk order typehash.\n        assembly {\n            // Use a Yul function to enable use of the `leave` keyword\n            // to stop searching once the appropriate type hash is found.\n            function lookupTypeHash(treeHeight) -> typeHash {\n                // Handle tree heights one through eight.\n                if lt(treeHeight, 9) {\n                    // Handle tree heights one through four.\n                    if lt(treeHeight, 5) {\n                        // Handle tree heights one and two.\n                        if lt(treeHeight, 3) {\n                            // Utilize branchless logic to determine typehash.\n                            typeHash := ternary(\n                                eq(treeHeight, 1),\n                                BulkOrder_Typehash_Height_One,\n                                BulkOrder_Typehash_Height_Two\n                            )\n\n                            // Exit the function once typehash has been located.\n                            leave\n                        }\n\n                        // Handle height three and four via branchless logic.\n                        typeHash := ternary(\n                            eq(treeHeight, 3),\n                            BulkOrder_Typehash_Height_Three,\n                            BulkOrder_Typehash_Height_Four\n                        )\n\n                        // Exit the function once typehash has been located.\n                        leave\n                    }\n\n                    // Handle tree height five and six.\n                    if lt(treeHeight, 7) {\n                        // Utilize branchless logic to determine typehash.\n                        typeHash := ternary(\n                            eq(treeHeight, 5),\n                            BulkOrder_Typehash_Height_Five,\n                            BulkOrder_Typehash_Height_Six\n                        )\n\n                        // Exit the function once typehash has been located.\n                        leave\n                    }\n\n                    // Handle height seven and eight via branchless logic.\n                    typeHash := ternary(\n                        eq(treeHeight, 7),\n                        BulkOrder_Typehash_Height_Seven,\n                        BulkOrder_Typehash_Height_Eight\n                    )\n\n                    // Exit the function once typehash has been located.\n                    leave\n                }\n\n                // Handle tree height nine through sixteen.\n                if lt(treeHeight, 17) {\n                    // Handle tree height nine through twelve.\n                    if lt(treeHeight, 13) {\n                        // Handle tree height nine and ten.\n                        if lt(treeHeight, 11) {\n                            // Utilize branchless logic to determine typehash.\n                            typeHash := ternary(\n                                eq(treeHeight, 9),\n                                BulkOrder_Typehash_Height_Nine,\n                                BulkOrder_Typehash_Height_Ten\n                            )\n\n                            // Exit the function once typehash has been located.\n                            leave\n                        }\n\n                        // Handle height eleven and twelve via branchless logic.\n                        typeHash := ternary(\n                            eq(treeHeight, 11),\n                            BulkOrder_Typehash_Height_Eleven,\n                            BulkOrder_Typehash_Height_Twelve\n                        )\n\n                        // Exit the function once typehash has been located.\n                        leave\n                    }\n\n                    // Handle tree height thirteen and fourteen.\n                    if lt(treeHeight, 15) {\n                        // Utilize branchless logic to determine typehash.\n                        typeHash := ternary(\n                            eq(treeHeight, 13),\n                            BulkOrder_Typehash_Height_Thirteen,\n                            BulkOrder_Typehash_Height_Fourteen\n                        )\n\n                        // Exit the function once typehash has been located.\n                        leave\n                    }\n                    // Handle height fifteen and sixteen via branchless logic.\n                    typeHash := ternary(\n                        eq(treeHeight, 15),\n                        BulkOrder_Typehash_Height_Fifteen,\n                        BulkOrder_Typehash_Height_Sixteen\n                    )\n\n                    // Exit the function once typehash has been located.\n                    leave\n                }\n\n                // Handle tree height seventeen through twenty.\n                if lt(treeHeight, 21) {\n                    // Handle tree height seventeen and eighteen.\n                    if lt(treeHeight, 19) {\n                        // Utilize branchless logic to determine typehash.\n                        typeHash := ternary(\n                            eq(treeHeight, 17),\n                            BulkOrder_Typehash_Height_Seventeen,\n                            BulkOrder_Typehash_Height_Eighteen\n                        )\n\n                        // Exit the function once typehash has been located.\n                        leave\n                    }\n\n                    // Handle height nineteen and twenty via branchless logic.\n                    typeHash := ternary(\n                        eq(treeHeight, 19),\n                        BulkOrder_Typehash_Height_Nineteen,\n                        BulkOrder_Typehash_Height_Twenty\n                    )\n\n                    // Exit the function once typehash has been located.\n                    leave\n                }\n\n                // Handle tree height twenty-one and twenty-two.\n                if lt(treeHeight, 23) {\n                    // Utilize branchless logic to determine typehash.\n                    typeHash := ternary(\n                        eq(treeHeight, 21),\n                        BulkOrder_Typehash_Height_TwentyOne,\n                        BulkOrder_Typehash_Height_TwentyTwo\n                    )\n\n                    // Exit the function once typehash has been located.\n                    leave\n                }\n\n                // Handle height twenty-three & twenty-four w/ branchless logic.\n                typeHash := ternary(\n                    eq(treeHeight, 23),\n                    BulkOrder_Typehash_Height_TwentyThree,\n                    BulkOrder_Typehash_Height_TwentyFour\n                )\n\n                // Exit the function once typehash has been located.\n                leave\n            }\n\n            // Implement ternary conditional using branchless logic.\n            function ternary(cond, ifTrue, ifFalse) -> c {\n                c := xor(ifFalse, mul(cond, xor(ifFalse, ifTrue)))\n            }\n\n            // Look up the typehash using the supplied tree height.\n            _typeHash := lookupTypeHash(_treeHeight)\n        }\n    }\n}\n"},"src/lib/CriteriaResolution.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    ItemType,\n    OrderType,\n    Side\n} from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    ConsiderationItem,\n    CriteriaResolver,\n    MemoryPointer,\n    OfferItem,\n    OrderParameters\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    _revertCriteriaNotEnabledForItem,\n    _revertInvalidProof,\n    _revertOrderCriteriaResolverOutOfRange\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    CriteriaResolutionErrors\n} from \"seaport-types/src/interfaces/CriteriaResolutionErrors.sol\";\n\nimport {\n    OneWord,\n    OneWordShift,\n    OrderParameters_consideration_head_offset,\n    Selector_length,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    ConsiderationCriteriaResolverOutOfRange_err_selector,\n    Error_selector_offset,\n    OfferCriteriaResolverOutOfRange_error_selector,\n    UnresolvedConsiderationCriteria_error_itemIndex_ptr,\n    UnresolvedConsiderationCriteria_error_length,\n    UnresolvedConsiderationCriteria_error_orderIndex_ptr,\n    UnresolvedConsiderationCriteria_error_selector,\n    UnresolvedOfferCriteria_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title CriteriaResolution\n * @author 0age\n * @notice CriteriaResolution contains a collection of pure functions related to\n *         resolving criteria-based items.\n */\ncontract CriteriaResolution is CriteriaResolutionErrors {\n    /**\n     * @dev Internal pure function to apply criteria resolvers containing\n     *      specific token identifiers and associated proofs to order items.\n     *\n     * @param advancedOrders     The orders to apply criteria resolvers to.\n     * @param criteriaResolvers  An array where each element contains a\n     *                           reference to a specific order as well as that\n     *                           order's offer or consideration, a token\n     *                           identifier, and a proof that the supplied token\n     *                           identifier is contained in the order's merkle\n     *                           root. Note that a root of zero indicates that\n     *                           any transferable token identifier is valid and\n     *                           that no proof needs to be supplied.\n     */\n    function _applyCriteriaResolvers(\n        AdvancedOrder[] memory advancedOrders,\n        CriteriaResolver[] memory criteriaResolvers\n    ) internal pure {\n        // Skip overflow checks as all for loops are indexed starting at zero.\n        unchecked {\n            // Retrieve length of criteria resolvers array and place on stack.\n            uint256 totalCriteriaResolvers = criteriaResolvers.length;\n\n            // Retrieve length of orders array and place on stack.\n            uint256 totalAdvancedOrders = advancedOrders.length;\n\n            // Iterate over each criteria resolver.\n            for (uint256 i = 0; i < totalCriteriaResolvers; ++i) {\n                // Retrieve the criteria resolver.\n                CriteriaResolver memory criteriaResolver = (\n                    criteriaResolvers[i]\n                );\n\n                // Read the order index from memory and place it on the stack.\n                uint256 orderIndex = criteriaResolver.orderIndex;\n\n                // Ensure that the order index is in range.\n                if (orderIndex >= totalAdvancedOrders) {\n                    _revertOrderCriteriaResolverOutOfRange(\n                        criteriaResolver.side\n                    );\n                }\n\n                // Retrieve the referenced advanced order.\n                AdvancedOrder memory advancedOrder = advancedOrders[orderIndex];\n\n                // Skip criteria resolution for order if not fulfilled.\n                if (advancedOrder.numerator == 0) {\n                    continue;\n                }\n\n                // Retrieve the parameters for the order.\n                OrderParameters memory orderParameters = (\n                    advancedOrder.parameters\n                );\n\n                {\n                    // Get a pointer to the list of items to give to\n                    // _updateCriteriaItem. If the resolver refers to a\n                    // consideration item, this array pointer will be replaced\n                    // with the consideration array.\n                    OfferItem[] memory items = orderParameters.offer;\n\n                    // Read component index from memory and place it on stack.\n                    uint256 componentIndex = criteriaResolver.index;\n\n                    // Get error selector for `OfferCriteriaResolverOutOfRange`.\n                    uint256 errorSelector = (\n                        OfferCriteriaResolverOutOfRange_error_selector\n                    );\n\n                    // If the resolver refers to a consideration item...\n                    if (criteriaResolver.side != Side.OFFER) {\n                        // Get the pointer to `orderParameters.consideration`\n                        // Using the array directly has a significant impact on\n                        // the optimized compiler output.\n                        MemoryPointer considerationPtr = orderParameters\n                            .toMemoryPointer()\n                            .pptrOffset(\n                                OrderParameters_consideration_head_offset\n                            );\n\n                        // Replace the items pointer with a pointer to the\n                        // consideration array.\n                        assembly {\n                            items := considerationPtr\n                        }\n\n                        // Replace the error selector with the selector for\n                        // `ConsiderationCriteriaResolverOutOfRange`.\n                        errorSelector = (\n                            ConsiderationCriteriaResolverOutOfRange_err_selector\n                        );\n                    }\n\n                    // Ensure that the component index is in range.\n                    if (componentIndex >= items.length) {\n                        assembly {\n                            // Revert with either\n                            // `OfferCriteriaResolverOutOfRange()` or\n                            // `ConsiderationCriteriaResolverOutOfRange()`,\n                            // depending on whether the resolver refers to a\n                            // consideration item.\n                            mstore(0, errorSelector)\n                            // revert(abi.encodeWithSignature(\n                            //    \"OfferCriteriaResolverOutOfRange()\"\n                            // ))\n                            // or\n                            // revert(abi.encodeWithSignature(\n                            //    \"ConsiderationCriteriaResolverOutOfRange()\"\n                            // ))\n                            revert(Error_selector_offset, Selector_length)\n                        }\n                    }\n\n                    // Apply the criteria resolver to the item in question.\n                    _updateCriteriaItem(\n                        items,\n                        componentIndex,\n                        criteriaResolver\n                    );\n                }\n            }\n\n            // Iterate over each advanced order.\n            for (uint256 i = 0; i < totalAdvancedOrders; ++i) {\n                // Retrieve the advanced order.\n                AdvancedOrder memory advancedOrder = advancedOrders[i];\n\n                // Skip criteria resolution for order if not fulfilled.\n                if (advancedOrder.numerator == 0) {\n                    continue;\n                }\n\n                // Retrieve the parameters for the order.\n                OrderParameters memory orderParameters = (\n                    advancedOrder.parameters\n                );\n\n                OrderType orderType = orderParameters.orderType;\n\n                _ensureAllRequiredCriteriaResolved(\n                    i,\n                    orderParameters.consideration,\n                    orderType,\n                    UnresolvedConsiderationCriteria_error_selector\n                );\n\n                _toOfferItemArgumentType(_ensureAllRequiredCriteriaResolved)(\n                    i,\n                    orderParameters.offer,\n                    orderType,\n                    UnresolvedOfferCriteria_error_selector\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal pure function to examine an array of items and ensure that\n     *      all criteria-based items (with the exception of wildcard items on\n     *      contract orders) have had a criteria resolver successfully applied.\n     *\n     * @param orderIndex     The index of the order being examined.\n     * @param items          The items to examine. These are consideration items\n     *                       in the default case, but offer items are also\n     *                       casted to consideration items as required.\n     * @param orderType      The type of order being examined.\n     * @param revertSelector The selector to use when reverting.\n     */\n    function _ensureAllRequiredCriteriaResolved(\n        uint256 orderIndex,\n        ConsiderationItem[] memory items,\n        OrderType orderType,\n        uint256 revertSelector\n    ) internal pure {\n        // Read items array length from memory and place on stack.\n        uint256 totalItems = items.length;\n\n        // Iterate over each item on the order.\n        for (uint256 i = 0; i < totalItems; ++i) {\n            ConsiderationItem memory item = items[i];\n\n            // Revert if the item is still a criteria item unless the\n            // order is a contract order and the identifier is 0.\n            ItemType itemType = item.itemType;\n            uint256 identifierOrCriteria = item.identifierOrCriteria;\n\n            assembly {\n                if and(\n                    gt(itemType, 3), // Criteria-based item\n                    or(\n                        iszero(eq(orderType, 4)), // not OrderType.CONTRACT\n                        iszero(iszero(identifierOrCriteria)) // not wildcard\n                    )\n                ) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, revertSelector)\n\n                    // Store arguments.\n                    mstore(\n                        UnresolvedConsiderationCriteria_error_orderIndex_ptr,\n                        orderIndex\n                    )\n                    mstore(\n                        UnresolvedConsiderationCriteria_error_itemIndex_ptr,\n                        i\n                    )\n\n                    // Revert with appropriate UnresolvedCriteria error message.\n                    // Unresolved[Offer|Consideration]Criteria(uint256, uint256)\n                    revert(\n                        Error_selector_offset,\n                        UnresolvedConsiderationCriteria_error_length\n                    )\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Internal pure function to perform a function cast from a function\n     *      that accepts consideration items to a function that accepts offer\n     *      items, used by _ensureAllRequiredCriteriaResolved to ensure that\n     *      all necessary criteria items have been resolved for an order.\n     *\n     * @param inFn  The function that accepts consideration items.\n     * @param outFn The function that accepts offer items.\n     */\n    function _toOfferItemArgumentType(\n        function(uint256, ConsiderationItem[] memory, OrderType, uint256)\n            internal\n            pure inFn\n    )\n        internal\n        pure\n        returns (\n            function(uint256, OfferItem[] memory, OrderType, uint256)\n                internal\n                pure outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Internal pure function to update a criteria item.\n     *\n     * @param offer             The offer containing the item to update.\n     * @param componentIndex    The index of the item to update.\n     * @param criteriaResolver  The criteria resolver to use to update the item.\n     */\n    function _updateCriteriaItem(\n        OfferItem[] memory offer,\n        uint256 componentIndex,\n        CriteriaResolver memory criteriaResolver\n    ) internal pure {\n        // Retrieve relevant item using the component index.\n        OfferItem memory offerItem = offer[componentIndex];\n\n        // Read item type and criteria from memory & place on stack.\n        ItemType itemType = offerItem.itemType;\n\n        // Ensure the specified item type indicates criteria usage.\n        if (!_isItemWithCriteria(itemType)) {\n            _revertCriteriaNotEnabledForItem();\n        }\n\n        uint256 identifierOrCriteria = offerItem.identifierOrCriteria;\n\n        // If criteria is not 0 (i.e. a collection-wide criteria-based item)...\n        if (identifierOrCriteria != uint256(0)) {\n            // Verify identifier inclusion in criteria root using proof.\n            _verifyProof(\n                criteriaResolver.identifier,\n                identifierOrCriteria,\n                criteriaResolver.criteriaProof\n            );\n        } else if (criteriaResolver.criteriaProof.length != 0) {\n            // Revert if non-empty proof is supplied for a collection-wide item.\n            _revertInvalidProof();\n        }\n\n        // Update item type to remove criteria usage.\n        // Use assembly to operate on ItemType enum as a number.\n        ItemType newItemType;\n        assembly {\n            // Item type 4 becomes 2 and item type 5 becomes 3.\n            newItemType := sub(itemType, 2)\n        }\n        offerItem.itemType = newItemType;\n\n        // Update identifier w/ supplied identifier.\n        offerItem.identifierOrCriteria = criteriaResolver.identifier;\n    }\n\n    /**\n     * @dev Internal pure function to check whether a given item type represents\n     *      a criteria-based ERC721 or ERC1155 item (e.g. an item that can be\n     *      resolved to one of a number of different identifiers at the time of\n     *      order fulfillment).\n     *\n     * @param itemType The item type in question.\n     *\n     * @return withCriteria A boolean indicating that the item type in question\n     *                      represents a criteria-based item.\n     */\n    function _isItemWithCriteria(\n        ItemType itemType\n    ) internal pure returns (bool withCriteria) {\n        // ERC721WithCriteria is ItemType 4. ERC1155WithCriteria is ItemType 5.\n        assembly {\n            withCriteria := gt(itemType, 3)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to ensure that a given element is contained\n     *      in a merkle root via a supplied proof.\n     *\n     * @param leaf  The element for which to prove inclusion.\n     * @param root  The merkle root that inclusion will be proved against.\n     * @param proof The merkle proof.\n     */\n    function _verifyProof(\n        uint256 leaf,\n        uint256 root,\n        bytes32[] memory proof\n    ) internal pure {\n        // Declare a variable that will be used to determine proof validity.\n        bool isValid;\n\n        // Utilize assembly to efficiently verify the proof against the root.\n        assembly {\n            // Store the leaf at the beginning of scratch space.\n            mstore(0, leaf)\n\n            // Derive the hash of the leaf to use as the initial proof element.\n            let computedHash := keccak256(0, OneWord)\n\n            // Get memory start location of the first element in proof array.\n            let data := add(proof, OneWord)\n\n            // Iterate over each proof element to compute the root hash.\n            for {\n                // Left shift by 5 is equivalent to multiplying by 0x20.\n                let end := add(data, shl(OneWordShift, mload(proof)))\n            } lt(data, end) {\n                // Increment by one word at a time.\n                data := add(data, OneWord)\n            } {\n                // Get the proof element.\n                let loadedData := mload(data)\n\n                // Sort proof elements and place them in scratch space.\n                // Slot of `computedHash` in scratch space.\n                // If the condition is true: 0x20, otherwise: 0x00.\n                let scratch := shl(OneWordShift, gt(computedHash, loadedData))\n\n                // Store elements to hash contiguously in scratch space. Scratch\n                // space is 64 bytes (0x00 - 0x3f) & both elements are 32 bytes.\n                mstore(scratch, computedHash)\n                mstore(xor(scratch, OneWord), loadedData)\n\n                // Derive the updated hash.\n                computedHash := keccak256(0, TwoWords)\n            }\n\n            // Compare the final hash to the supplied root.\n            isValid := eq(computedHash, root)\n        }\n\n        // Revert if computed hash does not equal supplied root.\n        if (!isValid) {\n            _revertInvalidProof();\n        }\n    }\n}\n"},"src/lib/FulfillmentApplier.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport { ItemType, Side } from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    AdvancedOrder,\n    Execution,\n    FulfillmentComponent,\n    ReceivedItem\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    _revertMissingFulfillmentComponentOnAggregation\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    FulfillmentApplicationErrors\n} from \"seaport-types/src/interfaces/FulfillmentApplicationErrors.sol\";\n\nimport {\n    AdvancedOrder_numerator_offset,\n    Common_amount_offset,\n    Common_identifier_offset,\n    Common_token_offset,\n    Execution_conduit_offset,\n    Execution_offerer_offset,\n    Fulfillment_itemIndex_offset,\n    OneWord,\n    OneWordShift,\n    OrderParameters_conduit_offset,\n    OrderParameters_consideration_head_offset,\n    OrderParameters_offer_head_offset,\n    ReceivedItem_CommonParams_size,\n    ReceivedItem_recipient_offset,\n    ReceivedItem_size\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    InvalidFulfillmentComponentData_error_length,\n    InvalidFulfillmentComponentData_error_selector,\n    MismatchedOfferAndConsiderationComponents_error_idx_ptr,\n    MismatchedOfferAndConsiderationComponents_error_length,\n    MismatchedOfferAndConsiderationComponents_error_selector,\n    MissingItemAmount_error_length,\n    MissingItemAmount_error_selector,\n    OfferAndConsiderationRequiredOnFulfillment_error_length,\n    OfferAndConsiderationRequiredOnFulfillment_error_selector,\n    Panic_arithmetic,\n    Panic_error_code_ptr,\n    Panic_error_length,\n    Panic_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title FulfillmentApplier\n * @author 0age\n * @notice FulfillmentApplier contains logic related to applying fulfillments,\n *         both as part of order matching (where offer items are matched to\n *         consideration items) as well as fulfilling available orders (where\n *         order items and consideration items are independently aggregated).\n */\ncontract FulfillmentApplier is FulfillmentApplicationErrors {\n    /**\n     * @dev Internal pure function to match offer items to consideration items\n     *      on a group of orders via a supplied fulfillment.\n     *\n     * @param advancedOrders          The orders to match.\n     * @param offerComponents         An array designating offer components to\n     *                                match to consideration components.\n     * @param considerationComponents An array designating consideration\n     *                                components to match to offer components.\n     *                                Note that each consideration amount must\n     *                                be zero in order for the match operation\n     *                                to be valid.\n     * @param fulfillmentIndex        The index of the fulfillment being\n     *                                applied.\n     *\n     * @return execution The transfer performed as a result of the fulfillment.\n     */\n    function _applyFulfillment(\n        AdvancedOrder[] memory advancedOrders,\n        FulfillmentComponent[] memory offerComponents,\n        FulfillmentComponent[] memory considerationComponents,\n        uint256 fulfillmentIndex\n    ) internal pure returns (Execution memory execution) {\n        // Ensure 1+ of both offer and consideration components are supplied.\n        assembly {\n            if or(\n                iszero(mload(offerComponents)),\n                iszero(mload(considerationComponents))\n            ) {\n                // Store left-padded selector with push4 (reduces bytecode),\n                // mem[28:32] = selector\n                mstore(\n                    0,\n                    OfferAndConsiderationRequiredOnFulfillment_error_selector\n                )\n\n                // revert(abi.encodeWithSignature(\n                //     \"OfferAndConsiderationRequiredOnFulfillment()\"\n                // ))\n                revert(\n                    Error_selector_offset,\n                    OfferAndConsiderationRequiredOnFulfillment_error_length\n                )\n            }\n        }\n\n        // Declare a new Execution struct.\n        Execution memory considerationExecution;\n\n        // Validate & aggregate consideration items to new Execution object.\n        _aggregateValidFulfillmentConsiderationItems(\n            advancedOrders,\n            considerationComponents,\n            considerationExecution,\n            address(0),\n            bytes32(0)\n        );\n\n        // Retrieve the consideration item from the execution struct.\n        ReceivedItem memory considerationItem = considerationExecution.item;\n\n        // Skip aggregating offer items if no consideration items are available.\n        if (considerationItem.amount == 0) {\n            return considerationExecution;\n        }\n\n        // Validate & aggregate offer items to Execution object.\n        _aggregateValidFulfillmentOfferItems(\n            advancedOrders,\n            offerComponents,\n            execution,\n            considerationItem.recipient\n        );\n\n        ReceivedItem memory executionItem = execution.item;\n\n        // Ensure offer & consideration item types, tokens, & identifiers match.\n        // (a != b || c != d || e != f) == (((a ^ b) | (c ^ d) | (e ^ f)) != 0),\n        // but the second expression requires less gas to evaluate.\n        assembly {\n            if or(\n                or(\n                    xor(\n                        mload(executionItem), // no offset for item type\n                        mload(considerationItem) // no offset for item type\n                    ),\n                    xor(\n                        mload(add(executionItem, Common_token_offset)),\n                        mload(add(considerationItem, Common_token_offset))\n                    )\n                ),\n                xor(\n                    mload(add(executionItem, Common_identifier_offset)),\n                    mload(add(considerationItem, Common_identifier_offset))\n                )\n            ) {\n                // Store left-padded selector with push4 (reduces bytecode),\n                // mem[28:32] = selector\n                mstore(\n                    0,\n                    MismatchedOfferAndConsiderationComponents_error_selector\n                )\n\n                // Store fulfillment index argument.\n                mstore(\n                    MismatchedOfferAndConsiderationComponents_error_idx_ptr,\n                    fulfillmentIndex\n                )\n\n                // Revert: `MismatchedOfferAndConsiderationComponents(uint256)`\n                revert(\n                    Error_selector_offset,\n                    MismatchedOfferAndConsiderationComponents_error_length\n                )\n            }\n        }\n\n        // If total consideration amount exceeds the offer amount...\n        if (considerationItem.amount > executionItem.amount) {\n            // Retrieve the first consideration component from the fulfillment.\n            FulfillmentComponent memory targetComponent = (\n                considerationComponents[0]\n            );\n\n            // Skip underflow check as the conditional being true implies that\n            // considerationItem.amount > execution.item.amount.\n            unchecked {\n                // Add excess consideration item amount to original order array.\n                advancedOrders[targetComponent.orderIndex]\n                    .parameters\n                    .consideration[targetComponent.itemIndex]\n                    .startAmount = (considerationItem.amount -\n                    executionItem.amount);\n            }\n        } else {\n            // Retrieve the first offer component from the fulfillment.\n            FulfillmentComponent memory targetComponent = offerComponents[0];\n\n            // Skip underflow check as the conditional being false implies that\n            // execution.item.amount >= considerationItem.amount.\n            unchecked {\n                // Add excess offer item amount to the original array of orders.\n                advancedOrders[targetComponent.orderIndex]\n                    .parameters\n                    .offer[targetComponent.itemIndex]\n                    .startAmount = (executionItem.amount -\n                    considerationItem.amount);\n            }\n\n            // Reduce total offer amount to equal the consideration amount.\n            executionItem.amount = considerationItem.amount;\n        }\n\n        // Return the final execution that will be triggered for relevant items.\n        return execution; // Execution(executionItem, offerer, conduitKey);\n    }\n\n    /**\n     * @dev Internal view function to aggregate offer or consideration items\n     *      from a group of orders into a single execution via a supplied array\n     *      of fulfillment components. Items that are not available to aggregate\n     *      will not be included in the aggregated execution.\n     *\n     * @param advancedOrders        The orders to aggregate.\n     * @param side                  The side (i.e. offer or consideration).\n     * @param fulfillmentComponents An array designating item components to\n     *                              aggregate if part of an available order.\n     * @param fulfillerConduitKey   A bytes32 value indicating what conduit, if\n     *                              any, to source the fulfiller's token\n     *                              approvals from. The zero hash signifies that\n     *                              no conduit should be used, with approvals\n     *                              set directly on this contract.\n     * @param recipient             The intended recipient for all received\n     *                              items.\n     *\n     * @return execution The transfer performed as a result of the fulfillment.\n     */\n    function _aggregateAvailable(\n        AdvancedOrder[] memory advancedOrders,\n        Side side,\n        FulfillmentComponent[] memory fulfillmentComponents,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) internal view returns (Execution memory execution) {\n        // Skip overflow / underflow checks; conditions checked or unreachable.\n        unchecked {\n            // Retrieve fulfillment components array length and place on stack.\n            // Ensure at least one fulfillment component has been supplied.\n            if (fulfillmentComponents.length == 0) {\n                _revertMissingFulfillmentComponentOnAggregation(side);\n            }\n\n            // If the fulfillment components are offer components...\n            if (side == Side.OFFER) {\n                // Return execution for aggregated items provided by offerer.\n                _aggregateValidFulfillmentOfferItems(\n                    advancedOrders,\n                    fulfillmentComponents,\n                    execution,\n                    payable(recipient)\n                );\n            } else {\n                // Otherwise, fulfillment components are consideration\n                // components. Return execution for aggregated items provided by\n                // the fulfiller.\n                _aggregateValidFulfillmentConsiderationItems(\n                    advancedOrders,\n                    fulfillmentComponents,\n                    execution,\n                    msg.sender,\n                    fulfillerConduitKey\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal pure function to aggregate a group of offer items using\n     *      supplied directives on which component items are candidates for\n     *      aggregation, skipping items on orders that are not available.\n     *\n     * @param advancedOrders  The orders to aggregate offer items from.\n     * @param offerComponents An array of FulfillmentComponent structs\n     *                        indicating the order index and item index of each\n     *                        candidate offer item for aggregation.\n     * @param execution       The execution to apply the aggregation to.\n     * @param recipient       The intended recipient for the received item.\n     */\n    function _aggregateValidFulfillmentOfferItems(\n        AdvancedOrder[] memory advancedOrders,\n        FulfillmentComponent[] memory offerComponents,\n        Execution memory execution,\n        address payable recipient\n    ) internal pure {\n        assembly {\n            // Declare a variable for the final aggregated item amount.\n            let amount\n\n            // Declare a variable to track errors encountered with amount.\n            let errorBuffer\n\n            // Declare a variable for the hash of itemType, token, & identifier.\n            let dataHash\n\n            // Iterate over each offer component.\n            for {\n                // Create variable to track position in offerComponents head.\n                let fulfillmentHeadPtr := offerComponents\n\n                // Get position of the last element in head of array.\n                let endPtr := add(\n                    offerComponents,\n                    shl(OneWordShift, mload(offerComponents))\n                )\n            } lt(fulfillmentHeadPtr, endPtr) {\n\n            } {\n                // Increment position in considerationComponents head.\n                fulfillmentHeadPtr := add(fulfillmentHeadPtr, OneWord)\n\n                // Ensure that the order index is not out of range.\n                if iszero(\n                    lt(mload(mload(fulfillmentHeadPtr)), mload(advancedOrders))\n                ) {\n                    throwInvalidFulfillmentComponentData()\n                }\n\n                // Read advancedOrders[orderIndex] pointer from its array head.\n                let orderPtr := mload(\n                    // Calculate head position of advancedOrders[orderIndex]\n                    add(\n                        add(advancedOrders, OneWord),\n                        shl(OneWordShift, mload(mload(fulfillmentHeadPtr)))\n                    )\n                )\n\n                // Read the pointer to OrderParameters from the AdvancedOrder.\n                let paramsPtr := mload(orderPtr)\n\n                // Retrieve item index using an offset of fulfillment pointer.\n                let itemIndex := mload(\n                    add(mload(fulfillmentHeadPtr), Fulfillment_itemIndex_offset)\n                )\n\n                let offerItemPtr\n                {\n                    // Load the offer array pointer.\n                    let offerArrPtr := mload(\n                        add(paramsPtr, OrderParameters_offer_head_offset)\n                    )\n\n                    // If the offer item index is out of range or the numerator\n                    // is zero, skip this item.\n                    if or(\n                        iszero(lt(itemIndex, mload(offerArrPtr))),\n                        iszero(\n                            mload(add(orderPtr, AdvancedOrder_numerator_offset))\n                        )\n                    ) {\n                        continue\n                    }\n\n                    // Retrieve offer item pointer using the item index.\n                    offerItemPtr := mload(\n                        add(\n                            // Get pointer to beginning of receivedItem.\n                            add(offerArrPtr, OneWord),\n                            // Calculate offset to pointer for the order.\n                            shl(OneWordShift, itemIndex)\n                        )\n                    )\n                }\n\n                // Declare a separate scope for the amount update.\n                {\n                    // Retrieve amount pointer using consideration item pointer.\n                    let amountPtr := add(offerItemPtr, Common_amount_offset)\n\n                    // Add offer item amount to execution amount.\n                    let newAmount := add(amount, mload(amountPtr))\n\n                    // Update error buffer:\n                    // 1 = zero amount, 2 = overflow, 3 = both.\n                    errorBuffer := or(\n                        errorBuffer,\n                        or(\n                            shl(1, lt(newAmount, amount)),\n                            iszero(mload(amountPtr))\n                        )\n                    )\n\n                    // Update the amount to the new, summed amount.\n                    amount := newAmount\n\n                    // Zero out amount on original item to indicate it is spent.\n                    mstore(amountPtr, 0)\n                }\n\n                // Retrieve ReceivedItem pointer from Execution.\n                let receivedItem := mload(execution)\n\n                // Check if this is the first valid fulfillment item.\n                switch iszero(dataHash)\n                case 1 {\n                    // On first valid item, populate the received item in memory\n                    // for later comparison.\n\n                    // Set the item type on the received item.\n                    mstore(receivedItem, mload(offerItemPtr))\n\n                    // Set the token on the received item.\n                    mstore(\n                        add(receivedItem, Common_token_offset),\n                        mload(add(offerItemPtr, Common_token_offset))\n                    )\n\n                    // Set the identifier on the received item.\n                    mstore(\n                        add(receivedItem, Common_identifier_offset),\n                        mload(add(offerItemPtr, Common_identifier_offset))\n                    )\n\n                    // Set the recipient on the received item.\n                    mstore(\n                        add(receivedItem, ReceivedItem_recipient_offset),\n                        recipient\n                    )\n\n                    // Set offerer on returned execution using order pointer.\n                    mstore(\n                        add(execution, Execution_offerer_offset),\n                        mload(paramsPtr)\n                    )\n\n                    // Set execution conduitKey via order pointer offset.\n                    mstore(\n                        add(execution, Execution_conduit_offset),\n                        mload(add(paramsPtr, OrderParameters_conduit_offset))\n                    )\n\n                    // Calculate the hash of (itemType, token, identifier).\n                    dataHash := keccak256(\n                        receivedItem,\n                        ReceivedItem_CommonParams_size\n                    )\n\n                    // If component index > 0, swap component pointer with\n                    // pointer to first component so that any remainder after\n                    // fulfillment can be added back to the first item.\n                    let firstFulfillmentHeadPtr := add(offerComponents, OneWord)\n                    if xor(firstFulfillmentHeadPtr, fulfillmentHeadPtr) {\n                        let fulfillmentPtr := mload(fulfillmentHeadPtr)\n                        mstore(firstFulfillmentHeadPtr, fulfillmentPtr)\n                    }\n                }\n                default {\n                    // Compare every subsequent item to the first.\n                    if or(\n                        or(\n                            // The offerer must match on both items.\n                            xor(\n                                mload(paramsPtr),\n                                mload(add(execution, Execution_offerer_offset))\n                            ),\n                            // The conduit key must match on both items.\n                            xor(\n                                mload(\n                                    add(\n                                        paramsPtr,\n                                        OrderParameters_conduit_offset\n                                    )\n                                ),\n                                mload(add(execution, Execution_conduit_offset))\n                            )\n                        ),\n                        // The itemType, token, and identifier must match.\n                        xor(\n                            dataHash,\n                            keccak256(\n                                offerItemPtr,\n                                ReceivedItem_CommonParams_size\n                            )\n                        )\n                    ) {\n                        // Throw if any of the requirements are not met.\n                        throwInvalidFulfillmentComponentData()\n                    }\n                }\n            }\n\n            // Write final amount to execution.\n            mstore(add(mload(execution), Common_amount_offset), amount)\n\n            // Determine whether the error buffer contains a nonzero error code.\n            if errorBuffer {\n                // If errorBuffer is 1, an item had an amount of zero.\n                if eq(errorBuffer, 1) {\n                    // Store left-padded selector with push4 (reduces bytecode)\n                    // mem[28:32] = selector\n                    mstore(0, MissingItemAmount_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"MissingItemAmount()\"))\n                    revert(\n                        Error_selector_offset,\n                        MissingItemAmount_error_length\n                    )\n                }\n\n                // If errorBuffer is not 1 or 0, the sum overflowed.\n                // Panic!\n                throwOverflow()\n            }\n\n            // Declare function for reverts on invalid fulfillment data.\n            function throwInvalidFulfillmentComponentData() {\n                // Store left-padded selector (uses push4 and reduces code size)\n                mstore(0, InvalidFulfillmentComponentData_error_selector)\n\n                // revert(abi.encodeWithSignature(\n                //     \"InvalidFulfillmentComponentData()\"\n                // ))\n                revert(\n                    Error_selector_offset,\n                    InvalidFulfillmentComponentData_error_length\n                )\n            }\n\n            // Declare function for reverts due to arithmetic overflows.\n            function throwOverflow() {\n                // Store the Panic error signature.\n                mstore(0, Panic_error_selector)\n                // Store the arithmetic (0x11) panic code.\n                mstore(Panic_error_code_ptr, Panic_arithmetic)\n                // revert(abi.encodeWithSignature(\"Panic(uint256)\", 0x11))\n                revert(Error_selector_offset, Panic_error_length)\n            }\n        }\n    }\n\n    /**\n     * @dev Internal pure function to aggregate a group of consideration items\n     *      using supplied directives on which component items are candidates\n     *      for aggregation, skipping items on orders that are not available.\n     *      Note that this function depends on memory layout affected by an\n     *      earlier call to _validateOrdersAndPrepareToFulfill. The memory for\n     *      the consideration arrays needs to be updated before calling\n     *      _aggregateValidFulfillmentConsiderationItems.\n     *      _validateOrdersAndPrepareToFulfill is called in _matchAdvancedOrders\n     *      and _fulfillAvailableAdvancedOrders in the current version.\n     *\n     * @param advancedOrders          The orders to aggregate consideration\n     *                                items from.\n     * @param considerationComponents An array of FulfillmentComponent structs\n     *                                indicating the order index and item index\n     *                                of each candidate consideration item for\n     *                                aggregation.\n     * @param execution               The execution to apply the aggregation to.\n     * @param offerer                 The address of the offerer to set on the\n     *                                execution.\n     * @param conduitKey              A bytes32 value indicating the conduit key\n     *                                to set on the execution.\n     */\n    function _aggregateValidFulfillmentConsiderationItems(\n        AdvancedOrder[] memory advancedOrders,\n        FulfillmentComponent[] memory considerationComponents,\n        Execution memory execution,\n        address offerer,\n        bytes32 conduitKey\n    ) internal pure {\n        // Utilize assembly in order to efficiently aggregate the items.\n        assembly {\n            // Declare a variable for the final aggregated item amount.\n            let amount\n\n            // Create variable to track errors encountered with amount.\n            let errorBuffer\n\n            // Declare variable for hash(itemType, token, identifier, recipient)\n            let dataHash\n\n            // Iterate over each consideration component.\n            for {\n                // Track position in considerationComponents head.\n                let fulfillmentHeadPtr := considerationComponents\n\n                // Get position of the last element in head of array.\n                let endPtr := add(\n                    considerationComponents,\n                    shl(OneWordShift, mload(considerationComponents))\n                )\n            } lt(fulfillmentHeadPtr, endPtr) {\n\n            } {\n                // Increment position in considerationComponents head.\n                fulfillmentHeadPtr := add(fulfillmentHeadPtr, OneWord)\n\n                // Retrieve the order index using the fulfillment pointer.\n                let orderIndex := mload(mload(fulfillmentHeadPtr))\n\n                // Ensure that the order index is not out of range.\n                if iszero(lt(orderIndex, mload(advancedOrders))) {\n                    throwInvalidFulfillmentComponentData()\n                }\n\n                // Read advancedOrders[orderIndex] pointer from its array head.\n                let orderPtr := mload(\n                    // Derive head position of advancedOrders[orderIndex].\n                    add(\n                        add(advancedOrders, OneWord),\n                        shl(OneWordShift, orderIndex)\n                    )\n                )\n\n                // Retrieve item index using an offset of fulfillment pointer.\n                let itemIndex := mload(\n                    add(mload(fulfillmentHeadPtr), Fulfillment_itemIndex_offset)\n                )\n\n                let considerationItemPtr\n                {\n                    // Load consideration array pointer.\n                    let considerationArrPtr := mload(\n                        add(\n                            // Read OrderParameters pointer from the order.\n                            mload(orderPtr),\n                            OrderParameters_consideration_head_offset\n                        )\n                    )\n\n                    // If the consideration item index is out of range or the\n                    // numerator is zero, skip this item.\n                    if or(\n                        iszero(lt(itemIndex, mload(considerationArrPtr))),\n                        iszero(\n                            mload(add(orderPtr, AdvancedOrder_numerator_offset))\n                        )\n                    ) {\n                        continue\n                    }\n\n                    // Retrieve consideration item pointer using the item index.\n                    considerationItemPtr := mload(\n                        add(\n                            // Get pointer to beginning of receivedItem.\n                            add(considerationArrPtr, OneWord),\n                            // Calculate offset to pointer for the order.\n                            shl(OneWordShift, itemIndex)\n                        )\n                    )\n                }\n\n                // Declare a separate scope for the amount update.\n                {\n                    // Retrieve amount pointer using consideration item pointer.\n                    let amountPtr := add(\n                        considerationItemPtr,\n                        Common_amount_offset\n                    )\n\n                    // Add consideration item amount to execution amount.\n                    let newAmount := add(amount, mload(amountPtr))\n\n                    // Update error buffer:\n                    // 1 = zero amount, 2 = overflow, 3 = both.\n                    errorBuffer := or(\n                        errorBuffer,\n                        or(\n                            shl(1, lt(newAmount, amount)),\n                            iszero(mload(amountPtr))\n                        )\n                    )\n\n                    // Update the amount to the new, summed amount.\n                    amount := newAmount\n\n                    // Zero out original item amount to indicate it is credited.\n                    mstore(amountPtr, 0)\n                }\n\n                // Retrieve ReceivedItem pointer from Execution.\n                let receivedItem := mload(execution)\n\n                switch iszero(dataHash)\n                case 1 {\n                    // On first valid item, populate the received item in\n                    // memory for later comparison.\n\n                    // Set the item type on the received item.\n                    mstore(receivedItem, mload(considerationItemPtr))\n\n                    // Set the token on the received item.\n                    mstore(\n                        add(receivedItem, Common_token_offset),\n                        mload(add(considerationItemPtr, Common_token_offset))\n                    )\n\n                    // Set the identifier on the received item.\n                    mstore(\n                        add(receivedItem, Common_identifier_offset),\n                        mload(\n                            add(considerationItemPtr, Common_identifier_offset)\n                        )\n                    )\n\n                    // Set the recipient on the received item. Note that this\n                    // depends on the memory layout established by the\n                    // _validateOrdersAndPrepareToFulfill function.\n                    mstore(\n                        add(receivedItem, ReceivedItem_recipient_offset),\n                        mload(\n                            add(\n                                considerationItemPtr,\n                                ReceivedItem_recipient_offset\n                            )\n                        )\n                    )\n\n                    // Set provided offerer on the execution.\n                    mstore(add(execution, Execution_offerer_offset), offerer)\n\n                    // Set provided conduitKey on the execution.\n                    mstore(add(execution, Execution_conduit_offset), conduitKey)\n\n                    // Calculate the hash of (itemType, token, identifier,\n                    // recipient). This is run after amount is set to zero, so\n                    // there will be one blank word after identifier included in\n                    // the hash buffer.\n                    dataHash := keccak256(\n                        considerationItemPtr,\n                        ReceivedItem_size\n                    )\n\n                    // If component index > 0, swap component pointer with\n                    // pointer to first component so that any remainder after\n                    // fulfillment can be added back to the first item.\n                    let firstFulfillmentHeadPtr := add(\n                        considerationComponents,\n                        OneWord\n                    )\n                    if xor(firstFulfillmentHeadPtr, fulfillmentHeadPtr) {\n                        let fulfillmentPtr := mload(fulfillmentHeadPtr)\n                        mstore(firstFulfillmentHeadPtr, fulfillmentPtr)\n                    }\n                }\n                default {\n                    // Compare every subsequent item to the first; the item\n                    // type, token, identifier and recipient must match.\n                    if xor(\n                        dataHash,\n                        // Calculate the hash of (itemType, token, identifier,\n                        // recipient). This is run after amount is set to zero,\n                        // so there will be one blank word after identifier\n                        // included in the hash buffer.\n                        keccak256(considerationItemPtr, ReceivedItem_size)\n                    ) {\n                        // Throw if any of the requirements are not met.\n                        throwInvalidFulfillmentComponentData()\n                    }\n                }\n            }\n\n            // Retrieve ReceivedItem pointer from Execution.\n            let receivedItem := mload(execution)\n\n            // Write final amount to execution.\n            mstore(add(receivedItem, Common_amount_offset), amount)\n\n            // Determine whether the error buffer contains a nonzero error code.\n            if errorBuffer {\n                // If errorBuffer is 1, an item had an amount of zero.\n                if eq(errorBuffer, 1) {\n                    // Store left-padded selector with push4, mem[28:32]\n                    mstore(0, MissingItemAmount_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"MissingItemAmount()\"))\n                    revert(\n                        Error_selector_offset,\n                        MissingItemAmount_error_length\n                    )\n                }\n\n                // If errorBuffer is not 1 or 0, `amount` overflowed.\n                // Panic!\n                throwOverflow()\n            }\n\n            // Declare function for reverts on invalid fulfillment data.\n            function throwInvalidFulfillmentComponentData() {\n                // Store the InvalidFulfillmentComponentData error signature.\n                mstore(0, InvalidFulfillmentComponentData_error_selector)\n\n                // revert(abi.encodeWithSignature(\n                //     \"InvalidFulfillmentComponentData()\"\n                // ))\n                revert(\n                    Error_selector_offset,\n                    InvalidFulfillmentComponentData_error_length\n                )\n            }\n\n            // Declare function for reverts due to arithmetic overflows.\n            function throwOverflow() {\n                // Store the Panic error signature.\n                mstore(0, Panic_error_selector)\n                // Store the arithmetic (0x11) panic code.\n                mstore(Panic_error_code_ptr, Panic_arithmetic)\n                // revert(abi.encodeWithSignature(\"Panic(uint256)\", 0x11))\n                revert(Error_selector_offset, Panic_error_length)\n            }\n        }\n    }\n}\n"},"src/lib/GettersAndDerivers.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    OrderParameters\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { ConsiderationBase } from \"./ConsiderationBase.sol\";\n\nimport {\n    Create2AddressDerivation_length,\n    Create2AddressDerivation_ptr,\n    EIP_712_PREFIX,\n    EIP712_ConsiderationItem_size,\n    EIP712_DigestPayload_size,\n    EIP712_DomainSeparator_offset,\n    EIP712_OfferItem_size,\n    EIP712_Order_size,\n    EIP712_OrderHash_offset,\n    FreeMemoryPointerSlot,\n    information_conduitController_offset,\n    information_domainSeparator_offset,\n    information_length,\n    information_version_cd_offset,\n    information_version_offset,\n    information_versionLengthPtr,\n    information_versionWithLength,\n    MaskOverByteTwelve,\n    MaskOverLastTwentyBytes,\n    OneWord,\n    OneWordShift,\n    OrderParameters_consideration_head_offset,\n    OrderParameters_counter_offset,\n    OrderParameters_offer_head_offset,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\n/**\n * @title GettersAndDerivers\n * @author 0age\n * @notice ConsiderationInternal contains pure and internal view functions\n *         related to getting or deriving various values.\n */\ncontract GettersAndDerivers is ConsiderationBase {\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(\n        address conduitController\n    ) ConsiderationBase(conduitController) {}\n\n    /**\n     * @dev Internal view function to derive the order hash for a given order.\n     *      Note that only the original consideration items are included in the\n     *      order hash, as additional consideration items may be supplied by the\n     *      caller.\n     *\n     * @param orderParameters The parameters of the order to hash.\n     * @param counter         The counter of the order to hash.\n     *\n     * @return orderHash The hash.\n     */\n    function _deriveOrderHash(\n        OrderParameters memory orderParameters,\n        uint256 counter\n    ) internal view returns (bytes32 orderHash) {\n        // Get length of original consideration array and place it on the stack.\n        uint256 originalConsiderationLength = (\n            orderParameters.totalOriginalConsiderationItems\n        );\n\n        /*\n         * Memory layout for an array of structs (dynamic or not) is similar\n         * to ABI encoding of dynamic types, with a head segment followed by\n         * a data segment. The main difference is that the head of an element\n         * is a memory pointer rather than an offset.\n         */\n\n        // Declare a variable for the derived hash of the offer array.\n        bytes32 offerHash;\n\n        // Read offer item EIP-712 typehash from runtime code & place on stack.\n        bytes32 typeHash = _OFFER_ITEM_TYPEHASH;\n\n        // Utilize assembly so that memory regions can be reused across hashes.\n        assembly {\n            // Retrieve the free memory pointer and place on the stack.\n            let hashArrPtr := mload(FreeMemoryPointerSlot)\n\n            // Get the pointer to the offers array.\n            let offerArrPtr := mload(\n                add(orderParameters, OrderParameters_offer_head_offset)\n            )\n\n            // Load the length.\n            let offerLength := mload(offerArrPtr)\n\n            // Set the pointer to the first offer's head.\n            offerArrPtr := add(offerArrPtr, OneWord)\n\n            // Iterate over the offer items.\n            for {\n                let i := 0\n            } lt(i, offerLength) {\n                i := add(i, 1)\n            } {\n                // Read the pointer to the offer data and subtract one word\n                // to get typeHash pointer.\n                let ptr := sub(mload(offerArrPtr), OneWord)\n\n                // Read the current value before the offer data.\n                let value := mload(ptr)\n\n                // Write the type hash to the previous word.\n                mstore(ptr, typeHash)\n\n                // Take the EIP712 hash and store it in the hash array.\n                mstore(hashArrPtr, keccak256(ptr, EIP712_OfferItem_size))\n\n                // Restore the previous word.\n                mstore(ptr, value)\n\n                // Increment the array pointers by one word.\n                offerArrPtr := add(offerArrPtr, OneWord)\n                hashArrPtr := add(hashArrPtr, OneWord)\n            }\n\n            // Derive the offer hash using the hashes of each item.\n            offerHash := keccak256(\n                mload(FreeMemoryPointerSlot),\n                shl(OneWordShift, offerLength)\n            )\n        }\n\n        // Declare a variable for the derived hash of the consideration array.\n        bytes32 considerationHash;\n\n        // Read consideration item typehash from runtime code & place on stack.\n        typeHash = _CONSIDERATION_ITEM_TYPEHASH;\n\n        // Utilize assembly so that memory regions can be reused across hashes.\n        assembly {\n            // Retrieve the free memory pointer and place on the stack.\n            let hashArrPtr := mload(FreeMemoryPointerSlot)\n\n            // Get the pointer to the consideration array.\n            let considerationArrPtr := add(\n                mload(\n                    add(\n                        orderParameters,\n                        OrderParameters_consideration_head_offset\n                    )\n                ),\n                OneWord\n            )\n\n            // Iterate over the consideration items (not including tips).\n            for {\n                let i := 0\n            } lt(i, originalConsiderationLength) {\n                i := add(i, 1)\n            } {\n                // Read the pointer to the consideration data and subtract one\n                // word to get typeHash pointer.\n                let ptr := sub(mload(considerationArrPtr), OneWord)\n\n                // Read the current value before the consideration data.\n                let value := mload(ptr)\n\n                // Write the type hash to the previous word.\n                mstore(ptr, typeHash)\n\n                // Take the EIP712 hash and store it in the hash array.\n                mstore(\n                    hashArrPtr,\n                    keccak256(ptr, EIP712_ConsiderationItem_size)\n                )\n\n                // Restore the previous word.\n                mstore(ptr, value)\n\n                // Increment the array pointers by one word.\n                considerationArrPtr := add(considerationArrPtr, OneWord)\n                hashArrPtr := add(hashArrPtr, OneWord)\n            }\n\n            // Derive the consideration hash using the hashes of each item.\n            considerationHash := keccak256(\n                mload(FreeMemoryPointerSlot),\n                shl(OneWordShift, originalConsiderationLength)\n            )\n        }\n\n        // Read order item EIP-712 typehash from runtime code & place on stack.\n        typeHash = _ORDER_TYPEHASH;\n\n        // Utilize assembly to access derived hashes & other arguments directly.\n        assembly {\n            // Retrieve pointer to the region located just behind parameters.\n            let typeHashPtr := sub(orderParameters, OneWord)\n\n            // Store the value at that pointer location to restore later.\n            let previousValue := mload(typeHashPtr)\n\n            // Store the order item EIP-712 typehash at the typehash location.\n            mstore(typeHashPtr, typeHash)\n\n            // Retrieve the pointer for the offer array head.\n            let offerHeadPtr := add(\n                orderParameters,\n                OrderParameters_offer_head_offset\n            )\n\n            // Retrieve the data pointer referenced by the offer head.\n            let offerDataPtr := mload(offerHeadPtr)\n\n            // Store the offer hash at the retrieved memory location.\n            mstore(offerHeadPtr, offerHash)\n\n            // Retrieve the pointer for the consideration array head.\n            let considerationHeadPtr := add(\n                orderParameters,\n                OrderParameters_consideration_head_offset\n            )\n\n            // Retrieve the data pointer referenced by the consideration head.\n            let considerationDataPtr := mload(considerationHeadPtr)\n\n            // Store the consideration hash at the retrieved memory location.\n            mstore(considerationHeadPtr, considerationHash)\n\n            // Retrieve the pointer for the counter.\n            let counterPtr := add(\n                orderParameters,\n                OrderParameters_counter_offset\n            )\n\n            // Store the counter at the retrieved memory location.\n            mstore(counterPtr, counter)\n\n            // Derive the order hash using the full range of order parameters.\n            orderHash := keccak256(typeHashPtr, EIP712_Order_size)\n\n            // Restore the value previously held at typehash pointer location.\n            mstore(typeHashPtr, previousValue)\n\n            // Restore offer data pointer at the offer head pointer location.\n            mstore(offerHeadPtr, offerDataPtr)\n\n            // Restore consideration data pointer at the consideration head ptr.\n            mstore(considerationHeadPtr, considerationDataPtr)\n\n            // Restore consideration item length at the counter pointer.\n            mstore(counterPtr, originalConsiderationLength)\n        }\n    }\n\n    /**\n     * @dev Internal view function to derive the address of a given conduit\n     *      using a corresponding conduit key.\n     *\n     * @param conduitKey A bytes32 value indicating what corresponding conduit,\n     *                   if any, to source token approvals from. This value is\n     *                   the \"salt\" parameter supplied by the deployer (i.e. the\n     *                   conduit controller) when deploying the given conduit.\n     *\n     * @return conduit The address of the conduit associated with the given\n     *                 conduit key.\n     */\n    function _deriveConduit(\n        bytes32 conduitKey\n    ) internal view returns (address conduit) {\n        // Read conduit controller address from runtime and place on the stack.\n        address conduitController = address(_CONDUIT_CONTROLLER);\n\n        // Read conduit creation code hash from runtime and place on the stack.\n        bytes32 conduitCreationCodeHash = _CONDUIT_CREATION_CODE_HASH;\n\n        // Leverage scratch space to perform an efficient hash.\n        assembly {\n            // Retrieve the free memory pointer; it will be replaced afterwards.\n            let freeMemoryPointer := mload(FreeMemoryPointerSlot)\n\n            // Place the control character and the conduit controller in scratch\n            // space; note that eleven bytes at the beginning are left unused.\n            mstore(0, or(MaskOverByteTwelve, conduitController))\n\n            // Place the conduit key in the next region of scratch space.\n            mstore(OneWord, conduitKey)\n\n            // Place conduit creation code hash in free memory pointer location.\n            mstore(TwoWords, conduitCreationCodeHash)\n\n            // Derive conduit by hashing and applying a mask over last 20 bytes.\n            conduit := and(\n                // Hash the relevant region.\n                keccak256(\n                    // The region starts at memory pointer 11.\n                    Create2AddressDerivation_ptr,\n                    // The region is 85 bytes long (1 + 20 + 32 + 32).\n                    Create2AddressDerivation_length\n                ),\n                // The address equals the last twenty bytes of the hash.\n                MaskOverLastTwentyBytes\n            )\n\n            // Restore the free memory pointer.\n            mstore(FreeMemoryPointerSlot, freeMemoryPointer)\n        }\n    }\n\n    /**\n     * @dev Internal view function to get the EIP-712 domain separator. If the\n     *      chainId matches the chainId set on deployment, the cached domain\n     *      separator will be returned; otherwise, it will be derived from\n     *      scratch.\n     *\n     * @return The domain separator.\n     */\n    function _domainSeparator() internal view returns (bytes32) {\n        return\n            block.chainid == _CHAIN_ID\n                ? _DOMAIN_SEPARATOR\n                : _deriveDomainSeparator();\n    }\n\n    /**\n     * @dev Internal view function to retrieve configuration information for\n     *      this contract.\n     *\n     * @return The contract version.\n     * @return The domain separator for this contract.\n     * @return The conduit Controller set for this contract.\n     */\n    function _information()\n        internal\n        view\n        returns (\n            string memory /* version */,\n            bytes32 /* domainSeparator */,\n            address /* conduitController */\n        )\n    {\n        // Derive the domain separator.\n        bytes32 domainSeparator = _domainSeparator();\n\n        // Declare variable as immutables cannot be accessed within assembly.\n        address conduitController = address(_CONDUIT_CONTROLLER);\n\n        // Return the version, domain separator, and conduit controller.\n        assembly {\n            mstore(information_version_offset, information_version_cd_offset)\n            mstore(information_domainSeparator_offset, domainSeparator)\n            mstore(information_conduitController_offset, conduitController)\n            mstore(information_versionLengthPtr, information_versionWithLength)\n            return(information_version_offset, information_length)\n        }\n    }\n\n    /**\n     * @dev Internal pure function to efficiently derive an digest to sign for\n     *      an order in accordance with EIP-712.\n     *\n     * @param domainSeparator The domain separator.\n     * @param orderHash       The order hash.\n     *\n     * @return value The hash.\n     */\n    function _deriveEIP712Digest(\n        bytes32 domainSeparator,\n        bytes32 orderHash\n    ) internal pure returns (bytes32 value) {\n        // Leverage scratch space to perform an efficient hash.\n        assembly {\n            // Place the EIP-712 prefix at the start of scratch space.\n            mstore(0, EIP_712_PREFIX)\n\n            // Place the domain separator in the next region of scratch space.\n            mstore(EIP712_DomainSeparator_offset, domainSeparator)\n\n            // Place the order hash in scratch space, spilling into the first\n            // two bytes of the free memory pointer — this should never be set\n            // as memory cannot be expanded to that size, and will be zeroed out\n            // after the hash is performed.\n            mstore(EIP712_OrderHash_offset, orderHash)\n\n            // Hash the relevant region (65 bytes).\n            value := keccak256(0, EIP712_DigestPayload_size)\n\n            // Clear out the dirtied bits in the memory pointer.\n            mstore(EIP712_OrderHash_offset, 0)\n        }\n    }\n}\n"},"src/lib/BasicOrderFulfiller.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    BasicOrderRouteType,\n    ItemType,\n    OrderType\n} from \"seaport-types/src/lib/ConsiderationEnums.sol\";\n\nimport {\n    BasicOrderParameters,\n    OrderStatus\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport { OrderValidator } from \"./OrderValidator.sol\";\n\nimport {\n    _revertInsufficientNativeTokensSupplied,\n    _revertInvalidMsgValue,\n    _revertInvalidERC721TransferAmount,\n    _revertUnusedItemParameters\n} from \"seaport-types/src/lib/ConsiderationErrors.sol\";\n\nimport {\n    AccumulatorDisarmed,\n    AdditionalRecipient_size_shift,\n    AdditionalRecipient_size,\n    BasicOrder_additionalRecipients_data_cdPtr,\n    BasicOrder_addlRecipients_length_cdPtr,\n    BasicOrder_basicOrderType_cdPtr,\n    BasicOrder_common_params_size,\n    BasicOrder_considerationAmount_cdPtr,\n    BasicOrder_considerationHashesArray_ptr,\n    BasicOrder_considerationIdentifier_cdPtr,\n    BasicOrder_considerationItem_endAmount_ptr,\n    BasicOrder_considerationItem_identifier_ptr,\n    BasicOrder_considerationItem_itemType_ptr,\n    BasicOrder_considerationItem_startAmount_ptr,\n    BasicOrder_considerationItem_token_ptr,\n    BasicOrder_considerationItem_typeHash_ptr,\n    BasicOrder_considerationToken_cdPtr,\n    BasicOrder_endTime_cdPtr,\n    BasicOrder_fulfillerConduit_cdPtr,\n    BasicOrder_offerAmount_cdPtr,\n    BasicOrder_offeredItemByteMap,\n    BasicOrder_offerer_cdPtr,\n    BasicOrder_offererConduit_cdPtr,\n    BasicOrder_offerIdentifier_cdPtr,\n    BasicOrder_offerItem_endAmount_ptr,\n    BasicOrder_offerItem_itemType_ptr,\n    BasicOrder_offerItem_token_ptr,\n    BasicOrder_offerItem_typeHash_ptr,\n    BasicOrder_offerToken_cdPtr,\n    BasicOrder_order_considerationHashes_ptr,\n    BasicOrder_order_counter_ptr,\n    BasicOrder_order_offerer_ptr,\n    BasicOrder_order_offerHashes_ptr,\n    BasicOrder_order_orderType_ptr,\n    BasicOrder_order_startTime_ptr,\n    BasicOrder_order_typeHash_ptr,\n    BasicOrder_receivedItemByteMap,\n    BasicOrder_startTime_cdPtr,\n    BasicOrder_totalOriginalAdditionalRecipients_cdPtr,\n    BasicOrder_zone_cdPtr,\n    Common_token_offset,\n    Conduit_execute_ConduitTransfer_length_ptr,\n    Conduit_execute_ConduitTransfer_length,\n    Conduit_execute_ConduitTransfer_offset_ptr,\n    Conduit_execute_ConduitTransfer_ptr,\n    Conduit_execute_signature,\n    Conduit_execute_transferAmount_ptr,\n    Conduit_execute_transferIdentifier_ptr,\n    Conduit_execute_transferFrom_ptr,\n    Conduit_execute_transferItemType_ptr,\n    Conduit_execute_transferTo_ptr,\n    Conduit_execute_transferToken_ptr,\n    EIP712_ConsiderationItem_size,\n    EIP712_OfferItem_size,\n    EIP712_Order_size,\n    FiveWords,\n    FourWords,\n    FreeMemoryPointerSlot,\n    MaskOverLastTwentyBytes,\n    OneConduitExecute_size,\n    OneWord,\n    OneWordShift,\n    OrderFulfilled_baseOffset,\n    OrderFulfilled_baseSize,\n    OrderFulfilled_consideration_body_offset,\n    OrderFulfilled_consideration_head_offset,\n    OrderFulfilled_consideration_length_baseOffset,\n    OrderFulfilled_fulfiller_offset,\n    OrderFulfilled_offer_body_offset,\n    OrderFulfilled_offer_head_offset,\n    OrderFulfilled_offer_length_baseOffset,\n    OrderFulfilled_offer_length_offset_relativeTo_baseOffset,\n    OrderFulfilled_offer_itemType_offset_relativeTo_baseOffset,\n    OrderFulfilled_offer_token_offset_relativeTo_baseOffset,\n    OrderFulfilled_post_memory_region_reservedBytes,\n    OrderFulfilled_selector,\n    ReceivedItem_amount_offset,\n    ReceivedItem_size,\n    receivedItemsHash_ptr,\n    ThreeWords,\n    TwoWords,\n    ZeroSlot\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    Error_selector_offset,\n    InvalidBasicOrderParameterEncoding_error_length,\n    InvalidBasicOrderParameterEncoding_error_selector,\n    InvalidTime_error_endTime_ptr,\n    InvalidTime_error_length,\n    InvalidTime_error_selector,\n    InvalidTime_error_startTime_ptr,\n    MissingOriginalConsiderationItems_error_length,\n    MissingOriginalConsiderationItems_error_selector,\n    UnusedItemParameters_error_length,\n    UnusedItemParameters_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\nimport {\n    CalldataPointer\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\n/**\n * @title BasicOrderFulfiller\n * @author 0age\n * @notice BasicOrderFulfiller contains functionality for fulfilling \"basic\"\n *         orders with minimal overhead. See documentation for details on what\n *         qualifies as a basic order.\n */\ncontract BasicOrderFulfiller is OrderValidator {\n    /**\n     * @dev Derive and set hashes, reference chainId, and associated domain\n     *      separator during deployment.\n     *\n     * @param conduitController A contract that deploys conduits, or proxies\n     *                          that may optionally be used to transfer approved\n     *                          ERC20/721/1155 tokens.\n     */\n    constructor(address conduitController) OrderValidator(conduitController) {}\n\n    /**\n     * @dev Internal function to fulfill an order offering an ERC20, ERC721, or\n     *      ERC1155 item by supplying Ether (or other native tokens), ERC20\n     *      tokens, an ERC721 item, or an ERC1155 item as consideration. Six\n     *      permutations are supported: Native token to ERC721, Native token to\n     *      ERC1155, ERC20 to ERC721, ERC20 to ERC1155, ERC721 to ERC20, and\n     *      ERC1155 to ERC20 (with native tokens supplied as msg.value). For an\n     *      order to be eligible for fulfillment via this method, it must\n     *      contain a single offer item (though that item may have a greater\n     *      amount if the item is not an ERC721). An arbitrary number of\n     *      \"additional recipients\" may also be supplied which will each receive\n     *      native tokens or ERC20 items from the fulfiller as consideration.\n     *      Refer to the documentation for a more comprehensive summary of how\n     *      to utilize this method and what orders are compatible with it.\n     *\n     * @return A boolean indicating whether the order has been fulfilled.\n     */\n    function _validateAndFulfillBasicOrder() internal returns (bool) {\n        // Declare enums for order type & route to extract from basicOrderType.\n        BasicOrderRouteType route;\n        OrderType orderType;\n\n        // Declare additional recipient item type to derive from the route type.\n        ItemType additionalRecipientsItemType;\n\n        bytes32 orderHash;\n\n        // Utilize assembly to extract the order type and the basic order route.\n        assembly {\n            // Read basicOrderType from calldata.\n            let basicOrderType := calldataload(BasicOrder_basicOrderType_cdPtr)\n\n            // Mask all but 2 least-significant bits to derive the order type.\n            orderType := and(basicOrderType, 3)\n\n            // Divide basicOrderType by four to derive the route.\n            route := shr(2, basicOrderType)\n\n            // If route > 1 additionalRecipient items are ERC20 (1) else native\n            // token (0).\n            additionalRecipientsItemType := gt(route, 1)\n        }\n\n        {\n            // Declare temporary variable for enforcing payable status.\n            bool correctPayableStatus;\n\n            // Utilize assembly to compare the route to the callvalue.\n            assembly {\n                // route 0 and 1 are payable, otherwise route is not payable.\n                correctPayableStatus := eq(\n                    additionalRecipientsItemType,\n                    iszero(callvalue())\n                )\n            }\n\n            // Revert if msg.value has not been supplied as part of payable\n            // routes or has been supplied as part of non-payable routes.\n            if (!correctPayableStatus) {\n                _revertInvalidMsgValue(msg.value);\n            }\n        }\n\n        // Declare more arguments that will be derived from route and calldata.\n        address additionalRecipientsToken;\n        ItemType offeredItemType;\n        bool offerTypeIsAdditionalRecipientsType;\n        uint256 callDataPointer;\n\n        // Declare scope for received item type to manage stack pressure.\n        {\n            ItemType receivedItemType;\n\n            // Utilize assembly to retrieve function arguments and cast types.\n            assembly {\n                // Check if offered item type == additional recipient item type.\n                offerTypeIsAdditionalRecipientsType := gt(route, 3)\n\n                // If route > 3 additionalRecipientsToken is at 0xc4 else 0x24.\n                additionalRecipientsToken := calldataload(\n                    add(\n                        BasicOrder_considerationToken_cdPtr,\n                        mul(\n                            offerTypeIsAdditionalRecipientsType,\n                            BasicOrder_common_params_size\n                        )\n                    )\n                )\n\n                // If route > 2, receivedItemType is route - 2. If route is 2,\n                // the receivedItemType is ERC20 (1). Otherwise, it is native\n                // token (0).\n                receivedItemType := byte(route, BasicOrder_receivedItemByteMap)\n\n                // If route > 3, offeredItemType is ERC20 (1). Route is 2 or 3,\n                // offeredItemType = route. Route is 0 or 1, it is route + 2.\n                offeredItemType := byte(route, BasicOrder_offeredItemByteMap)\n            }\n\n            // Derive & validate order using parameters and update order status.\n            (orderHash, callDataPointer) = _prepareBasicFulfillmentFromCalldata(\n                orderType,\n                receivedItemType,\n                additionalRecipientsItemType,\n                additionalRecipientsToken,\n                offeredItemType\n            );\n        }\n\n        // Declare conduitKey argument used by transfer functions.\n        bytes32 conduitKey;\n\n        // Utilize assembly to derive conduit (if relevant) based on route.\n        assembly {\n            // use offerer conduit for routes 0-3, fulfiller conduit otherwise.\n            conduitKey := calldataload(\n                add(\n                    BasicOrder_offererConduit_cdPtr,\n                    shl(OneWordShift, offerTypeIsAdditionalRecipientsType)\n                )\n            )\n        }\n\n        // Transfer tokens based on the route.\n        if (additionalRecipientsItemType == ItemType.NATIVE) {\n            // Ensure neither consideration token nor identifier are set. Note\n            // that dirty upper bits in the consideration token will still cause\n            // this error to be thrown.\n            assembly {\n                if or(\n                    calldataload(BasicOrder_considerationToken_cdPtr),\n                    calldataload(BasicOrder_considerationIdentifier_cdPtr)\n                ) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, UnusedItemParameters_error_selector)\n\n                    // revert(abi.encodeWithSignature(\"UnusedItemParameters()\"))\n                    revert(\n                        Error_selector_offset,\n                        UnusedItemParameters_error_length\n                    )\n                }\n            }\n\n            // Transfer the ERC721 or ERC1155 item, bypassing the accumulator.\n            _transferIndividual721Or1155Item(offeredItemType, conduitKey);\n\n            // Transfer native to recipients, return excess to caller & wrap up.\n            _transferNativeTokensAndFinalize();\n        } else {\n            // Initialize an accumulator array. From this point forward, no new\n            // memory regions can be safely allocated until the accumulator is\n            // no longer being utilized, as the accumulator operates in an\n            // open-ended fashion from this memory pointer; existing memory may\n            // still be accessed and modified, however.\n            bytes memory accumulator = new bytes(AccumulatorDisarmed);\n\n            // Choose transfer method for ERC721 or ERC1155 item based on route.\n            if (route == BasicOrderRouteType.ERC20_TO_ERC721) {\n                // Transfer ERC721 to caller using offerer's conduit preference.\n                _transferERC721(\n                    CalldataPointer\n                        .wrap(BasicOrder_offerToken_cdPtr)\n                        .readAddress(),\n                    CalldataPointer\n                        .wrap(BasicOrder_offerer_cdPtr)\n                        .readAddress(),\n                    msg.sender,\n                    CalldataPointer\n                        .wrap(BasicOrder_offerIdentifier_cdPtr)\n                        .readUint256(),\n                    CalldataPointer\n                        .wrap(BasicOrder_offerAmount_cdPtr)\n                        .readUint256(),\n                    conduitKey,\n                    accumulator\n                );\n            } else if (route == BasicOrderRouteType.ERC20_TO_ERC1155) {\n                // Transfer ERC1155 to caller with offerer's conduit preference.\n                _transferERC1155(\n                    CalldataPointer\n                        .wrap(BasicOrder_offerToken_cdPtr)\n                        .readAddress(),\n                    CalldataPointer\n                        .wrap(BasicOrder_offerer_cdPtr)\n                        .readAddress(),\n                    msg.sender,\n                    CalldataPointer\n                        .wrap(BasicOrder_offerIdentifier_cdPtr)\n                        .readUint256(),\n                    CalldataPointer\n                        .wrap(BasicOrder_offerAmount_cdPtr)\n                        .readUint256(),\n                    conduitKey,\n                    accumulator\n                );\n            } else if (route == BasicOrderRouteType.ERC721_TO_ERC20) {\n                // Transfer ERC721 to offerer using caller's conduit preference.\n                _transferERC721(\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationToken_cdPtr)\n                        .readAddress(),\n                    msg.sender,\n                    CalldataPointer\n                        .wrap(BasicOrder_offerer_cdPtr)\n                        .readAddress(),\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationIdentifier_cdPtr)\n                        .readUint256(),\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationAmount_cdPtr)\n                        .readUint256(),\n                    conduitKey,\n                    accumulator\n                );\n            } else {\n                // route == BasicOrderRouteType.ERC1155_TO_ERC20\n\n                // Transfer ERC1155 to offerer with caller's conduit preference.\n                _transferERC1155(\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationToken_cdPtr)\n                        .readAddress(),\n                    msg.sender,\n                    CalldataPointer\n                        .wrap(BasicOrder_offerer_cdPtr)\n                        .readAddress(),\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationIdentifier_cdPtr)\n                        .readUint256(),\n                    CalldataPointer\n                        .wrap(BasicOrder_considerationAmount_cdPtr)\n                        .readUint256(),\n                    conduitKey,\n                    accumulator\n                );\n            }\n\n            // Transfer ERC20 tokens to all recipients and wrap up.\n            _transferERC20AndFinalize(\n                offerTypeIsAdditionalRecipientsType,\n                accumulator\n            );\n\n            // Trigger any remaining accumulated transfers via call to conduit.\n            _triggerIfArmed(accumulator);\n        }\n\n        // Determine whether order is restricted and, if so, that it is valid.\n        _assertRestrictedBasicOrderValidity(\n            orderHash,\n            orderType,\n            callDataPointer\n        );\n\n        // Clear the reentrancy guard.\n        _clearReentrancyGuard();\n\n        return true;\n    }\n\n    /**\n     * @dev Internal function to prepare fulfillment of a basic order with\n     *      manual calldata and memory access. This calculates the order hash,\n     *      emits an OrderFulfilled event, and asserts basic order validity.\n     *      Note that calldata offsets must be validated as this function\n     *      accesses constant calldata pointers for dynamic types that match\n     *      default ABI encoding, but valid ABI encoding can use arbitrary\n     *      offsets. Checking that the offsets were produced by default encoding\n     *      will ensure that other functions using Solidity's calldata accessors\n     *      (which calculate pointers from the stored offsets) are reading the\n     *      same data as the order hash is derived from. Also note that this\n     *      function accesses memory directly.\n     *\n     * @param orderType                    The order type.\n     * @param receivedItemType             The item type of the initial\n     *                                     consideration item on the order.\n     * @param additionalRecipientsItemType The item type of any additional\n     *                                     consideration item on the order.\n     * @param additionalRecipientsToken    The ERC20 token contract address (if\n     *                                     applicable) for any additional\n     *                                     consideration item on the order.\n     * @param offeredItemType              The item type of the offered item on\n     *                                     the order.\n     * @return orderHash The calculated order hash.\n     */\n    function _prepareBasicFulfillmentFromCalldata(\n        OrderType orderType,\n        ItemType receivedItemType,\n        ItemType additionalRecipientsItemType,\n        address additionalRecipientsToken,\n        ItemType offeredItemType\n    ) internal returns (bytes32 orderHash, uint256 callDataPointer) {\n        // Ensure this function cannot be triggered during a reentrant call.\n        _setReentrancyGuard(false); // Native tokens rejected during execution.\n\n        // Verify that calldata offsets for all dynamic types were produced by\n        // default encoding. This ensures that the constants used for calldata\n        // pointers to dynamic types are the same as those calculated by\n        // Solidity using their offsets. Also verify that the basic order type\n        // is within range.\n        _assertValidBasicOrderParameters();\n\n        // Check for invalid time and missing original consideration items.\n        // Utilize assembly so that constant calldata pointers can be applied.\n        assembly {\n            // Ensure current timestamp is between order start time & end time.\n            if or(\n                gt(calldataload(BasicOrder_startTime_cdPtr), timestamp()),\n                iszero(gt(calldataload(BasicOrder_endTime_cdPtr), timestamp()))\n            ) {\n                // Store left-padded selector with push4 (reduces bytecode),\n                // mem[28:32] = selector\n                mstore(0, InvalidTime_error_selector)\n\n                // Store arguments.\n                mstore(\n                    InvalidTime_error_startTime_ptr,\n                    calldataload(BasicOrder_startTime_cdPtr)\n                )\n                mstore(\n                    InvalidTime_error_endTime_ptr,\n                    calldataload(BasicOrder_endTime_cdPtr)\n                )\n\n                // revert(abi.encodeWithSignature(\n                //     \"InvalidTime(uint256,uint256)\",\n                //     startTime,\n                //     endTime\n                // ))\n                revert(Error_selector_offset, InvalidTime_error_length)\n            }\n\n            // Ensure consideration array length isn't less than total original.\n            if lt(\n                calldataload(BasicOrder_addlRecipients_length_cdPtr),\n                calldataload(BasicOrder_totalOriginalAdditionalRecipients_cdPtr)\n            ) {\n                // Store left-padded selector with push4 (reduces bytecode),\n                // mem[28:32] = selector\n                mstore(0, MissingOriginalConsiderationItems_error_selector)\n\n                // revert(abi.encodeWithSignature(\n                //     \"MissingOriginalConsiderationItems()\"\n                // ))\n                revert(\n                    Error_selector_offset,\n                    MissingOriginalConsiderationItems_error_length\n                )\n            }\n        }\n\n        {\n            /**\n             * First, handle consideration items. Memory Layout:\n             *  0x60: final hash of the array of consideration item hashes\n             *  0x80-0x160: reused space for EIP712 hashing of each item\n             *   - 0x80: ConsiderationItem EIP-712 typehash (constant)\n             *   - 0xa0: itemType\n             *   - 0xc0: token\n             *   - 0xe0: identifier\n             *   - 0x100: startAmount\n             *   - 0x120: endAmount\n             *   - 0x140: recipient\n             *  0x160-END_ARR: array of consideration item hashes\n             *   - 0x160: primary consideration item EIP712 hash\n             *   - 0x180-END_ARR: additional recipient item EIP712 hashes\n             *  END_ARR: beginning of data for OrderFulfilled event\n             *   - END_ARR + 0x120: length of ReceivedItem array\n             *   - END_ARR + 0x140: beginning of data for first ReceivedItem\n             * (Note: END_ARR = 0x180 + RECIPIENTS_LENGTH * 0x20)\n             */\n\n            // Load consideration item typehash from runtime and place on stack.\n            bytes32 typeHash = _CONSIDERATION_ITEM_TYPEHASH;\n\n            // Utilize assembly to enable reuse of memory regions and use\n            // constant pointers when possible.\n            assembly {\n                /*\n                 * 1. Calculate the EIP712 ConsiderationItem hash for the\n                 * primary consideration item of the basic order.\n                 */\n\n                // Write ConsiderationItem type hash and item type to memory.\n                mstore(BasicOrder_considerationItem_typeHash_ptr, typeHash)\n                mstore(\n                    BasicOrder_considerationItem_itemType_ptr,\n                    receivedItemType\n                )\n\n                // Copy calldata region with (token, identifier, amount) from\n                // BasicOrderParameters to ConsiderationItem. The\n                // considerationAmount is written to startAmount and endAmount\n                // as basic orders do not have dynamic amounts.\n                calldatacopy(\n                    BasicOrder_considerationItem_token_ptr,\n                    BasicOrder_considerationToken_cdPtr,\n                    ThreeWords\n                )\n\n                // Copy calldata region with considerationAmount and offerer\n                // from BasicOrderParameters to endAmount and recipient in\n                // ConsiderationItem.\n                calldatacopy(\n                    BasicOrder_considerationItem_endAmount_ptr,\n                    BasicOrder_considerationAmount_cdPtr,\n                    TwoWords\n                )\n\n                // Calculate EIP712 ConsiderationItem hash and store it in the\n                // array of EIP712 consideration hashes.\n                mstore(\n                    BasicOrder_considerationHashesArray_ptr,\n                    keccak256(\n                        BasicOrder_considerationItem_typeHash_ptr,\n                        EIP712_ConsiderationItem_size\n                    )\n                )\n\n                /*\n                 * 2. Write a ReceivedItem struct for the primary consideration\n                 * item to the consideration array in OrderFulfilled.\n                 */\n\n                // Get the additional recipients array length from calldata.\n                // This variable will later be repurposed to track the total\n                // original additional recipients instead of the total supplied.\n                let totalAdditionalRecipients := calldataload(\n                    BasicOrder_addlRecipients_length_cdPtr\n                )\n\n                // Calculate pointer to length of OrderFulfilled consideration\n                // array. Note that this is based on total original additional\n                // recipients and not the supplied additional recipients, since\n                // the pointer only needs to be offset based on the size of the\n                // EIP-712 hashes used to derive the order hash (and the order\n                // hash does not take tips into account as part of derivation).\n                let eventConsiderationArrPtr := add(\n                    OrderFulfilled_consideration_length_baseOffset,\n                    shl(\n                        OneWordShift,\n                        calldataload(\n                            BasicOrder_totalOriginalAdditionalRecipients_cdPtr\n                        )\n                    )\n                )\n\n                // Set the length of the consideration array to the number of\n                // additional recipients, plus one for the primary consideration\n                // item.\n                mstore(\n                    eventConsiderationArrPtr,\n                    add(totalAdditionalRecipients, 1)\n                )\n\n                // Overwrite the consideration array pointer so it points to the\n                // body of the first element\n                eventConsiderationArrPtr := add(\n                    eventConsiderationArrPtr,\n                    OneWord\n                )\n\n                // Set itemType at start of the ReceivedItem memory region.\n                mstore(eventConsiderationArrPtr, receivedItemType)\n\n                // Copy calldata region (token, identifier, amount & recipient)\n                // from BasicOrderParameters to ReceivedItem memory.\n                calldatacopy(\n                    add(eventConsiderationArrPtr, Common_token_offset),\n                    BasicOrder_considerationToken_cdPtr,\n                    FourWords\n                )\n\n                /*\n                 * 3. Calculate EIP712 ConsiderationItem hashes for original\n                 * additional recipients and add a ReceivedItem for each to the\n                 * consideration array in the OrderFulfilled event. The original\n                 * additional recipients are all the consideration items signed\n                 * by the offerer aside from the primary consideration items of\n                 * the order. Uses memory region from 0x80-0x160 as a buffer for\n                 * calculating EIP712 ConsiderationItem hashes.\n                 */\n\n                // Put pointer to consideration hashes array on the stack.\n                // This will be updated as each additional recipient is hashed\n                let\n                    considerationHashesPtr\n                := BasicOrder_considerationHashesArray_ptr\n\n                // Write item type, token, & identifier for additional recipient\n                // to memory region for hashing EIP712 ConsiderationItem; these\n                // values will be reused for each recipient.\n                mstore(\n                    BasicOrder_considerationItem_itemType_ptr,\n                    additionalRecipientsItemType\n                )\n                mstore(\n                    BasicOrder_considerationItem_token_ptr,\n                    additionalRecipientsToken\n                )\n                mstore(BasicOrder_considerationItem_identifier_ptr, 0)\n\n                // Declare a stack variable where all additional recipients will\n                // be combined to guard against providing dirty upper bits.\n                let combinedAdditionalRecipients\n\n                // Only iterate over the total original additional recipients\n                // (not the total supplied additional recipients) when deriving\n                // the order hash.\n                totalAdditionalRecipients := calldataload(\n                    BasicOrder_totalOriginalAdditionalRecipients_cdPtr\n                )\n                let i := 0\n                for {\n\n                } lt(i, totalAdditionalRecipients) {\n                    i := add(i, 1)\n                } {\n                    /*\n                     * Calculate EIP712 ConsiderationItem hash for recipient.\n                     */\n\n                    // Retrieve calldata pointer for additional recipient.\n                    let additionalRecipientCdPtr := add(\n                        BasicOrder_additionalRecipients_data_cdPtr,\n                        mul(AdditionalRecipient_size, i)\n                    )\n\n                    // Copy startAmount from calldata to the ConsiderationItem\n                    // struct.\n                    calldatacopy(\n                        BasicOrder_considerationItem_startAmount_ptr,\n                        additionalRecipientCdPtr,\n                        OneWord\n                    )\n\n                    // Copy endAmount and recipient from calldata to the\n                    // ConsiderationItem struct.\n                    calldatacopy(\n                        BasicOrder_considerationItem_endAmount_ptr,\n                        additionalRecipientCdPtr,\n                        AdditionalRecipient_size\n                    )\n\n                    // Include the recipient as part of combined recipients.\n                    combinedAdditionalRecipients := or(\n                        combinedAdditionalRecipients,\n                        calldataload(add(additionalRecipientCdPtr, OneWord))\n                    )\n\n                    // Add 1 word to the pointer as part of each loop to reduce\n                    // operations needed to get local offset into the array.\n                    considerationHashesPtr := add(\n                        considerationHashesPtr,\n                        OneWord\n                    )\n\n                    // Calculate EIP712 ConsiderationItem hash and store it in\n                    // the array of consideration hashes.\n                    mstore(\n                        considerationHashesPtr,\n                        keccak256(\n                            BasicOrder_considerationItem_typeHash_ptr,\n                            EIP712_ConsiderationItem_size\n                        )\n                    )\n\n                    /*\n                     * Write ReceivedItem to OrderFulfilled data.\n                     */\n\n                    // At this point, eventConsiderationArrPtr points to the\n                    // beginning of the ReceivedItem struct of the previous\n                    // element in the array. Increase it by the size of the\n                    // struct to arrive at the pointer for the current element.\n                    eventConsiderationArrPtr := add(\n                        eventConsiderationArrPtr,\n                        ReceivedItem_size\n                    )\n\n                    // Write itemType to the ReceivedItem struct.\n                    mstore(\n                        eventConsiderationArrPtr,\n                        additionalRecipientsItemType\n                    )\n\n                    // Write token to the next word of the ReceivedItem struct.\n                    mstore(\n                        add(eventConsiderationArrPtr, OneWord),\n                        additionalRecipientsToken\n                    )\n\n                    // Copy endAmount & recipient words to ReceivedItem struct.\n                    calldatacopy(\n                        add(\n                            eventConsiderationArrPtr,\n                            ReceivedItem_amount_offset\n                        ),\n                        additionalRecipientCdPtr,\n                        TwoWords\n                    )\n                }\n\n                /*\n                 * 4. Hash packed array of ConsiderationItem EIP712 hashes:\n                 *   `keccak256(abi.encodePacked(receivedItemHashes))`\n                 * Note that it is set at 0x60 — all other memory begins at\n                 * 0x80. 0x60 is the \"zero slot\" and will be restored at the end\n                 * of the assembly section and before required by the compiler.\n                 */\n                mstore(\n                    receivedItemsHash_ptr,\n                    keccak256(\n                        BasicOrder_considerationHashesArray_ptr,\n                        shl(OneWordShift, add(totalAdditionalRecipients, 1))\n                    )\n                )\n\n                /*\n                 * 5. Add a ReceivedItem for each tip to the consideration array\n                 * in the OrderFulfilled event. The tips are all the\n                 * consideration items that were not signed by the offerer and\n                 * were provided by the fulfiller.\n                 */\n\n                // Overwrite length to length of the additionalRecipients array.\n                totalAdditionalRecipients := calldataload(\n                    BasicOrder_addlRecipients_length_cdPtr\n                )\n\n                for {\n\n                } lt(i, totalAdditionalRecipients) {\n                    i := add(i, 1)\n                } {\n                    // Retrieve calldata pointer for additional recipient.\n                    let additionalRecipientCdPtr := add(\n                        BasicOrder_additionalRecipients_data_cdPtr,\n                        mul(AdditionalRecipient_size, i)\n                    )\n\n                    // At this point, eventConsiderationArrPtr points to the\n                    // beginning of the ReceivedItem struct of the previous\n                    // element in the array. Increase it by the size of the\n                    // struct to arrive at the pointer for the current element.\n                    eventConsiderationArrPtr := add(\n                        eventConsiderationArrPtr,\n                        ReceivedItem_size\n                    )\n\n                    // Write itemType to the ReceivedItem struct.\n                    mstore(\n                        eventConsiderationArrPtr,\n                        additionalRecipientsItemType\n                    )\n\n                    // Write token to the next word of the ReceivedItem struct.\n                    mstore(\n                        add(eventConsiderationArrPtr, OneWord),\n                        additionalRecipientsToken\n                    )\n\n                    // Copy endAmount & recipient words to ReceivedItem struct.\n                    calldatacopy(\n                        add(\n                            eventConsiderationArrPtr,\n                            ReceivedItem_amount_offset\n                        ),\n                        additionalRecipientCdPtr,\n                        TwoWords\n                    )\n\n                    // Include the recipient as part of combined recipients.\n                    combinedAdditionalRecipients := or(\n                        combinedAdditionalRecipients,\n                        calldataload(add(additionalRecipientCdPtr, OneWord))\n                    )\n                }\n\n                // Ensure no dirty upper bits on combined additional recipients.\n                if gt(combinedAdditionalRecipients, MaskOverLastTwentyBytes) {\n                    // Store left-padded selector with push4 (reduces bytecode),\n                    // mem[28:32] = selector\n                    mstore(0, InvalidBasicOrderParameterEncoding_error_selector)\n\n                    // revert(abi.encodeWithSignature(\n                    //     \"InvalidBasicOrderParameterEncoding()\"\n                    // ))\n                    revert(\n                        Error_selector_offset,\n                        InvalidBasicOrderParameterEncoding_error_length\n                    )\n                }\n            }\n        }\n\n        {\n            /**\n             * Next, handle offered items. Memory Layout:\n             *  EIP712 data for OfferItem\n             *   - 0x80:  OfferItem EIP-712 typehash (constant)\n             *   - 0xa0:  itemType\n             *   - 0xc0:  token\n             *   - 0xe0:  identifier (reused for offeredItemsHash)\n             *   - 0x100: startAmount\n             *   - 0x120: endAmount\n             */\n\n            // Place offer item typehash on the stack.\n            bytes32 typeHash = _OFFER_ITEM_TYPEHASH;\n\n            // Utilize assembly to enable reuse of memory regions when possible.\n            assembly {\n                /*\n                 * 1. Calculate OfferItem EIP712 hash\n                 */\n\n                // Write the OfferItem typeHash to memory.\n                mstore(BasicOrder_offerItem_typeHash_ptr, typeHash)\n\n                // Write the OfferItem item type to memory.\n                mstore(BasicOrder_offerItem_itemType_ptr, offeredItemType)\n\n                // Copy calldata region with (offerToken, offerIdentifier,\n                // offerAmount) from OrderParameters to (token, identifier,\n                // startAmount) in OfferItem struct. The offerAmount is written\n                // to startAmount and endAmount as basic orders do not have\n                // dynamic amounts.\n                calldatacopy(\n                    BasicOrder_offerItem_token_ptr,\n                    BasicOrder_offerToken_cdPtr,\n                    ThreeWords\n                )\n\n                // Copy offerAmount from calldata to endAmount in OfferItem\n                // struct.\n                calldatacopy(\n                    BasicOrder_offerItem_endAmount_ptr,\n                    BasicOrder_offerAmount_cdPtr,\n                    OneWord\n                )\n\n                // Compute EIP712 OfferItem hash, write result to scratch space:\n                //   `keccak256(abi.encode(offeredItem))`\n                mstore(\n                    0,\n                    keccak256(\n                        BasicOrder_offerItem_typeHash_ptr,\n                        EIP712_OfferItem_size\n                    )\n                )\n\n                /*\n                 * 2. Calculate hash of array of EIP712 hashes and write the\n                 * result to the corresponding OfferItem struct:\n                 *   `keccak256(abi.encodePacked(offerItemHashes))`\n                 */\n                mstore(BasicOrder_order_offerHashes_ptr, keccak256(0, OneWord))\n            }\n        }\n\n        {\n            /**\n             * Once consideration items and offer items have been handled,\n             * derive the final order hash. Memory Layout:\n             *  0x80-0x1c0: EIP712 data for order\n             *   - 0x80:   Order EIP-712 typehash (constant)\n             *   - 0xa0:   orderParameters.offerer\n             *   - 0xc0:   orderParameters.zone\n             *   - 0xe0:   keccak256(abi.encodePacked(offerHashes))\n             *   - 0x100:  keccak256(abi.encodePacked(considerationHashes))\n             *   - 0x120:  orderParameters.basicOrderType (% 4 = orderType)\n             *   - 0x140:  orderParameters.startTime\n             *   - 0x160:  orderParameters.endTime\n             *   - 0x180:  orderParameters.zoneHash\n             *   - 0x1a0:  orderParameters.salt\n             *   - 0x1c0:  orderParameters.conduitKey\n             *   - 0x1e0:  _counters[orderParameters.offerer] (from storage)\n             */\n\n            // Read the offerer from calldata and place on the stack.\n            address offerer;\n            assembly {\n                offerer := calldataload(BasicOrder_offerer_cdPtr)\n            }\n\n            // Read offerer's current counter from storage and place on stack.\n            uint256 counter = _getCounter(offerer);\n\n            // Load order typehash from runtime code and place on stack.\n            bytes32 typeHash = _ORDER_TYPEHASH;\n\n            assembly {\n                // Set the OrderItem typeHash in memory.\n                mstore(BasicOrder_order_typeHash_ptr, typeHash)\n\n                // Copy offerer and zone from OrderParameters in calldata to the\n                // Order struct.\n                calldatacopy(\n                    BasicOrder_order_offerer_ptr,\n                    BasicOrder_offerer_cdPtr,\n                    TwoWords\n                )\n\n                // Copy receivedItemsHash from zero slot to the Order struct.\n                mstore(\n                    BasicOrder_order_considerationHashes_ptr,\n                    mload(receivedItemsHash_ptr)\n                )\n\n                // Write the supplied orderType to the Order struct.\n                mstore(BasicOrder_order_orderType_ptr, orderType)\n\n                // Copy startTime, endTime, zoneHash, salt & conduit from\n                // calldata to the Order struct.\n                calldatacopy(\n                    BasicOrder_order_startTime_ptr,\n                    BasicOrder_startTime_cdPtr,\n                    FiveWords\n                )\n\n                // Write offerer's counter, retrieved from storage, to struct.\n                mstore(BasicOrder_order_counter_ptr, counter)\n\n                // Compute the EIP712 Order hash.\n                orderHash := keccak256(\n                    BasicOrder_order_typeHash_ptr,\n                    EIP712_Order_size\n                )\n            }\n        }\n\n        assembly {\n            /**\n             * After the order hash has been derived, emit OrderFulfilled event:\n             *   event OrderFulfilled(\n             *     bytes32 orderHash,\n             *     address indexed offerer,\n             *     address indexed zone,\n             *     address fulfiller,\n             *     SpentItem[] offer,\n             *       > (itemType, token, id, amount)\n             *     ReceivedItem[] consideration\n             *       > (itemType, token, id, amount, recipient)\n             *   )\n             * topic0 - OrderFulfilled event signature\n             * topic1 - offerer\n             * topic2 - zone\n             * data:\n             *  - 0x00: orderHash\n             *  - 0x20: fulfiller\n             *  - 0x40: offer arr ptr (0x80)\n             *  - 0x60: consideration arr ptr (0x120)\n             *  - 0x80: offer arr len (1)\n             *  - 0xa0: offer.itemType\n             *  - 0xc0: offer.token\n             *  - 0xe0: offer.identifier\n             *  - 0x100: offer.amount\n             *  - 0x120: 1 + recipients.length\n             *  - 0x140: recipient 0\n             */\n\n            // Derive pointer to start of OrderFulfilled event data.\n            let eventDataPtr := add(\n                OrderFulfilled_baseOffset,\n                shl(\n                    OneWordShift,\n                    calldataload(\n                        BasicOrder_totalOriginalAdditionalRecipients_cdPtr\n                    )\n                )\n            )\n\n            // Write the order hash to the head of the event's data region.\n            mstore(eventDataPtr, orderHash)\n\n            // Write the fulfiller (i.e. the caller) next for receiver argument.\n            mstore(add(eventDataPtr, OrderFulfilled_fulfiller_offset), caller())\n\n            // Write the SpentItem and ReceivedItem array offsets (constants).\n            mstore(\n                // SpentItem array offset\n                add(eventDataPtr, OrderFulfilled_offer_head_offset),\n                OrderFulfilled_offer_body_offset\n            )\n            mstore(\n                // ReceivedItem array offset\n                add(eventDataPtr, OrderFulfilled_consideration_head_offset),\n                OrderFulfilled_consideration_body_offset\n            )\n\n            // Set a length of 1 for the offer array.\n            mstore(\n                add(\n                    eventDataPtr,\n                    OrderFulfilled_offer_length_offset_relativeTo_baseOffset\n                ),\n                1\n            )\n\n            // Write itemType to the SpentItem struct.\n            mstore(\n                add(\n                    eventDataPtr,\n                    OrderFulfilled_offer_itemType_offset_relativeTo_baseOffset\n                ),\n                offeredItemType\n            )\n\n            // Copy calldata region with (offerToken, offerIdentifier,\n            // offerAmount) from OrderParameters to (token, identifier,\n            // amount) in SpentItem struct.\n            calldatacopy(\n                add(\n                    eventDataPtr,\n                    OrderFulfilled_offer_token_offset_relativeTo_baseOffset\n                ),\n                BasicOrder_offerToken_cdPtr,\n                ThreeWords\n            )\n\n            // Derive total data size including SpentItem and ReceivedItem data.\n            // SpentItem portion is already included in the baseSize constant,\n            // as there can only be one element in the array.\n            let dataSize := add(\n                OrderFulfilled_baseSize,\n                mul(\n                    calldataload(BasicOrder_addlRecipients_length_cdPtr),\n                    ReceivedItem_size\n                )\n            )\n\n            // Emit OrderFulfilled log with three topics (the event signature\n            // as well as the two indexed arguments, the offerer and the zone).\n            log3(\n                // Supply the pointer for event data in memory.\n                eventDataPtr,\n                // Supply the size of event data in memory.\n                dataSize,\n                // Supply the OrderFulfilled event signature.\n                OrderFulfilled_selector,\n                // Supply the first topic (the offerer).\n                calldataload(BasicOrder_offerer_cdPtr),\n                // Supply the second topic (the zone).\n                calldataload(BasicOrder_zone_cdPtr)\n            )\n\n            // Restore the zero slot.\n            mstore(ZeroSlot, 0)\n\n            // Update the free memory pointer so that event data is persisted.\n            mstore(\n                FreeMemoryPointerSlot,\n                add(\n                    eventDataPtr,\n                    // Reserve extra 3 words to be used by `authorizeOrder` and\n                    // `validatateOrder` if pre-post exection hook to the zone\n                    // is required. These 3 memory slots will be used for the\n                    // extra data/context and order hashes of the calldata.\n                    add(\n                        dataSize,\n                        OrderFulfilled_post_memory_region_reservedBytes\n                    )\n                )\n            )\n        }\n\n        // Verify the status of the derived order.\n        OrderStatus storage orderStatus = _validateBasicOrder(orderHash);\n\n        // Determine whether order is restricted and, if so, that it is valid.\n        callDataPointer = _assertRestrictedBasicOrderAuthorization(\n            orderHash,\n            orderType\n        );\n\n        // Update the status of the order and mark as fully filled.\n        _updateBasicOrderStatus(orderStatus);\n\n        // Return the derived order hash.\n        return (orderHash, callDataPointer);\n    }\n\n    /**\n     * @dev Internal function to transfer an individual ERC721 or ERC1155 item\n     *      from a given originator to a given recipient. The accumulator will\n     *      be bypassed, meaning that this function should be utilized in cases\n     *      where multiple item transfers can be accumulated into a single\n     *      conduit call. Sufficient approvals must be set, either on the\n     *      respective conduit or on this contract. Note that this function may\n     *      only be safely called as part of basic orders, as it assumes a\n     *      specific calldata encoding structure that must first be validated.\n     *\n     * @param itemType   The type of item to transfer, either ERC721 or ERC1155.\n     * @param conduitKey A bytes32 value indicating what corresponding conduit,\n     *                   if any, to source token approvals from. The zero hash\n     *                   signifies that no conduit should be used, with direct\n     *                   approvals set on this contract.\n     */\n    function _transferIndividual721Or1155Item(\n        ItemType itemType,\n        bytes32 conduitKey\n    ) internal {\n        // Retrieve token, from, identifier, and amount from calldata using\n        // fixed calldata offsets based on strict basic parameter encoding.\n        address token;\n        address from;\n        uint256 identifier;\n        uint256 amount;\n        assembly {\n            token := calldataload(BasicOrder_offerToken_cdPtr)\n            from := calldataload(BasicOrder_offerer_cdPtr)\n            identifier := calldataload(BasicOrder_offerIdentifier_cdPtr)\n            amount := calldataload(BasicOrder_offerAmount_cdPtr)\n        }\n\n        // Determine if the transfer is to be performed via a conduit.\n        if (conduitKey != bytes32(0)) {\n            // Ensure that the amount is non-zero.\n            _assertNonZeroAmount(amount);\n\n            // Use free memory pointer as calldata offset for the conduit call.\n            uint256 callDataOffset;\n\n            // Utilize assembly to place each argument in free memory.\n            assembly {\n                // Retrieve the free memory pointer and use it as the offset.\n                callDataOffset := mload(FreeMemoryPointerSlot)\n\n                // Write ConduitInterface.execute.selector to memory.\n                mstore(callDataOffset, Conduit_execute_signature)\n\n                // Write the offset to the ConduitTransfer array in memory.\n                mstore(\n                    add(\n                        callDataOffset,\n                        Conduit_execute_ConduitTransfer_offset_ptr\n                    ),\n                    Conduit_execute_ConduitTransfer_ptr\n                )\n\n                // Write the length of the ConduitTransfer array to memory.\n                mstore(\n                    add(\n                        callDataOffset,\n                        Conduit_execute_ConduitTransfer_length_ptr\n                    ),\n                    Conduit_execute_ConduitTransfer_length\n                )\n\n                // Write the item type to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferItemType_ptr),\n                    itemType\n                )\n\n                // Write the token to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferToken_ptr),\n                    token\n                )\n\n                // Write the transfer source to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferFrom_ptr),\n                    from\n                )\n\n                // Write the transfer recipient (the caller) to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferTo_ptr),\n                    caller()\n                )\n\n                // Write the token identifier to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferIdentifier_ptr),\n                    identifier\n                )\n\n                // Write the transfer amount to memory.\n                mstore(\n                    add(callDataOffset, Conduit_execute_transferAmount_ptr),\n                    amount\n                )\n            }\n\n            // Perform the call to the conduit.\n            _callConduitUsingOffsets(\n                conduitKey,\n                callDataOffset,\n                OneConduitExecute_size\n            );\n        } else {\n            // Otherwise, determine whether it is an ERC721 or ERC1155 item.\n            if (itemType == ItemType.ERC721) {\n                // Ensure that exactly one 721 item is being transferred.\n                if (amount != 1) {\n                    _revertInvalidERC721TransferAmount(amount);\n                }\n\n                // Perform transfer to caller via the token contract directly.\n                _performERC721Transfer(token, from, msg.sender, identifier);\n            } else {\n                // Ensure that the amount is non-zero.\n                _assertNonZeroAmount(amount);\n\n                // Perform transfer to caller via the token contract directly.\n                _performERC1155Transfer(\n                    token,\n                    from,\n                    msg.sender,\n                    identifier,\n                    amount\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer Ether (or other native tokens) to a\n     *      given recipient as part of basic order fulfillment. Note that\n     *      conduits are not utilized for native tokens as the transferred\n     *      amount must be provided as msg.value. Also note that this function\n     *      may only be safely called as part of basic orders, as it assumes a\n     *      specific calldata encoding structure that must first be validated.\n     */\n    function _transferNativeTokensAndFinalize() internal {\n        // Put native token value supplied by the caller on the stack.\n        uint256 nativeTokensRemaining = msg.value;\n\n        // Retrieve consideration amount, offerer, and total size of additional\n        // recipients data from calldata using fixed offsets and place on stack.\n        uint256 amount;\n        address payable to;\n        uint256 totalAdditionalRecipientsDataSize;\n        assembly {\n            amount := calldataload(BasicOrder_considerationAmount_cdPtr)\n            to := calldataload(BasicOrder_offerer_cdPtr)\n            totalAdditionalRecipientsDataSize := shl(\n                AdditionalRecipient_size_shift,\n                calldataload(BasicOrder_addlRecipients_length_cdPtr)\n            )\n        }\n\n        uint256 additionalRecipientAmount;\n        address payable recipient;\n\n        // Skip overflow check as for loop is indexed starting at zero.\n        unchecked {\n            // Iterate over additional recipient data by two-word element.\n            for (\n                uint256 i = 0;\n                i < totalAdditionalRecipientsDataSize;\n                i += AdditionalRecipient_size\n            ) {\n                assembly {\n                    // Retrieve calldata pointer for additional recipient.\n                    let additionalRecipientCdPtr := add(\n                        BasicOrder_additionalRecipients_data_cdPtr,\n                        i\n                    )\n\n                    additionalRecipientAmount := calldataload(\n                        additionalRecipientCdPtr\n                    )\n                    recipient := calldataload(\n                        add(OneWord, additionalRecipientCdPtr)\n                    )\n                }\n\n                // Ensure that sufficient native tokens are available.\n                if (additionalRecipientAmount > nativeTokensRemaining) {\n                    _revertInsufficientNativeTokensSupplied();\n                }\n\n                // Reduce native token value available. Skip underflow check as\n                // subtracted value is confirmed above as less than remaining.\n                nativeTokensRemaining -= additionalRecipientAmount;\n\n                // Transfer native tokens to the additional recipient.\n                _transferNativeTokens(recipient, additionalRecipientAmount);\n            }\n        }\n\n        // Ensure that sufficient native tokens are still available.\n        if (amount > nativeTokensRemaining) {\n            _revertInsufficientNativeTokensSupplied();\n        }\n\n        // Transfer native tokens to the offerer.\n        _transferNativeTokens(to, amount);\n\n        // If any native tokens remain after transfers, return to the caller.\n        if (nativeTokensRemaining > amount) {\n            // Skip underflow check as nativeTokensRemaining > amount.\n            unchecked {\n                // Transfer remaining native tokens to the caller.\n                _transferNativeTokens(\n                    payable(msg.sender),\n                    nativeTokensRemaining - amount\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Internal function to transfer ERC20 tokens to a given recipient as\n     *      part of basic order fulfillment. Note that this function may only be\n     *      safely called as part of basic orders, as it assumes a specific\n     *      calldata encoding structure that must first be validated. Also note\n     *      that basic order parameters are retrieved using fixed offsets, this\n     *      requires that strict basic order encoding has already been verified.\n     *\n     * @param fromOfferer A boolean indicating whether to decrement amount from\n     *                    the offered amount.\n     * @param accumulator An open-ended array that collects transfers to execute\n     *                    against a given conduit in a single call.\n     */\n    function _transferERC20AndFinalize(\n        bool fromOfferer,\n        bytes memory accumulator\n    ) internal {\n        // Declare from and to variables determined by fromOfferer value.\n        address from;\n        address to;\n\n        // Declare token and amount variables determined by fromOfferer value.\n        address token;\n        uint256 amount;\n\n        // Declare and check identifier variable within an isolated scope.\n        {\n            // Declare identifier variable determined by fromOfferer value.\n            uint256 identifier;\n\n            // Set ERC20 token transfer variables based on fromOfferer boolean.\n            if (fromOfferer) {\n                // Use offerer as from value, msg.sender as to value, and offer\n                // token, identifier, & amount values if token is from offerer.\n                assembly {\n                    from := calldataload(BasicOrder_offerer_cdPtr)\n                    to := caller()\n                    token := calldataload(BasicOrder_offerToken_cdPtr)\n                    identifier := calldataload(BasicOrder_offerIdentifier_cdPtr)\n                    amount := calldataload(BasicOrder_offerAmount_cdPtr)\n                }\n            } else {\n                // Otherwise, use msg.sender as from value, offerer as to value,\n                // and consideration token, identifier, and amount values.\n                assembly {\n                    from := caller()\n                    to := calldataload(BasicOrder_offerer_cdPtr)\n                    token := calldataload(BasicOrder_considerationToken_cdPtr)\n                    identifier := calldataload(\n                        BasicOrder_considerationIdentifier_cdPtr\n                    )\n                    amount := calldataload(BasicOrder_considerationAmount_cdPtr)\n                }\n            }\n\n            // Ensure that no identifier is supplied.\n            if (identifier != 0) {\n                _revertUnusedItemParameters();\n            }\n        }\n\n        // Determine the appropriate conduit to utilize.\n        bytes32 conduitKey;\n\n        // Utilize assembly to derive conduit (if relevant) based on route.\n        assembly {\n            // Use offerer conduit if fromOfferer, fulfiller conduit otherwise.\n            conduitKey := calldataload(\n                sub(\n                    BasicOrder_fulfillerConduit_cdPtr,\n                    shl(OneWordShift, fromOfferer)\n                )\n            )\n        }\n\n        // Retrieve total size of additional recipients data and place on stack.\n        uint256 totalAdditionalRecipientsDataSize;\n        assembly {\n            totalAdditionalRecipientsDataSize := shl(\n                AdditionalRecipient_size_shift,\n                calldataload(BasicOrder_addlRecipients_length_cdPtr)\n            )\n        }\n\n        uint256 additionalRecipientAmount;\n        address recipient;\n\n        // Iterate over each additional recipient.\n        for (uint256 i = 0; i < totalAdditionalRecipientsDataSize; ) {\n            assembly {\n                // Retrieve calldata pointer for additional recipient.\n                let additionalRecipientCdPtr := add(\n                    BasicOrder_additionalRecipients_data_cdPtr,\n                    i\n                )\n\n                additionalRecipientAmount := calldataload(\n                    additionalRecipientCdPtr\n                )\n                recipient := calldataload(\n                    add(OneWord, additionalRecipientCdPtr)\n                )\n            }\n\n            // Decrement the amount to transfer to fulfiller if indicated.\n            if (fromOfferer) {\n                amount -= additionalRecipientAmount;\n            }\n\n            // Transfer ERC20 tokens to additional recipient given approval.\n            _transferERC20(\n                token,\n                from,\n                recipient,\n                additionalRecipientAmount,\n                conduitKey,\n                accumulator\n            );\n\n            // Skip overflow check as for loop is indexed starting at zero.\n            unchecked {\n                i += AdditionalRecipient_size;\n            }\n        }\n\n        // Transfer ERC20 token amount (from account must have proper approval).\n        _transferERC20(token, from, to, amount, conduitKey, accumulator);\n    }\n}\n"},"src/lib/ConsiderationDecoder.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    AdvancedOrder,\n    ConsiderationItem,\n    CriteriaResolver,\n    Fulfillment,\n    FulfillmentComponent,\n    OfferItem,\n    Order,\n    OrderParameters,\n    ReceivedItem\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    AdvancedOrder_denominator_offset,\n    AdvancedOrder_extraData_offset,\n    AdvancedOrder_fixed_segment_0,\n    AdvancedOrder_head_size,\n    AdvancedOrder_numerator_offset,\n    AdvancedOrder_signature_offset,\n    AdvancedOrderPlusOrderParameters_head_size,\n    Common_amount_offset,\n    Common_endAmount_offset,\n    Common_identifier_offset,\n    Common_token_offset,\n    ConsiderationItem_recipient_offset,\n    ConsiderationItem_size_with_head_pointer,\n    ConsiderationItem_size,\n    CriteriaResolver_criteriaProof_offset,\n    CriteriaResolver_fixed_segment_0,\n    CriteriaResolver_head_size,\n    ThreeWords,\n    FreeMemoryPointerSlot,\n    Fulfillment_considerationComponents_offset,\n    Fulfillment_head_size,\n    FulfillmentComponent_mem_tail_size_shift,\n    FulfillmentComponent_mem_tail_size,\n    generateOrder_maximum_returned_array_length,\n    OfferItem_size_with_head_pointer,\n    OfferItem_size,\n    OneWord,\n    OneWordShift,\n    OnlyFullWordMask,\n    Order_head_size,\n    Order_signature_offset,\n    OrderComponents_OrderParameters_common_head_size,\n    OrderParameters_consideration_head_offset,\n    OrderParameters_head_size,\n    OrderParameters_offer_head_offset,\n    OrderParameters_totalOriginalConsiderationItems_offset,\n    ReceivedItem_recipient_offset,\n    ReceivedItem_size,\n    ReceivedItem_size_excluding_recipient,\n    SpentItem_size_shift,\n    SpentItem_size,\n    ThirtyOneBytes,\n    TwoWords\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    CalldataPointer,\n    malloc,\n    MemoryPointer,\n    OffsetOrLengthMask\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\ncontract ConsiderationDecoder {\n    /**\n     * @dev Takes a bytes array from calldata and copies it into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the bytes array in\n     *                    calldata which contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the bytes array in\n     *                    memory which contains the length of the array.\n     */\n    function _decodeBytes(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        assembly {\n            // Get the current free memory pointer.\n            mPtrLength := mload(FreeMemoryPointerSlot)\n\n            // Derive the size of the bytes array, rounding up to nearest word\n            // and adding a word for the length field. Note: masking\n            // `calldataload(cdPtrLength)` is redundant here.\n            let size := add(\n                and(\n                    add(calldataload(cdPtrLength), ThirtyOneBytes),\n                    OnlyFullWordMask\n                ),\n                OneWord\n            )\n\n            // Copy bytes from calldata into memory based on pointers and size.\n            calldatacopy(mPtrLength, cdPtrLength, size)\n\n            // Store the masked value in memory. Note: the value of `size` is at\n            // least 32, meaning the calldatacopy above will at least write to\n            // `[mPtrLength, mPtrLength + 32)`.\n            mstore(\n                mPtrLength,\n                and(calldataload(cdPtrLength), OffsetOrLengthMask)\n            )\n\n            // Update free memory pointer based on the size of the bytes array.\n            mstore(FreeMemoryPointerSlot, add(mPtrLength, size))\n        }\n    }\n\n    /**\n     * @dev Takes an offer array from calldata and copies it into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the offer array\n     *                    in calldata which contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the offer array in\n     *                    memory which contains the length of the array.\n     */\n    function _decodeOffer(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        assembly {\n            // Retrieve length of array, masking to prevent potential overflow.\n            let arrLength := and(calldataload(cdPtrLength), OffsetOrLengthMask)\n\n            // Get the current free memory pointer.\n            mPtrLength := mload(FreeMemoryPointerSlot)\n\n            // Write the array length to memory.\n            mstore(mPtrLength, arrLength)\n\n            // Derive the head by adding one word to the length pointer.\n            let mPtrHead := add(mPtrLength, OneWord)\n\n            // Derive the tail by adding one word per element (note that structs\n            // are written to memory with an offset per struct element).\n            let mPtrTail := add(mPtrHead, shl(OneWordShift, arrLength))\n\n            // Track the next tail, beginning with the initial tail value.\n            let mPtrTailNext := mPtrTail\n\n            // Copy all offer array data into memory at the tail pointer.\n            calldatacopy(\n                mPtrTail,\n                add(cdPtrLength, OneWord),\n                mul(arrLength, OfferItem_size)\n            )\n\n            // Track the next head pointer, starting with initial head value.\n            let mPtrHeadNext := mPtrHead\n\n            // Iterate over each head pointer until it reaches the tail.\n            for {\n\n            } lt(mPtrHeadNext, mPtrTail) {\n\n            } {\n                // Write the next tail pointer to next head pointer in memory.\n                mstore(mPtrHeadNext, mPtrTailNext)\n\n                // Increment the next head pointer by one word.\n                mPtrHeadNext := add(mPtrHeadNext, OneWord)\n\n                // Increment the next tail pointer by the size of an offer item.\n                mPtrTailNext := add(mPtrTailNext, OfferItem_size)\n            }\n\n            // Update free memory pointer to allocate memory up to end of tail.\n            mstore(FreeMemoryPointerSlot, mPtrTailNext)\n        }\n    }\n\n    /**\n     * @dev Takes a consideration array from calldata and copies it into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the consideration\n     *                    array in calldata which contains the length of the\n     *                    array.\n     *\n     * @return mPtrLength A memory pointer to the start of the consideration\n     *                    array in memory which contains the length of the\n     *                    array.\n     */\n    function _decodeConsideration(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        assembly {\n            // Retrieve length of array, masking to prevent potential overflow.\n            let arrLength := and(calldataload(cdPtrLength), OffsetOrLengthMask)\n\n            // Get the current free memory pointer.\n            mPtrLength := mload(FreeMemoryPointerSlot)\n\n            // Write the array length to memory.\n            mstore(mPtrLength, arrLength)\n\n            // Derive the head by adding one word to the length pointer.\n            let mPtrHead := add(mPtrLength, OneWord)\n\n            // Derive the tail by adding one word per element (note that structs\n            // are written to memory with an offset per struct element).\n            let mPtrTail := add(mPtrHead, shl(OneWordShift, arrLength))\n\n            // Track the next tail, beginning with the initial tail value.\n            let mPtrTailNext := mPtrTail\n\n            // Copy all consideration array data into memory at tail pointer.\n            calldatacopy(\n                mPtrTail,\n                add(cdPtrLength, OneWord),\n                mul(arrLength, ConsiderationItem_size)\n            )\n\n            // Track the next head pointer, starting with initial head value.\n            let mPtrHeadNext := mPtrHead\n\n            // Iterate over each head pointer until it reaches the tail.\n            for {\n\n            } lt(mPtrHeadNext, mPtrTail) {\n\n            } {\n                // Write the next tail pointer to next head pointer in memory.\n                mstore(mPtrHeadNext, mPtrTailNext)\n\n                // Increment the next head pointer by one word.\n                mPtrHeadNext := add(mPtrHeadNext, OneWord)\n\n                // Increment next tail pointer by size of a consideration item.\n                mPtrTailNext := add(mPtrTailNext, ConsiderationItem_size)\n            }\n\n            // Update free memory pointer to allocate memory up to end of tail.\n            mstore(FreeMemoryPointerSlot, mPtrTailNext)\n        }\n    }\n\n    /**\n     * @dev Takes a calldata pointer and memory pointer and copies a referenced\n     *      OrderParameters struct and associated offer and consideration data\n     *      to memory.\n     *\n     * @param cdPtr A calldata pointer for the OrderParameters struct.\n     * @param mPtr A memory pointer to the OrderParameters struct head.\n     */\n    function _decodeOrderParametersTo(\n        CalldataPointer cdPtr,\n        MemoryPointer mPtr\n    ) internal pure {\n        // Copy the full OrderParameters head from calldata to memory.\n        cdPtr.copy(mPtr, OrderParameters_head_size);\n\n        // Resolve the offer calldata offset, use that to decode and copy offer\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(OrderParameters_offer_head_offset).write(\n            _decodeOffer(cdPtr.pptrOffset(OrderParameters_offer_head_offset))\n        );\n\n        // Resolve consideration calldata offset, use that to copy consideration\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(OrderParameters_consideration_head_offset).write(\n            _decodeConsideration(\n                cdPtr.pptrOffset(OrderParameters_consideration_head_offset)\n            )\n        );\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an OrderParameters struct and copies the\n     *      decoded struct to memory.\n     *\n     * @param cdPtr A calldata pointer for the OrderParameters struct.\n     *\n     * @return mPtr A memory pointer to the OrderParameters struct head.\n     */\n    function _decodeOrderParameters(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate required memory for the OrderParameters head (offer and\n        // consideration are allocated independently).\n        mPtr = malloc(OrderParameters_head_size);\n\n        // Decode and copy the order parameters to the newly allocated memory.\n        _decodeOrderParametersTo(cdPtr, mPtr);\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an Order struct and copies the decoded\n     *      struct to memory.\n     *\n     * @param cdPtr A calldata pointer for the Order struct.\n     *\n     * @return mPtr A memory pointer to the Order struct head.\n     */\n    function _decodeOrder(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate required memory for the Order head (OrderParameters and\n        // signature are allocated independently).\n        mPtr = malloc(Order_head_size);\n\n        // Resolve OrderParameters calldata offset, use it to decode and copy\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.write(_decodeOrderParameters(cdPtr.pptr()));\n\n        // Resolve signature calldata offset, use that to decode and copy from\n        // calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(Order_signature_offset).write(\n            _decodeBytes(cdPtr.pptrOffset(Order_signature_offset))\n        );\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an AdvancedOrder struct and copies the\n     *      decoded struct to memory.\n     *\n     * @param cdPtr A calldata pointer for the AdvancedOrder struct.\n     *\n     * @return mPtr A memory pointer to the AdvancedOrder struct head.\n     */\n    function _decodeAdvancedOrder(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate memory for AdvancedOrder head and OrderParameters head.\n        mPtr = malloc(AdvancedOrderPlusOrderParameters_head_size);\n\n        // Use numerator + denominator calldata offset to decode and copy\n        // from calldata and write resultant memory offset to head in memory.\n        cdPtr.offset(AdvancedOrder_numerator_offset).copy(\n            mPtr.offset(AdvancedOrder_numerator_offset),\n            AdvancedOrder_fixed_segment_0\n        );\n\n        // Get pointer to memory immediately after advanced order.\n        MemoryPointer mPtrParameters = mPtr.offset(AdvancedOrder_head_size);\n\n        // Write pptr for advanced order parameters to memory.\n        mPtr.write(mPtrParameters);\n\n        // Resolve OrderParameters calldata pointer & write to allocated region.\n        _decodeOrderParametersTo(cdPtr.pptr(), mPtrParameters);\n\n        // Resolve signature calldata offset, use that to decode and copy from\n        // calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(AdvancedOrder_signature_offset).write(\n            _decodeBytes(cdPtr.pptrOffset(AdvancedOrder_signature_offset))\n        );\n\n        // Resolve extraData calldata offset, use that to decode and copy from\n        // calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(AdvancedOrder_extraData_offset).write(\n            _decodeBytes(cdPtr.pptrOffset(AdvancedOrder_extraData_offset))\n        );\n    }\n\n    /**\n     * @dev Allocates a single word of empty bytes in memory and returns the\n     *      pointer to that memory region.\n     *\n     * @return mPtr The memory pointer to the new empty word in memory.\n     */\n    function _getEmptyBytesOrArray()\n        internal\n        pure\n        returns (MemoryPointer mPtr)\n    {\n        mPtr = malloc(OneWord);\n        mPtr.write(0);\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an Order struct and copies the decoded\n     *      struct to memory as an AdvancedOrder.\n     *\n     * @param cdPtr A calldata pointer for the Order struct.\n     *\n     * @return mPtr A memory pointer to the AdvancedOrder struct head.\n     */\n    function _decodeOrderAsAdvancedOrder(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate memory for AdvancedOrder head and OrderParameters head.\n        mPtr = malloc(AdvancedOrderPlusOrderParameters_head_size);\n\n        // Get pointer to memory immediately after advanced order.\n        MemoryPointer mPtrParameters = mPtr.offset(AdvancedOrder_head_size);\n\n        // Write pptr for advanced order parameters.\n        mPtr.write(mPtrParameters);\n\n        // Resolve OrderParameters calldata pointer & write to allocated region.\n        _decodeOrderParametersTo(cdPtr.pptr(), mPtrParameters);\n\n        // Write default Order numerator and denominator values (i.e. 1/1).\n        mPtr.offset(AdvancedOrder_numerator_offset).write(1);\n        mPtr.offset(AdvancedOrder_denominator_offset).write(1);\n\n        // Resolve signature calldata offset, use that to decode and copy from\n        // calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(AdvancedOrder_signature_offset).write(\n            _decodeBytes(cdPtr.pptrOffset(Order_signature_offset))\n        );\n\n        // Resolve extraData calldata offset, use that to decode and copy from\n        // calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(AdvancedOrder_extraData_offset).write(\n            _getEmptyBytesOrArray()\n        );\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an array of Order structs and copies the\n     *      decoded array to memory as an array of AdvancedOrder structs.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the orders array in\n     *                    calldata which contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the array of advanced\n     *                    orders in memory which contains length of the array.\n     */\n    function _decodeOrdersAsAdvancedOrders(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve Order calldata offset, use it to decode and copy from\n                // calldata, and write resultant AdvancedOrder offset to memory.\n                mPtrHead.offset(offset).write(\n                    _decodeOrderAsAdvancedOrder(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes a calldata pointer to a criteria proof, or an array bytes32\n     *      types, and copies the decoded proof to memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the criteria proof\n     *                    in calldata which contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the criteria proof\n     *                    in memory which contains length of the array.\n     */\n    function _decodeCriteriaProof(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive array size based on one word per array element and length.\n            uint256 arrSize = (arrLength + 1) << OneWordShift;\n\n            // Allocate memory equal to the array size.\n            mPtrLength = malloc(arrSize);\n\n            // Copy the array from calldata into memory.\n            cdPtrLength.copy(mPtrLength, arrSize);\n        }\n    }\n\n    /**\n     * @dev Takes a calldata pointer to a CriteriaResolver struct and copies the\n     *      decoded struct to memory.\n     *\n     * @param cdPtr A calldata pointer for the CriteriaResolver struct.\n     *\n     * @return mPtr A memory pointer to the CriteriaResolver struct head.\n     */\n    function _decodeCriteriaResolver(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate required memory for the CriteriaResolver head (the criteria\n        // proof bytes32 array is allocated independently).\n        mPtr = malloc(CriteriaResolver_head_size);\n\n        // Decode and copy order index, side, index, and identifier from\n        // calldata and write resultant memory offset to head in memory.\n        cdPtr.copy(mPtr, CriteriaResolver_fixed_segment_0);\n\n        // Resolve criteria proof calldata offset, use it to decode and copy\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(CriteriaResolver_criteriaProof_offset).write(\n            _decodeCriteriaProof(\n                cdPtr.pptrOffset(CriteriaResolver_criteriaProof_offset)\n            )\n        );\n    }\n\n    /**\n     * @dev Takes an array of criteria resolvers from calldata and copies it\n     *      into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the criteria\n     *                    resolver array in calldata which contains the length\n     *                    of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the criteria resolver\n     *                    array in memory which contains the length of the\n     *                    array.\n     */\n    function _decodeCriteriaResolvers(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve CriteriaResolver calldata offset, use it to decode\n                // and copy from calldata, and write resultant memory offset.\n                mPtrHead.offset(offset).write(\n                    _decodeCriteriaResolver(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes an array of orders from calldata and copies it into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the orders array in\n     *                    calldata which contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the orders array\n     *                    in memory which contains the length of the array.\n     */\n    function _decodeOrders(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve Order calldata offset, use it to decode and copy\n                // from calldata, and write resultant memory offset.\n                mPtrHead.offset(offset).write(\n                    _decodeOrder(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes an array of fulfillment components from calldata and copies it\n     *      into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the fulfillment\n     *                    components array in calldata which contains the length\n     *                    of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the fulfillment\n     *                    components array in memory which contains the length\n     *                    of the array.\n     */\n    function _decodeFulfillmentComponents(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        assembly {\n            let arrLength := and(calldataload(cdPtrLength), OffsetOrLengthMask)\n\n            // Get the current free memory pointer.\n            mPtrLength := mload(FreeMemoryPointerSlot)\n\n            mstore(mPtrLength, arrLength)\n            let mPtrHead := add(mPtrLength, OneWord)\n            let mPtrTail := add(mPtrHead, shl(OneWordShift, arrLength))\n            let mPtrTailNext := mPtrTail\n            calldatacopy(\n                mPtrTail,\n                add(cdPtrLength, OneWord),\n                shl(FulfillmentComponent_mem_tail_size_shift, arrLength)\n            )\n            let mPtrHeadNext := mPtrHead\n            for {\n\n            } lt(mPtrHeadNext, mPtrTail) {\n\n            } {\n                mstore(mPtrHeadNext, mPtrTailNext)\n                mPtrHeadNext := add(mPtrHeadNext, OneWord)\n                mPtrTailNext := add(\n                    mPtrTailNext,\n                    FulfillmentComponent_mem_tail_size\n                )\n            }\n\n            // Update the free memory pointer.\n            mstore(FreeMemoryPointerSlot, mPtrTailNext)\n        }\n    }\n\n    /**\n     * @dev Takes a nested array of fulfillment components from calldata and\n     *      copies it into memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the nested\n     *                    fulfillment components array in calldata which\n     *                    contains the length of the array.\n     *\n     * @return mPtrLength A memory pointer to the start of the nested\n     *                    fulfillment components array in memory which\n     *                    contains the length of the array.\n     */\n    function _decodeNestedFulfillmentComponents(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve FulfillmentComponents array calldata offset, use it\n                // to decode and copy from calldata, and write memory offset.\n                mPtrHead.offset(offset).write(\n                    _decodeFulfillmentComponents(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes an array of advanced orders from calldata and copies it into\n     *      memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the advanced orders\n     *                    array in calldata which contains the length of the\n     *                    array.\n     *\n     * @return mPtrLength A memory pointer to the start of the advanced orders\n     *                    array in memory which contains the length of the\n     *                    array.\n     */\n    function _decodeAdvancedOrders(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve AdvancedOrder calldata offset, use it to decode and\n                // copy from calldata, and write resultant memory offset.\n                mPtrHead.offset(offset).write(\n                    _decodeAdvancedOrder(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes a calldata pointer to a Fulfillment struct and copies the\n     *      decoded struct to memory.\n     *\n     * @param cdPtr A calldata pointer for the Fulfillment struct.\n     *\n     * @return mPtr A memory pointer to the Fulfillment struct head.\n     */\n    function _decodeFulfillment(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate required memory for the Fulfillment head (the fulfillment\n        // components arrays are allocated independently).\n        mPtr = malloc(Fulfillment_head_size);\n\n        // Resolve offerComponents calldata offset, use it to decode and copy\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.write(_decodeFulfillmentComponents(cdPtr.pptr()));\n\n        // Resolve considerationComponents calldata offset, use it to decode and\n        // copy from calldata, and write resultant memory offset to memory head.\n        mPtr.offset(Fulfillment_considerationComponents_offset).write(\n            _decodeFulfillmentComponents(\n                cdPtr.pptrOffset(Fulfillment_considerationComponents_offset)\n            )\n        );\n    }\n\n    /**\n     * @dev Takes an array of fulfillments from calldata and copies it into\n     *      memory.\n     *\n     * @param cdPtrLength A calldata pointer to the start of the fulfillments\n     *                    array in calldata which contains the length of the\n     *                    array.\n     *\n     * @return mPtrLength A memory pointer to the start of the fulfillments\n     *                    array in memory which contains the length of the\n     *                    array.\n     */\n    function _decodeFulfillments(\n        CalldataPointer cdPtrLength\n    ) internal pure returns (MemoryPointer mPtrLength) {\n        // Retrieve length of array, masking to prevent potential overflow.\n        uint256 arrLength = cdPtrLength.readMaskedUint256();\n\n        unchecked {\n            // Derive offset to the tail based on one word per array element.\n            uint256 tailOffset = arrLength << OneWordShift;\n\n            // Add one additional word for the length and allocate memory.\n            mPtrLength = malloc(tailOffset + OneWord);\n\n            // Write the length of the array to memory.\n            mPtrLength.write(arrLength);\n\n            // Advance to first memory & calldata pointers (e.g. after length).\n            MemoryPointer mPtrHead = mPtrLength.next();\n            CalldataPointer cdPtrHead = cdPtrLength.next();\n\n            // Iterate over each pointer, word by word, until tail is reached.\n            for (uint256 offset = 0; offset < tailOffset; offset += OneWord) {\n                // Resolve Fulfillment calldata offset, use it to decode and\n                // copy from calldata, and write resultant memory offset.\n                mPtrHead.offset(offset).write(\n                    _decodeFulfillment(cdPtrHead.pptrOffset(offset))\n                );\n            }\n        }\n    }\n\n    /**\n     * @dev Takes a calldata pointer to an OrderComponents struct and copies the\n     *      decoded struct to memory as an OrderParameters struct (with the\n     *      totalOriginalConsiderationItems value set equal to the length of the\n     *      supplied consideration array).\n     *\n     * @param cdPtr A calldata pointer for the OrderComponents struct.\n     *\n     * @return mPtr A memory pointer to the OrderParameters struct head.\n     */\n    function _decodeOrderComponentsAsOrderParameters(\n        CalldataPointer cdPtr\n    ) internal pure returns (MemoryPointer mPtr) {\n        // Allocate memory for the OrderParameters head.\n        mPtr = malloc(OrderParameters_head_size);\n\n        // Copy the full OrderComponents head from calldata to memory.\n        cdPtr.copy(mPtr, OrderComponents_OrderParameters_common_head_size);\n\n        // Resolve the offer calldata offset, use that to decode and copy offer\n        // from calldata, and write resultant memory offset to head in memory.\n        mPtr.offset(OrderParameters_offer_head_offset).write(\n            _decodeOffer(cdPtr.pptrOffset(OrderParameters_offer_head_offset))\n        );\n\n        // Resolve consideration calldata offset, use that to copy consideration\n        // from calldata, and write resultant memory offset to head in memory.\n        MemoryPointer consideration = _decodeConsideration(\n            cdPtr.pptrOffset(OrderParameters_consideration_head_offset)\n        );\n        mPtr.offset(OrderParameters_consideration_head_offset).write(\n            consideration\n        );\n\n        // Write masked consideration length to totalOriginalConsiderationItems.\n        mPtr\n            .offset(OrderParameters_totalOriginalConsiderationItems_offset)\n            .write(consideration.readUint256());\n    }\n\n    /**\n     * @dev Decodes the returndata from a call to generateOrder, or returns\n     *      empty arrays and a boolean signifying that the returndata does not\n     *      adhere to a valid encoding scheme if it cannot be decoded. Note\n     *      that this function expects that original offer and consideration\n     *      item arrays have been modified and repurposed to resemble spent\n     *      and received item arrays; specifically, the recipient should be\n     *      in the endAmount location on consideration items and the derived\n     *      amount should be in the startAmount location for both item types.\n     *\n     * @return invalidEncoding A boolean signifying whether the returndata has\n     *                         an invalid encoding.\n     * @return offer           The decoded offer array.\n     * @return consideration   The decoded consideration array.\n     */\n    function _decodeGenerateOrderReturndata(\n        MemoryPointer originalOffer,\n        MemoryPointer originalConsideration\n    )\n        internal\n        pure\n        returns (\n            uint256 invalidEncoding,\n            MemoryPointer offer,\n            MemoryPointer consideration\n        )\n    {\n        assembly {\n            // Check that returndatasize is at least three words:\n            // 1. offerOffset\n            // 2. considerationOffset\n            // 3. offerLength & considerationLength might occupy just one word\n            //    if offerOffset & considerationOffset would point to the same\n            //    offset and the arrays have length 0.\n            invalidEncoding := lt(returndatasize(), ThreeWords)\n\n            let offsetOffer\n            let offsetConsideration\n            let offerLength\n            let considerationLength\n\n            // Proceed if enough returndata is present to continue evaluation.\n            if iszero(invalidEncoding) {\n                // Copy first two words of returndata (the offsets to offer and\n                // consideration array lengths) to scratch space.\n                returndatacopy(0, 0, TwoWords)\n                offsetOffer := mload(0)\n                offsetConsideration := mload(OneWord)\n\n                // If valid length, check that offsets word boundaries are\n                // within returndata.\n                let invalidOfferOffset := gt(\n                    add(offsetOffer, OneWord),\n                    returndatasize()\n                )\n                let invalidConsiderationOffset := gt(\n                    add(offsetConsideration, OneWord),\n                    returndatasize()\n                )\n\n                // Only proceed if length (and thus encoding) is valid so far.\n                invalidEncoding := or(\n                    invalidOfferOffset,\n                    invalidConsiderationOffset\n                )\n                if iszero(invalidEncoding) {\n                    // Copy length of offer array to scratch space.\n                    returndatacopy(0, offsetOffer, OneWord)\n                    offerLength := mload(0)\n\n                    // Copy length of consideration array to scratch space.\n                    returndatacopy(OneWord, offsetConsideration, OneWord)\n                    considerationLength := mload(OneWord)\n\n                    {\n                        // Derive end offsets for offer & consideration arrays.\n                        let offerEndOffset := add(\n                            add(offsetOffer, OneWord),\n                            shl(SpentItem_size_shift, offerLength)\n                        )\n                        let considerationEndOffset := add(\n                            add(offsetConsideration, OneWord),\n                            mul(ReceivedItem_size, considerationLength)\n                        )\n\n                        // Don't continue if either offer or consideration\n                        // length exceeds 65535 or if returndatasize is less\n                        // than the end offsets.\n                        invalidEncoding := or(\n                            gt(\n                                or(offerLength, considerationLength),\n                                generateOrder_maximum_returned_array_length\n                            ),\n                            or(\n                                lt(returndatasize(), offerEndOffset),\n                                lt(returndatasize(), considerationEndOffset)\n                            )\n                        )\n\n                        // Set first word of scratch space to 0 so length of\n                        // offer/consideration are set to 0 on invalid encoding.\n                        mstore(0, 0)\n                    }\n                }\n            }\n\n            if iszero(invalidEncoding) {\n                let invalidSpentItems, invalidReceivedItems\n                offer, invalidSpentItems := copySpentItemsAsOfferItems(\n                    originalOffer,\n                    add(offsetOffer, OneWord),\n                    offerLength\n                )\n\n                consideration, invalidReceivedItems :=\n                    copyReceivedItemsAsConsiderationItems(\n                        originalConsideration,\n                        add(offsetConsideration, OneWord),\n                        considerationLength\n                    )\n\n                invalidEncoding := or(invalidSpentItems, invalidReceivedItems)\n            }\n\n            function copySpentItemsAsOfferItems(\n                mPtrLengthOriginal,\n                rdPtrHeadSpentItems,\n                length\n            ) -> mPtrLength, invalidSpentItems {\n                // Retrieve the current free memory pointer.\n                mPtrLength := mload(FreeMemoryPointerSlot)\n\n                // Cache the original offer array length\n                let originalOfferLength := mload(mPtrLengthOriginal)\n\n                // Allocate memory for the new array.\n                mstore(\n                    FreeMemoryPointerSlot,\n                    add(\n                        mPtrLength,\n                        add(\n                            OneWord,\n                            mul(length, OfferItem_size_with_head_pointer)\n                        )\n                    )\n                )\n\n                // Write the length of the array to the start of free memory.\n                mstore(mPtrLength, length)\n\n                // Use offset from length to minimize stack depth.\n                let headOffsetFromLength := OneWord\n                let headSizeWithLength := shl(OneWordShift, add(1, length))\n                let mPtrTailNext := add(mPtrLength, headSizeWithLength)\n                let mPtrTailOriginalNext := add(\n                    mPtrLengthOriginal,\n                    shl(OneWordShift, add(1, originalOfferLength))\n                )\n\n                let headSizeToCompareWithLength := shl(\n                    OneWordShift,\n                    add(1, min(length, originalOfferLength))\n                )\n\n                // Iterate over each new element with a corresponding original\n                // item. For each original offer item, check that:\n                // - There is a corresponding new spent item.\n                // - The original and new items match with compareItems.\n                // - The new offer item amount >= original amount.\n                invalidSpentItems := gt(originalOfferLength, length)\n                for {\n\n                } lt(headOffsetFromLength, headSizeToCompareWithLength) {\n\n                } {\n                    // Write the memory pointer to the accompanying head offset.\n                    mstore(add(mPtrLength, headOffsetFromLength), mPtrTailNext)\n\n                    // Copy itemType, token, identifier and amount.\n                    returndatacopy(\n                        mPtrTailNext,\n                        rdPtrHeadSpentItems,\n                        SpentItem_size\n                    )\n\n                    let newAmount := mload(\n                        add(mPtrTailNext, Common_amount_offset)\n                    )\n\n                    // Copy amount to endAmount.\n                    mstore(\n                        add(mPtrTailNext, Common_endAmount_offset),\n                        newAmount\n                    )\n\n                    let originalAmount := mload(\n                        add(mPtrTailOriginalNext, Common_amount_offset)\n                    )\n                    invalidSpentItems := or(\n                        invalidSpentItems,\n                        or(\n                            compareItems(mPtrTailOriginalNext, mPtrTailNext),\n                            gt(originalAmount, newAmount)\n                        )\n                    )\n\n                    // Update read pointer, next tail pointer for new and\n                    // original, and head offset.\n                    rdPtrHeadSpentItems := add(\n                        rdPtrHeadSpentItems,\n                        SpentItem_size\n                    )\n                    mPtrTailNext := add(mPtrTailNext, OfferItem_size)\n                    mPtrTailOriginalNext := add(\n                        mPtrTailOriginalNext,\n                        OfferItem_size\n                    )\n                    headOffsetFromLength := add(headOffsetFromLength, OneWord)\n                }\n\n                // Iterate over each element without corresponding original item\n                for {\n\n                } lt(headOffsetFromLength, headSizeWithLength) {\n\n                } {\n                    // Write the memory pointer to the accompanying head offset.\n                    mstore(add(mPtrLength, headOffsetFromLength), mPtrTailNext)\n\n                    // Copy itemType, token, identifier and amount.\n                    returndatacopy(\n                        mPtrTailNext,\n                        rdPtrHeadSpentItems,\n                        SpentItem_size\n                    )\n\n                    // Copy amount to endAmount.\n                    mstore(\n                        add(mPtrTailNext, Common_endAmount_offset),\n                        mload(add(mPtrTailNext, Common_amount_offset))\n                    )\n\n                    // Update read pointer, next tail pointer, and head offset.\n                    rdPtrHeadSpentItems := add(\n                        rdPtrHeadSpentItems,\n                        SpentItem_size\n                    )\n                    mPtrTailNext := add(mPtrTailNext, OfferItem_size)\n                    headOffsetFromLength := add(headOffsetFromLength, OneWord)\n                }\n            }\n\n            function copyReceivedItemsAsConsiderationItems(\n                mPtrLengthOriginal,\n                rdPtrHeadReceivedItems,\n                length\n            ) -> mPtrLength, invalidReceivedItems {\n                // Retrieve the current free memory pointer.\n                mPtrLength := mload(FreeMemoryPointerSlot)\n                // Cache the original consideration array length\n                let originalConsiderationLength := mload(mPtrLengthOriginal)\n\n                // Ensure returned array length does not exceed original length.\n                invalidReceivedItems := gt(length, originalConsiderationLength)\n\n                // Derive the length of the new array in memory, capped by the\n                // original consideration array length.\n                let newLength := min(length, originalConsiderationLength)\n\n                // Allocate memory for the array. Note that memory does not need\n                // to be allocated for new elements without a corresponding\n                // original item as the new array will be invalid if its length\n                // exceeds the original array length.\n                mstore(\n                    FreeMemoryPointerSlot,\n                    add(\n                        mPtrLength,\n                        add(\n                            OneWord,\n                            mul(\n                                newLength,\n                                ConsiderationItem_size_with_head_pointer\n                            )\n                        )\n                    )\n                )\n\n                // Write the length of the array to the start of free memory.\n                mstore(mPtrLength, newLength)\n\n                // Use offset from length to minimize stack depth.\n                let headOffsetFromLength := OneWord\n                let mPtrTailNext := add(\n                    mPtrLength,\n                    shl(OneWordShift, add(1, newLength))\n                )\n                let mPtrTailOriginalNext := add(\n                    mPtrLengthOriginal,\n                    shl(OneWordShift, add(1, originalConsiderationLength))\n                )\n\n                let headSizeToCompareWithLength := shl(\n                    OneWordShift,\n                    add(1, newLength)\n                )\n\n                // Iterate over each new element with a corresponding original\n                // item. For each new received item, check that:\n                // - The new & original items match according to compareItems.\n                // - The new consideration item amount <= the original amount.\n                // - The items have the same recipient if original != null.\n                for {\n\n                } lt(headOffsetFromLength, headSizeToCompareWithLength) {\n\n                } {\n                    // Write the memory pointer to the accompanying head offset.\n                    mstore(add(mPtrLength, headOffsetFromLength), mPtrTailNext)\n\n                    // Copy itemType, token, identifier, amount and recipient.\n                    returndatacopy(\n                        mPtrTailNext,\n                        rdPtrHeadReceivedItems,\n                        ReceivedItem_size\n                    )\n\n                    // Copy amount to consideration item's recipient offset.\n                    returndatacopy(\n                        add(mPtrTailNext, ConsiderationItem_recipient_offset),\n                        add(rdPtrHeadReceivedItems, Common_amount_offset),\n                        OneWord\n                    )\n\n                    // Retrieve both the new and original item amounts.\n                    let newAmount := mload(\n                        add(mPtrTailNext, Common_amount_offset)\n                    )\n                    let originalAmount := mload(\n                        add(mPtrTailOriginalNext, Common_amount_offset)\n                    )\n\n                    // Compare items' item type, token, and identifier, ensure\n                    // they have the same recipient and that the new amount is\n                    // less than or equal to the original amount. The original\n                    // recipient must already be present at the ReceivedItem\n                    // recipient offset rather than at the initial\n                    // ConsiderationItem recipient offset.\n                    invalidReceivedItems := or(\n                        invalidReceivedItems,\n                        or(\n                            compareItems(mPtrTailOriginalNext, mPtrTailNext),\n                            or(\n                                gt(newAmount, originalAmount),\n                                checkRecipients(\n                                    mload(\n                                        add(\n                                            mPtrTailOriginalNext,\n                                            ReceivedItem_recipient_offset\n                                        )\n                                    ),\n                                    mload(\n                                        add(\n                                            mPtrTailNext,\n                                            ReceivedItem_recipient_offset\n                                        )\n                                    )\n                                )\n                            )\n                        )\n                    )\n\n                    // Update read pointer, next tail pointer, and head offset.\n                    rdPtrHeadReceivedItems := add(\n                        rdPtrHeadReceivedItems,\n                        ReceivedItem_size\n                    )\n                    mPtrTailNext := add(mPtrTailNext, ConsiderationItem_size)\n                    mPtrTailOriginalNext := add(\n                        mPtrTailOriginalNext,\n                        ConsiderationItem_size\n                    )\n                    headOffsetFromLength := add(headOffsetFromLength, OneWord)\n                }\n\n                // Note: skip copying new elements without a corresponding\n                // original item as the new array will be invalid if its length\n                // exceeds the original array length.\n            }\n\n            /**\n             * @dev Yul function to check the compatibility of two offer or\n             *      consideration items for contract orders.  Note that the\n             *      itemType and identifier are reset in cases where criteria is\n             *      equal to 0 (collection-wide or \"wildcard\" items), which\n             *      means that a contract offerer has full latitude to choose\n             *      any identifier it wants mid-flight, in contrast to the usual\n             *      behavior, where the fulfiller can pick which identifier to\n             *      receive by providing a CriteriaResolver.\n             *\n             * @param originalItem The original offer or consideration item.\n             * @param newItem      The new offer or consideration item.\n             *\n             * @return isInvalid Error buffer indicating whether or not the\n             *                   items are incompatible.\n             */\n            function compareItems(originalItem, newItem) -> isInvalid {\n                let itemType := mload(originalItem)\n                let identifier := mload(\n                    add(originalItem, Common_identifier_offset)\n                )\n\n                // Use returned identifier for criteria-based items with a\n                // criteria value of 0 (collection-wide or \"wildcard\" items).\n                if and(gt(itemType, 3), iszero(identifier)) {\n                    // Replace item type with non-criteria equivalent.\n                    itemType := sub(itemType, 2)\n\n                    // Replace identifier with the returned identifier.\n                    identifier := mload(add(newItem, Common_identifier_offset))\n                }\n\n                isInvalid := iszero(\n                    and(\n                        // originalItem.token == newItem.token &&\n                        // originalItem.itemType == newItem.itemType\n                        and(\n                            eq(\n                                mload(add(originalItem, Common_token_offset)),\n                                mload(add(newItem, Common_token_offset))\n                            ),\n                            eq(itemType, mload(newItem))\n                        ),\n                        // originalItem.identifier == newItem.identifier\n                        eq(\n                            identifier,\n                            mload(add(newItem, Common_identifier_offset))\n                        )\n                    )\n                )\n            }\n\n            /**\n             * @dev Internal pure function to check the compatibility of two\n             *      recipients on consideration items for contract orders. This\n             *      check is skipped if no recipient is originally supplied.\n             *\n             * @param originalRecipient The original consideration item\n             *                          recipient.\n             * @param newRecipient      The new consideration item recipient.\n             *\n             * @return isInvalid Error buffer indicating whether or not the\n             *                   two recipients are incompatible.\n             */\n            function checkRecipients(originalRecipient, newRecipient)\n                -> isInvalid\n            {\n                isInvalid := iszero(\n                    or(\n                        iszero(originalRecipient),\n                        eq(newRecipient, originalRecipient)\n                    )\n                )\n            }\n\n            function min(a, b) -> c {\n                c := add(b, mul(lt(a, b), sub(a, b)))\n            }\n        }\n    }\n\n    /**\n     * @dev Converts a function returning _decodeGenerateOrderReturndata types\n     *      into a function returning offer and consideration types.\n     *\n     * @param inFn The input function, taking no arguments and returning an\n     *             error buffer, spent item array, and received item array.\n     *\n     * @return outFn The output function, taking no arguments and returning an\n     *               error buffer, offer array, and consideration array.\n     */\n    function _convertGetGeneratedOrderResult(\n        function(MemoryPointer, MemoryPointer)\n            internal\n            pure\n            returns (uint256, MemoryPointer, MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(OfferItem[] memory, ConsiderationItem[] memory)\n                internal\n                pure\n                returns (\n                    uint256,\n                    OfferItem[] memory,\n                    ConsiderationItem[] memory\n                ) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking ReceivedItem, address, bytes32, and bytes\n     *      types (e.g. the _transfer function) into a function taking\n     *      OfferItem, address, bytes32, and bytes types.\n     *\n     * @param inFn The input function, taking ReceivedItem, address, bytes32,\n     *             and bytes types (e.g. the _transfer function).\n     *\n     * @return outFn The output function, taking OfferItem, address, bytes32,\n     *               and bytes types.\n     */\n    function _toOfferItemInput(\n        function(ReceivedItem memory, address, bytes32, bytes memory)\n            internal inFn\n    )\n        internal\n        pure\n        returns (\n            function(OfferItem memory, address, bytes32, bytes memory)\n                internal outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking ReceivedItem, address, bytes32, and bytes\n     *      types (e.g. the _transfer function) into a function taking\n     *      ConsiderationItem, address, bytes32, and bytes types.\n     *\n     * @param inFn The input function, taking ReceivedItem, address, bytes32,\n     *             and bytes types (e.g. the _transfer function).\n     *\n     * @return outFn The output function, taking ConsiderationItem, address,\n     *               bytes32, and bytes types.\n     */\n    function _toConsiderationItemInput(\n        function(ReceivedItem memory, address, bytes32, bytes memory)\n            internal inFn\n    )\n        internal\n        pure\n        returns (\n            function(ConsiderationItem memory, address, bytes32, bytes memory)\n                internal outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a bytes type.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a bytes type.\n     */\n    function _toBytesReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer) internal pure returns (bytes memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      an OrderParameters type.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning an OrderParameters type.\n     */\n    function _toOrderParametersReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (OrderParameters memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      an AdvancedOrder type.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning an AdvancedOrder type.\n     */\n    function _toAdvancedOrderReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (AdvancedOrder memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a dynamic array of CriteriaResolver types.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a dynamic array of CriteriaResolver types.\n     */\n    function _toCriteriaResolversReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (CriteriaResolver[] memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a dynamic array of Order types.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a dynamic array of Order types.\n     */\n    function _toOrdersReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (Order[] memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a nested dynamic array of dynamic arrays of FulfillmentComponent\n     *      types.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a nested dynamic array of dynamic arrays of\n     *               FulfillmentComponent types.\n     */\n    function _toNestedFulfillmentComponentsReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (FulfillmentComponent[][] memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a dynamic array of AdvancedOrder types.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a dynamic array of AdvancedOrder types.\n     */\n    function _toAdvancedOrdersReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (AdvancedOrder[] memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Converts a function taking a calldata pointer and returning a memory\n     *      pointer into a function taking that calldata pointer and returning\n     *      a dynamic array of Fulfillment types.\n     *\n     * @param inFn The input function, taking an arbitrary calldata pointer and\n     *             returning an arbitrary memory pointer.\n     *\n     * @return outFn The output function, taking an arbitrary calldata pointer\n     *               and returning a dynamic array of Fulfillment types.\n     */\n    function _toFulfillmentsReturnType(\n        function(CalldataPointer) internal pure returns (MemoryPointer) inFn\n    )\n        internal\n        pure\n        returns (\n            function(CalldataPointer)\n                internal\n                pure\n                returns (Fulfillment[] memory) outFn\n        )\n    {\n        assembly {\n            outFn := inFn\n        }\n    }\n\n    /**\n     * @dev Caches the endAmount in an offer item and replaces it with\n     * a given recipient so that its memory may be reused as a temporary\n     * ReceivedItem.\n     *\n     * @param offerItem The offer item.\n     * @param recipient The recipient.\n     *\n     * @return originalEndAmount The original end amount.\n     */\n    function _replaceEndAmountWithRecipient(\n        OfferItem memory offerItem,\n        address recipient\n    ) internal pure returns (uint256 originalEndAmount) {\n        assembly {\n            // Derive the pointer to the end amount on the offer item.\n            let endAmountPtr := add(offerItem, ReceivedItem_recipient_offset)\n\n            // Retrieve the value of the end amount on the offer item.\n            originalEndAmount := mload(endAmountPtr)\n\n            // Write recipient to received item at the offer end amount pointer.\n            mstore(endAmountPtr, recipient)\n        }\n    }\n}\n"},"src/lib/ConsiderationEncoder.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    authorizeOrder_calldata_baseOffset,\n    authorizeOrder_head_offset,\n    authorizeOrder_selector_offset,\n    authorizeOrder_selector,\n    authorizeOrder_zoneParameters_offset,\n    BasicOrder_addlRecipients_length_cdPtr,\n    BasicOrder_common_params_size,\n    BasicOrder_consideration_offset_from_offer,\n    BasicOrder_offerer_cdPtr,\n    BasicOrder_startTime_cdPtr,\n    BasicOrder_startTimeThroughZoneHash_size,\n    BasicOrder_totalOriginalAdditionalRecipients_cdPtr,\n    Common_amount_offset,\n    Common_identifier_offset,\n    Common_token_offset,\n    generateOrder_base_tail_offset,\n    generateOrder_context_head_offset,\n    generateOrder_head_offset,\n    generateOrder_maximumSpent_head_offset,\n    generateOrder_minimumReceived_head_offset,\n    generateOrder_selector_offset,\n    generateOrder_selector,\n    OneWord,\n    OneWordShift,\n    OnlyFullWordMask,\n    OrderFulfilled_baseDataSize,\n    OrderFulfilled_offer_length_baseOffset,\n    OrderParameters_consideration_head_offset,\n    OrderParameters_endTime_offset,\n    OrderParameters_offer_head_offset,\n    OrderParameters_startTime_offset,\n    OrderParameters_zoneHash_offset,\n    ratifyOrder_base_tail_offset,\n    ratifyOrder_consideration_head_offset,\n    ratifyOrder_context_head_offset,\n    ratifyOrder_contractNonce_offset,\n    ratifyOrder_head_offset,\n    ratifyOrder_orderHashes_head_offset,\n    ratifyOrder_selector_offset,\n    ratifyOrder_selector,\n    ReceivedItem_size,\n    Selector_length,\n    SixtyThreeBytes,\n    SpentItem_size_shift,\n    SpentItem_size,\n    validateOrder_selector,\n    validateOrder_selector_offset,\n    ZoneParameters_base_tail_offset,\n    ZoneParameters_basicOrderFixedElements_length,\n    ZoneParameters_consideration_head_offset,\n    ZoneParameters_endTime_offset,\n    ZoneParameters_extraData_head_offset,\n    ZoneParameters_fulfiller_offset,\n    ZoneParameters_offer_head_offset,\n    ZoneParameters_offerer_offset,\n    ZoneParameters_orderHashes_head_offset,\n    ZoneParameters_selectorAndPointer_length,\n    ZoneParameters_startTime_offset,\n    ZoneParameters_zoneHash_offset\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    BasicOrderParameters,\n    OrderParameters\n} from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n    CalldataPointer,\n    getFreeMemoryPointer,\n    setFreeMemoryPointer,\n    MemoryPointer,\n    OffsetOrLengthMask\n} from \"seaport-types/src/helpers/PointerLibraries.sol\";\n\ncontract ConsiderationEncoder {\n    /**\n     * @dev Takes a bytes array and casts it to a memory pointer.\n     *\n     * @param obj A bytes array in memory.\n     *\n     * @return ptr A memory pointer to the start of the bytes array in memory.\n     */\n    function toMemoryPointer(\n        bytes memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Takes an array of bytes32 types and casts it to a memory pointer.\n     *\n     * @param obj An array of bytes32 types in memory.\n     *\n     * @return ptr A memory pointer to the start of the array of bytes32 types\n     *             in memory.\n     */\n    function toMemoryPointer(\n        bytes32[] memory obj\n    ) internal pure returns (MemoryPointer ptr) {\n        assembly {\n            ptr := obj\n        }\n    }\n\n    /**\n     * @dev Takes a bytes array in memory and copies it to a new location in\n     *      memory.\n     *\n     * @param src A memory pointer referencing the bytes array to be copied (and\n     *            pointing to the length of the bytes array).\n     * @param src A memory pointer referencing the location in memory to copy\n     *            the bytes array to (and pointing to the length of the copied\n     *            bytes array).\n     *\n     * @return size The size of the bytes array.\n     */\n    function _encodeBytes(\n        MemoryPointer src,\n        MemoryPointer dst\n    ) internal view returns (uint256 size) {\n        unchecked {\n            // Mask the length of the bytes array to protect against overflow\n            // and round up to the nearest word.\n            // Note: `size` also includes the 1 word that stores the length.\n            size = (src.readUint256() + SixtyThreeBytes) & OnlyFullWordMask;\n\n            // Copy the bytes array to the new memory location.\n            src.copy(dst, size);\n        }\n    }\n\n    /**\n     * @dev Takes an OrderParameters struct and a context bytes array in memory\n     *      and encodes it as `generateOrder` calldata.\n     *\n     * @param orderParameters The OrderParameters struct used to construct the\n     *                        encoded `generateOrder` calldata.\n     * @param context         The context bytes array used to construct the\n     *                        encoded `generateOrder` calldata.\n     *\n     * @return dst  A memory pointer referencing the encoded `generateOrder`\n     *              calldata.\n     * @return size The size of the bytes array.\n     */\n    function _encodeGenerateOrder(\n        OrderParameters memory orderParameters,\n        bytes memory context\n    ) internal view returns (MemoryPointer dst, uint256 size) {\n        // Get the memory pointer for the OrderParameters struct.\n        MemoryPointer src = orderParameters.toMemoryPointer();\n\n        // Get free memory pointer to write calldata to.\n        dst = getFreeMemoryPointer();\n\n        // Write generateOrder selector and get pointer to start of calldata.\n        dst.write(generateOrder_selector);\n        dst = dst.offset(generateOrder_selector_offset);\n\n        // Get pointer to the beginning of the encoded data.\n        MemoryPointer dstHead = dst.offset(generateOrder_head_offset);\n\n        // Write `fulfiller` to calldata.\n        dstHead.write(msg.sender);\n\n        // Initialize tail offset, used to populate the minimumReceived array.\n        uint256 tailOffset = generateOrder_base_tail_offset;\n\n        // Write offset to minimumReceived.\n        dstHead.offset(generateOrder_minimumReceived_head_offset).write(\n            tailOffset\n        );\n\n        // Get memory pointer to `orderParameters.offer.length`.\n        MemoryPointer srcOfferPointer = src\n            .offset(OrderParameters_offer_head_offset)\n            .readMemoryPointer();\n\n        // Encode the offer array as a `SpentItem[]`.\n        uint256 minimumReceivedSize = _encodeSpentItems(\n            srcOfferPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate maximumSpent array.\n            tailOffset += minimumReceivedSize;\n        }\n\n        // Write offset to maximumSpent.\n        dstHead.offset(generateOrder_maximumSpent_head_offset).write(\n            tailOffset\n        );\n\n        // Get memory pointer to `orderParameters.consideration.length`.\n        MemoryPointer srcConsiderationPointer = src\n            .offset(OrderParameters_consideration_head_offset)\n            .readMemoryPointer();\n\n        // Encode the consideration array as a `SpentItem[]`.\n        uint256 maximumSpentSize = _encodeSpentItems(\n            srcConsiderationPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate context array.\n            tailOffset += maximumSpentSize;\n        }\n\n        // Write offset to context.\n        dstHead.offset(generateOrder_context_head_offset).write(tailOffset);\n\n        // Get memory pointer to context.\n        MemoryPointer srcContext = toMemoryPointer(context);\n\n        // Encode context as a bytes array.\n        uint256 contextSize = _encodeBytes(\n            srcContext,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment the tail offset, now used to determine final size.\n            tailOffset += contextSize;\n\n            // Derive the final size by including the selector.\n            size = Selector_length + tailOffset;\n        }\n    }\n\n    /**\n     * @dev Takes an order hash (e.g. offerer shifted 96 bits to the left XOR'd\n     *      with the contract nonce in the case of contract orders), an\n     *      OrderParameters struct, context bytes array, and an array of order\n     *      hashes for each order included as part of the current fulfillment\n     *      and encodes it as `ratifyOrder` calldata.\n     *\n     * @param orderHash       The order hash (e.g. shl(0x60, offerer) ^ nonce).\n     * @param orderParameters The OrderParameters struct used to construct the\n     *                        encoded `ratifyOrder` calldata.\n     * @param context         The context bytes array used to construct the\n     *                        encoded `ratifyOrder` calldata.\n     * @param orderHashes     An array of bytes32 values representing the order\n     *                        hashes of all orders included as part of the\n     *                        current fulfillment.\n     * @param shiftedOfferer  The offerer for the order, shifted 96 bits to the\n     *                        left.\n     *\n     * @return dst  A memory pointer referencing the encoded `ratifyOrder`\n     *              calldata.\n     * @return size The size of the bytes array.\n     */\n    function _encodeRatifyOrder(\n        bytes32 orderHash, // e.g. shl(0x60, offerer) ^ contract nonce\n        OrderParameters memory orderParameters,\n        bytes memory context, // encoded based on the schemaID\n        bytes32[] memory orderHashes,\n        uint256 shiftedOfferer\n    ) internal view returns (MemoryPointer dst, uint256 size) {\n        // Get free memory pointer to write calldata to. This isn't allocated as\n        // it is only used for a single function call.\n        dst = getFreeMemoryPointer();\n\n        // Write ratifyOrder selector and get pointer to start of calldata.\n        dst.write(ratifyOrder_selector);\n        dst = dst.offset(ratifyOrder_selector_offset);\n\n        // Get pointer to the beginning of the encoded data.\n        MemoryPointer dstHead = dst.offset(ratifyOrder_head_offset);\n\n        // Write contractNonce to calldata via xor(orderHash, shiftedOfferer).\n        dstHead.offset(ratifyOrder_contractNonce_offset).write(\n            uint256(orderHash) ^ shiftedOfferer\n        );\n\n        // Initialize tail offset, used to populate the offer array.\n        uint256 tailOffset = ratifyOrder_base_tail_offset;\n        MemoryPointer src = orderParameters.toMemoryPointer();\n\n        // Write offset to `offer`.\n        dstHead.write(tailOffset);\n\n        // Get memory pointer to `orderParameters.offer.length`.\n        MemoryPointer srcOfferPointer = src\n            .offset(OrderParameters_offer_head_offset)\n            .readMemoryPointer();\n\n        // Encode the offer array as a `SpentItem[]`.\n        uint256 offerSize = _encodeSpentItems(\n            srcOfferPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate consideration array.\n            tailOffset += offerSize;\n        }\n\n        // Write offset to consideration.\n        dstHead.offset(ratifyOrder_consideration_head_offset).write(tailOffset);\n\n        // Get pointer to `orderParameters.consideration.length`.\n        MemoryPointer srcConsiderationPointer = src\n            .offset(OrderParameters_consideration_head_offset)\n            .readMemoryPointer();\n\n        // Encode the consideration array as a `ReceivedItem[]`.\n        uint256 considerationSize = _encodeConsiderationAsReceivedItems(\n            srcConsiderationPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate context array.\n            tailOffset += considerationSize;\n        }\n\n        // Write offset to context.\n        dstHead.offset(ratifyOrder_context_head_offset).write(tailOffset);\n\n        // Encode context.\n        uint256 contextSize = _encodeBytes(\n            toMemoryPointer(context),\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate orderHashes array.\n            tailOffset += contextSize;\n        }\n\n        // Write offset to orderHashes.\n        dstHead.offset(ratifyOrder_orderHashes_head_offset).write(tailOffset);\n\n        // Encode orderHashes.\n        uint256 orderHashesSize = _encodeOrderHashes(\n            toMemoryPointer(orderHashes),\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment the tail offset, now used to determine final size.\n            tailOffset += orderHashesSize;\n\n            // Derive the final size by including the selector.\n            size = Selector_length + tailOffset;\n        }\n    }\n\n    /**\n     * @dev Takes an order hash, OrderParameters struct, extraData bytes array,\n     *      and array of order hashes for each order included as part of the\n     *      current fulfillment and encodes it as `authorizeOrder` calldata.\n     *      Note that future, new versions of this contract may end up writing\n     *      to a memory region that might have been potentially dirtied by the\n     *      accumulator. Since the book-keeping for the accumulator does not\n     *      update the free memory pointer, it will be necessary to ensure that\n     *      all bytes in the memory in the range [dst, dst+size) are fully\n     *      updated/written to in this function.\n     *\n     * @param orderHash       The order hash.\n     * @param orderParameters The OrderParameters struct used to construct the\n     *                        encoded `authorizeOrder` calldata.\n     * @param extraData       The extraData bytes array used to construct the\n     *                        encoded `authorizeOrder` calldata.\n     * @param orderHashes     An array of bytes32 values representing the order\n     *                        hashes of all available orders validated thus far\n     *                        as part of current fulfillment.\n     *                        Note that this differs from the orderHashes array\n     *                        passed to `validateOrder` in that the latter\n     *                        includes *all* available and validated orders\n     *                        in the final fulfillment, as it is only a subset\n     *                        of the final fulfilled orderHashes.\n     *\n     * @return dst  A memory pointer referencing the encoded `authorizeOrder`\n     *              calldata.\n     * @return size The size of the bytes array.\n     */\n    function _encodeAuthorizeOrder(\n        bytes32 orderHash,\n        OrderParameters memory orderParameters,\n        bytes memory extraData,\n        bytes32[] memory orderHashes,\n        uint256 orderIndex\n    ) internal view returns (MemoryPointer dst, uint256 size) {\n        // Get free memory pointer to write calldata to.\n        MemoryPointer ptr = getFreeMemoryPointer();\n\n        dst = ptr;\n\n        // Write authorizeOrder selector and get pointer to start of calldata.\n        dst.write(authorizeOrder_selector);\n        dst = dst.offset(authorizeOrder_selector_offset);\n\n        // Get pointer to the beginning of the encoded data.\n        MemoryPointer dstHead = dst.offset(authorizeOrder_head_offset);\n\n        // Write offset to zoneParameters to start of calldata.\n        dstHead.write(authorizeOrder_zoneParameters_offset);\n\n        // Reuse `dstHead` as pointer to zoneParameters.\n        dstHead = dstHead.offset(authorizeOrder_zoneParameters_offset);\n\n        // Write orderHash and fulfiller to zoneParameters.\n        dstHead.writeBytes32(orderHash);\n        dstHead.offset(ZoneParameters_fulfiller_offset).write(msg.sender);\n\n        // Get the memory pointer to the order parameters struct.\n        MemoryPointer src = orderParameters.toMemoryPointer();\n\n        // Copy offerer, startTime, endTime and zoneHash to zoneParameters.\n        dstHead.offset(ZoneParameters_offerer_offset).write(src.readUint256());\n        dstHead.offset(ZoneParameters_startTime_offset).write(\n            src.offset(OrderParameters_startTime_offset).readUint256()\n        );\n        dstHead.offset(ZoneParameters_endTime_offset).write(\n            src.offset(OrderParameters_endTime_offset).readUint256()\n        );\n        dstHead.offset(ZoneParameters_zoneHash_offset).write(\n            src.offset(OrderParameters_zoneHash_offset).readUint256()\n        );\n\n        // Initialize tail offset, used to populate the offer array.\n        uint256 tailOffset = ZoneParameters_base_tail_offset;\n\n        // Write offset to `offer`.\n        dstHead.offset(ZoneParameters_offer_head_offset).write(tailOffset);\n\n        // Get pointer to `orderParameters.offer.length`.\n        MemoryPointer srcOfferPointer = src\n            .offset(OrderParameters_offer_head_offset)\n            .readMemoryPointer();\n\n        // Encode the offer array as a `SpentItem[]`.\n        uint256 offerSize = _encodeSpentItems(\n            srcOfferPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate consideration array.\n            tailOffset += offerSize;\n        }\n\n        // Write offset to consideration.\n        dstHead.offset(ZoneParameters_consideration_head_offset).write(\n            tailOffset\n        );\n\n        // Get pointer to `orderParameters.consideration.length`.\n        MemoryPointer srcConsiderationPointer = src\n            .offset(OrderParameters_consideration_head_offset)\n            .readMemoryPointer();\n\n        // Encode the consideration array as a `ReceivedItem[]`.\n        uint256 considerationSize = _encodeConsiderationAsReceivedItems(\n            srcConsiderationPointer,\n            dstHead.offset(tailOffset)\n        );\n\n        unchecked {\n            // Increment tail offset, now used to populate extraData array.\n            tailOffset += considerationSize;\n        }\n\n        // Write offset to extraData.\n        dstHead.offset(ZoneParameters_extraData_head_offset).write(tailOffset);\n\n        unchecked {\n            // Copy extraData.\n            uint256 extraDataSize = _encodeBytes(\n                toMemoryPointer(extraData),\n                dstHead.offset(tailOffset)\n            );\n\n            // Increment tail offset, now used to populate orderHashes array.\n            tailOffset += extraDataSize;\n        }\n\n        // Write offset to orderHashes.\n        dstHead.offset(ZoneParameters_orderHashes_head_offset).write(\n            tailOffset\n        );\n\n        // Encode the order hashes array.\n        MemoryPointer orderHashesLengthLocation = dstHead.offset(tailOffset);\n\n        unchecked {\n            uint256 orderHashesSize = _encodeOrderHashes(\n                toMemoryPointer(orderHashes),\n                orderHashesLengthLocation\n            );\n\n            // Increment the tail offset, now used to determine final size.\n            tailOffset += orderHashesSize;\n\n            // Derive final size including selector and ZoneParameters pointer.\n            size = ZoneParameters_selectorAndPointer_length + tailOffset;\n        }\n\n        // Update the free memory pointer.\n        setFreeMemoryPointer(dst.offset(size));\n\n        // Track the pointer, size (when performing validateOrder) and pointer\n        // to orderHashes length by overriding the salt value on the order.\n        orderParameters.salt = ((MemoryPointer.unwrap(ptr) << 128) |\n            (size << 64) |\n            MemoryPointer.unwrap(orderHashesLengthLocation));\n\n        // Write the shortened orderHashes array length.\n        orderHashesLengthLocation.write(orderIndex);\n\n        // Modify encoding size to account for the shorter orderHashes array.\n        size -= (orderHashes.length - orderIndex) << OneWordShift;\n    }\n\n    /**\n     * @dev Takes an order hash, OrderParameters struct, extraData bytes array,\n     *      and array of order hashes for each order included as part of the\n     *      current fulfillment and encodes it as `validateOrder` calldata.\n     *      Note that future, new versions of this contract may end up writing\n     *      to a memory region that might have been potentially dirtied by the\n     *      accumulator. Since the book-keeping for the accumulator does not\n     *      update the free memory pointer, it will be necessary to ensure that\n     *      all bytes in the memory in the range [dst, dst+size) are fully\n     *      updated/written to in this function.\n     *\n     * @param salt            The salt on the order, which has been repurposed\n     *                        to contain relevant pointers and encoding size.\n     * @param orderHashes     An array of bytes32 values representing the order\n     *                        hashes of all orders included as part of the\n     *                        current fulfillment.\n     *\n     * @return dst  A memory pointer referencing the encoded `validateOrder`\n     *              calldata.\n     * @return size The size of the bytes array.\n     */\n    function _encodeValidateOrder(\n        uint256 salt,\n        bytes32[] memory orderHashes\n    ) internal view returns (MemoryPointer dst, uint256 size) {\n        dst = MemoryPointer.wrap(salt >> 128);\n        size = (salt >> 64) & OffsetOrLengthMask;\n        MemoryPointer orderHashesLengthLocation = MemoryPointer.wrap(\n            salt & OffsetOrLengthMask\n        );\n\n        // Write validateOrder selector.\n        dst.write(validateOrder_selector);\n\n        dst = dst.offset(validateOrder_selector_offset);\n\n        // Encode the order hashes array. Note that this currently modifies\n        // order hashes that are known to be properly encoded already and could\n        // therefore be skipped.\n        _encodeOrderHashes(\n            toMemoryPointer(orderHashes),\n            orderHashesLengthLocation\n        );\n    }\n\n    /**\n     * @dev Takes an order hash and BasicOrderParameters struct (from calldata)\n     *      and encodes it as `authorizeOrder` calldata. Note that memory data\n     *      is reused from `OrderFulfilled` event data, and the rest of the\n     *      calldata is prefixed and postfixed to this memory region. Note that\n     *      the memory region before the spent and received items on the\n     *      `OrderFulfilled` event are overwritten, which implies that this\n     *      function will need to be modified should the layout of that event\n     *      data change in the future.\n     *\n     * @param orderHash  The order hash.\n     *\n     * @return ptr  A memory pointer referencing the encoded `authorizeOrder`\n     *              calldata with extra padding at the start to word align.\n     * @return size The size of the bytes array.\n     */\n    function _encodeAuthorizeBasicOrder(\n        bytes32 orderHash\n    )\n        internal\n        view\n        returns (\n            MemoryPointer ptr,\n            uint256 size,\n            uint256 memoryLocationForOrderHashes\n        )\n    {\n        unchecked {\n            // Derive offset to pre `OrderFulfilled`'s spent item event data\n            // using base offset & total original recipients.\n            ptr = MemoryPointer.wrap(\n                authorizeOrder_calldata_baseOffset +\n                    (CalldataPointer\n                        .wrap(\n                            BasicOrder_totalOriginalAdditionalRecipients_cdPtr\n                        )\n                        .readUint256() << OneWordShift)\n            );\n        }\n\n        MemoryPointer dst = ptr;\n\n        // Write authorizeOrder selector and get pointer to start of calldata.\n        dst.write(authorizeOrder_selector);\n        dst = dst.offset(authorizeOrder_selector_offset);\n\n        // Get pointer to the beginning of the encoded data.\n        MemoryPointer dstHead = dst.offset(authorizeOrder_head_offset);\n\n        // Write offset to zoneParameters to start of calldata.\n        dstHead.write(authorizeOrder_zoneParameters_offset);\n\n        // Reuse `dstHead` as pointer to zoneParameters.\n        dstHead = dstHead.offset(authorizeOrder_zoneParameters_offset);\n\n        // Write offerer, orderHash and fulfiller to zoneParameters.\n        dstHead.writeBytes32(orderHash);\n        dstHead.offset(ZoneParameters_fulfiller_offset).write(msg.sender);\n        dstHead.offset(ZoneParameters_offerer_offset).write(\n            CalldataPointer.wrap(BasicOrder_offerer_cdPtr).readAddress()\n        );\n\n        // Copy startTime, endTime and zoneHash to zoneParameters.\n        CalldataPointer.wrap(BasicOrder_startTime_cdPtr).copy(\n            dstHead.offset(ZoneParameters_startTime_offset),\n            BasicOrder_startTimeThroughZoneHash_size\n        );\n\n        // Initialize tail offset, used for the offer + consideration arrays.\n        uint256 tailOffset = ZoneParameters_base_tail_offset;\n\n        // Write offset to offer from event data into target calldata.\n        dstHead.offset(ZoneParameters_offer_head_offset).write(tailOffset);\n\n        unchecked {\n            // Write consideration offset next (located 5 words after offer).\n            dstHead.offset(ZoneParameters_consideration_head_offset).write(\n                tailOffset + BasicOrder_consideration_offset_from_offer\n            );\n\n            // Retrieve the length of additional recipients.\n            uint256 additionalRecipientsLength = CalldataPointer\n                .wrap(BasicOrder_addlRecipients_length_cdPtr)\n                .readUint256();\n\n            // Derive size of offer and consideration data.\n            // 2 words (lengths) + 4 (offer data) + 5 (consideration 1) + 5 * ar\n            uint256 offerAndConsiderationSize = OrderFulfilled_baseDataSize +\n                (additionalRecipientsLength * ReceivedItem_size);\n\n            // Increment tail offset, now used to populate extraData array.\n            tailOffset += offerAndConsiderationSize;\n        }\n\n        // Write empty bytes for extraData.\n        dstHead.offset(ZoneParameters_extraData_head_offset).write(tailOffset);\n        dstHead.offset(tailOffset).write(0);\n\n        unchecked {\n            // Increment tail offset, now used to populate orderHashes array.\n            tailOffset += OneWord;\n        }\n\n        // Write offset to orderHashes.\n        dstHead.offset(ZoneParameters_orderHashes_head_offset).write(\n            tailOffset\n        );\n\n        memoryLocationForOrderHashes = MemoryPointer.unwrap(\n            dstHead.offset(tailOffset)\n        );\n\n        // Write length = 0 to the orderHashes array.\n        dstHead.offset(tailOffset).write(0);\n\n        unchecked {\n            // Write the single order hash to the orderHashes array.\n            dstHead.offset(tailOffset + OneWord).writeBytes32(orderHash);\n\n            // Final size: selector, ZoneParameters pointer, orderHashes & tail.\n            size = ZoneParameters_basicOrderFixedElements_length + tailOffset;\n        }\n    }\n\n    /**\n     * @dev Takes pointers to already-encoded data and modifies it so that\n     *      it is properly formatted for a `validateOrder` call.\n     *\n     * @param dst                          A memory pointer referencing the\n     *                                     encoded `validateOrder` calldata.\n     * @param memoryLocationForOrderHashes A memory pointer referencing where\n     *                                     to encode orderHashes length of 1.\n     */\n    function _encodeValidateBasicOrder(\n        MemoryPointer dst,\n        uint256 memoryLocationForOrderHashes\n    ) internal pure {\n        // Write validateOrder selector and get pointer to start of calldata.\n        dst.write(validateOrder_selector);\n\n        // Write length = 1 to the orderHashes array. Note that size should now\n        // be one word larger than the provided size.\n        MemoryPointer.wrap(memoryLocationForOrderHashes).write(1);\n    }\n\n    /**\n     * @dev Takes a memory pointer to an array of bytes32 values representing\n     *      the order hashes included as part of the fulfillment and a memory\n     *      pointer to a location to copy it to, and copies the source data to\n     *      the destination in memory.\n     *\n     * @param srcLength A memory pointer referencing the order hashes array to\n     *                  be copied (and pointing to the length of the array).\n     * @param dstLength A memory pointer referencing the location in memory to\n     *                  copy the orderHashes array to (and pointing to the\n     *                  length of the copied array).\n     *\n     * @return size The size of the order hashes array (including the length).\n     */\n    function _encodeOrderHashes(\n        MemoryPointer srcLength,\n        MemoryPointer dstLength\n    ) internal view returns (uint256 size) {\n        // Read length of the array from source and write to destination.\n        uint256 length = srcLength.readUint256();\n        dstLength.write(length);\n\n        unchecked {\n            // Determine head & tail size as one word per element in the array.\n            uint256 headAndTailSize = length << OneWordShift;\n\n            // Copy the tail starting from the next element of the source to the\n            // next element of the destination.\n            srcLength.next().copy(dstLength.next(), headAndTailSize);\n\n            // Set size to the length of the tail plus one word for length.\n            size = headAndTailSize + OneWord;\n        }\n    }\n\n    /**\n     * @dev Takes a memory pointer to an offer or consideration array and a\n     *      memory pointer to a location to copy it to, and copies the source\n     *      data to the destination in memory as a SpentItem array.\n     *\n     * @param srcLength A memory pointer referencing the offer or consideration\n     *                  array to be copied as a SpentItem array (and pointing to\n     *                  the length of the original array).\n     * @param dstLength A memory pointer referencing the location in memory to\n     *                  copy the offer array to (and pointing to the length of\n     *                  the copied array).\n     *\n     * @return size The size of the SpentItem array (including the length).\n     */\n    function _encodeSpentItems(\n        MemoryPointer srcLength,\n        MemoryPointer dstLength\n    ) internal pure returns (uint256 size) {\n        assembly {\n            // Read length of the array from source and write to destination.\n            let length := mload(srcLength)\n            mstore(dstLength, length)\n\n            // Get pointer to first item's head position in the array,\n            // containing the item's pointer in memory. The head pointer will be\n            // incremented until it reaches the tail position (start of the\n            // array data).\n            let mPtrHead := add(srcLength, OneWord)\n\n            // Position in memory to write next item for calldata. Since\n            // SpentItem has a fixed length, the array elements do not contain\n            // head elements in calldata, they are concatenated together after\n            // the array length.\n            let cdPtrData := add(dstLength, OneWord)\n\n            // Pointer to end of array head in memory.\n            let mPtrHeadEnd := add(mPtrHead, shl(OneWordShift, length))\n\n            for {\n\n            } lt(mPtrHead, mPtrHeadEnd) {\n\n            } {\n                // Read pointer to data for array element from head position.\n                let mPtrTail := mload(mPtrHead)\n\n                // Copy itemType, token, identifier, amount to calldata.\n                mstore(cdPtrData, mload(mPtrTail))\n                mstore(\n                    add(cdPtrData, Common_token_offset),\n                    mload(add(mPtrTail, Common_token_offset))\n                )\n                mstore(\n                    add(cdPtrData, Common_identifier_offset),\n                    mload(add(mPtrTail, Common_identifier_offset))\n                )\n                mstore(\n                    add(cdPtrData, Common_amount_offset),\n                    mload(add(mPtrTail, Common_amount_offset))\n                )\n\n                mPtrHead := add(mPtrHead, OneWord)\n                cdPtrData := add(cdPtrData, SpentItem_size)\n            }\n\n            size := add(OneWord, shl(SpentItem_size_shift, length))\n        }\n    }\n\n    /**\n     * @dev Takes a memory pointer to an consideration array and a memory\n     *      pointer to a location to copy it to, and copies the source data to\n     *      the destination in memory as a ReceivedItem array.\n     *\n     * @param srcLength A memory pointer referencing the consideration array to\n     *                  be copied as a ReceivedItem array (and pointing to the\n     *                  length of the original array).\n     * @param dstLength A memory pointer referencing the location in memory to\n     *                  copy the consideration array to as a ReceivedItem array\n     *                  (and pointing to the length of the new array).\n     *\n     * @return size The size of the ReceivedItem array (including the length).\n     */\n    function _encodeConsiderationAsReceivedItems(\n        MemoryPointer srcLength,\n        MemoryPointer dstLength\n    ) internal view returns (uint256 size) {\n        unchecked {\n            // Read length of the array from source and write to destination.\n            uint256 length = srcLength.readUint256();\n            dstLength.write(length);\n\n            // Get pointer to first item's head position in the array,\n            // containing the item's pointer in memory. The head pointer will be\n            // incremented until it reaches the tail position (start of the\n            // array data).\n            MemoryPointer srcHead = srcLength.next();\n            MemoryPointer srcHeadEnd = srcHead.offset(length << OneWordShift);\n\n            // Position in memory to write next item for calldata. Since\n            // ReceivedItem has a fixed length, the array elements do not\n            // contain offsets in calldata, they are concatenated together after\n            // the array length.\n            MemoryPointer dstHead = dstLength.next();\n            while (srcHead.lt(srcHeadEnd)) {\n                MemoryPointer srcTail = srcHead.pptr();\n                srcTail.copy(dstHead, ReceivedItem_size);\n                srcHead = srcHead.next();\n                dstHead = dstHead.offset(ReceivedItem_size);\n            }\n\n            size = OneWord + (length * ReceivedItem_size);\n        }\n    }\n}\n"},"src/lib/SignatureVerification.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {\n    SignatureVerificationErrors\n} from \"seaport-types/src/interfaces/SignatureVerificationErrors.sol\";\n\nimport { LowLevelHelpers } from \"./LowLevelHelpers.sol\";\n\nimport {\n    ECDSA_MaxLength,\n    ECDSA_signature_s_offset,\n    ECDSA_signature_v_offset,\n    ECDSA_twentySeventhAndTwentyEighthBytesSet,\n    Ecrecover_args_size,\n    Ecrecover_precompile,\n    EIP1271_isValidSignature_calldata_baseLength,\n    EIP1271_isValidSignature_digest_negativeOffset,\n    EIP1271_isValidSignature_selector_negativeOffset,\n    EIP1271_isValidSignature_selector,\n    EIP1271_isValidSignature_signature_head_offset,\n    EIP2098_allButHighestBitMask,\n    MaxUint8,\n    OneWord,\n    Signature_lower_v\n} from \"seaport-types/src/lib/ConsiderationConstants.sol\";\n\nimport {\n    BadContractSignature_error_length,\n    BadContractSignature_error_selector,\n    BadSignatureV_error_length,\n    BadSignatureV_error_selector,\n    BadSignatureV_error_v_ptr,\n    Error_selector_offset,\n    InvalidSignature_error_length,\n    InvalidSignature_error_selector,\n    InvalidSigner_error_length,\n    InvalidSigner_error_selector\n} from \"seaport-types/src/lib/ConsiderationErrorConstants.sol\";\n\n/**\n * @title SignatureVerification\n * @author 0age\n * @notice SignatureVerification contains logic for verifying signatures.\n */\ncontract SignatureVerification is SignatureVerificationErrors, LowLevelHelpers {\n    /**\n     * @dev Internal view function to verify the signature of an order. An\n     *      ERC-1271 fallback will be attempted if either the signature length\n     *      is not 64 or 65 bytes or if the recovered signer does not match the\n     *      supplied signer.\n     *\n     * @param signer                  The signer for the order.\n     * @param digest                  The digest to verify signature against.\n     * @param originalDigest          The original digest to verify signature\n     *                                against.\n     * @param originalSignatureLength The original signature length.\n     * @param signature               A signature from the signer indicating\n     *                                that the order has been approved.\n     */\n    function _assertValidSignature(\n        address signer,\n        bytes32 digest,\n        bytes32 originalDigest,\n        uint256 originalSignatureLength,\n        bytes memory signature\n    ) internal view {\n        // Declare value for ecrecover equality or 1271 call success status.\n        bool success;\n\n        // Utilize assembly to perform optimized signature verification check.\n        assembly {\n            // Ensure that first word of scratch space is empty.\n            mstore(0, 0)\n\n            // Get the length of the signature.\n            let signatureLength := mload(signature)\n\n            // Get the pointer to the value preceding the signature length.\n            // This will be used for temporary memory overrides - either the\n            // signature head for isValidSignature or the digest for ecrecover.\n            let wordBeforeSignaturePtr := sub(signature, OneWord)\n\n            // Cache the current value behind the signature to restore it later.\n            let cachedWordBeforeSignature := mload(wordBeforeSignaturePtr)\n\n            // Declare lenDiff + recoveredSigner scope to manage stack pressure.\n            {\n                // Take the difference between the max ECDSA signature length\n                // and the actual signature length. Overflow desired for any\n                // values > 65. If the diff is not 0 or 1, it is not a valid\n                // ECDSA signature - move on to EIP1271 check.\n                let lenDiff := sub(ECDSA_MaxLength, signatureLength)\n\n                // Declare variable for recovered signer.\n                let recoveredSigner\n\n                // If diff is 0 or 1, it may be an ECDSA signature.\n                // Try to recover signer.\n                if iszero(gt(lenDiff, 1)) {\n                    // Read the signature `s` value.\n                    let originalSignatureS := mload(\n                        add(signature, ECDSA_signature_s_offset)\n                    )\n\n                    // Read the first byte of the word after `s`. If the\n                    // signature is 65 bytes, this will be the real `v` value.\n                    // If not, it will need to be modified - doing it this way\n                    // saves an extra condition.\n                    let v := byte(\n                        0,\n                        mload(add(signature, ECDSA_signature_v_offset))\n                    )\n\n                    // If lenDiff is 1, parse 64-byte signature as ECDSA.\n                    if lenDiff {\n                        // Extract yParity from highest bit of vs and add 27 to\n                        // get v.\n                        v := add(\n                            shr(MaxUint8, originalSignatureS),\n                            Signature_lower_v\n                        )\n\n                        // Extract canonical s from vs, all but the highest bit.\n                        // Temporarily overwrite the original `s` value in the\n                        // signature.\n                        mstore(\n                            add(signature, ECDSA_signature_s_offset),\n                            and(\n                                originalSignatureS,\n                                EIP2098_allButHighestBitMask\n                            )\n                        )\n                    }\n                    // Temporarily overwrite the signature length with `v` to\n                    // conform to the expected input for ecrecover.\n                    mstore(signature, v)\n\n                    // Temporarily overwrite the word before the length with\n                    // `digest` to conform to the expected input for ecrecover.\n                    mstore(wordBeforeSignaturePtr, digest)\n\n                    // Attempt to recover the signer for the given signature. Do\n                    // not check the call status as ecrecover will return a null\n                    // address if the signature is invalid.\n                    pop(\n                        staticcall(\n                            gas(),\n                            Ecrecover_precompile, // Call ecrecover precompile.\n                            wordBeforeSignaturePtr, // Use data memory location.\n                            Ecrecover_args_size, // Size of digest, v, r, and s.\n                            0, // Write result to scratch space.\n                            OneWord // Provide size of returned result.\n                        )\n                    )\n\n                    // Restore cached word before signature.\n                    mstore(wordBeforeSignaturePtr, cachedWordBeforeSignature)\n\n                    // Restore cached signature length.\n                    mstore(signature, signatureLength)\n\n                    // Restore cached signature `s` value.\n                    mstore(\n                        add(signature, ECDSA_signature_s_offset),\n                        originalSignatureS\n                    )\n\n                    // Read the recovered signer from the buffer given as return\n                    // space for ecrecover.\n                    recoveredSigner := mload(0)\n                }\n\n                // Set success to true if the signature provided was a valid\n                // ECDSA signature and the signer is not the null address. Use\n                // gt instead of direct as success is used outside of assembly.\n                success := and(eq(signer, recoveredSigner), gt(signer, 0))\n            }\n\n            // If the signature was not verified with ecrecover, try EIP1271.\n            if iszero(success) {\n                // Reset the original signature length.\n                mstore(signature, originalSignatureLength)\n\n                // Temporarily overwrite the word before the signature length\n                // and use it as the head of the signature input to\n                // `isValidSignature`, which has a value of 64.\n                mstore(\n                    wordBeforeSignaturePtr,\n                    EIP1271_isValidSignature_signature_head_offset\n                )\n\n                // Get pointer to use for the selector of `isValidSignature`.\n                let selectorPtr := sub(\n                    signature,\n                    EIP1271_isValidSignature_selector_negativeOffset\n                )\n\n                // Cache the value currently stored at the selector pointer.\n                let cachedWordOverwrittenBySelector := mload(selectorPtr)\n\n                // Cache the value currently stored at the digest pointer.\n                let cachedWordOverwrittenByDigest := mload(\n                    sub(\n                        signature,\n                        EIP1271_isValidSignature_digest_negativeOffset\n                    )\n                )\n\n                // Write the selector first, since it overlaps the digest.\n                mstore(selectorPtr, EIP1271_isValidSignature_selector)\n\n                // Next, write the original digest.\n                mstore(\n                    sub(\n                        signature,\n                        EIP1271_isValidSignature_digest_negativeOffset\n                    ),\n                    originalDigest\n                )\n\n                // Call signer with `isValidSignature` to validate signature.\n                success := staticcall(\n                    gas(),\n                    signer,\n                    selectorPtr,\n                    add(\n                        originalSignatureLength,\n                        EIP1271_isValidSignature_calldata_baseLength\n                    ),\n                    0,\n                    OneWord\n                )\n\n                // Determine if the signature is valid on successful calls.\n                if success {\n                    // If first word of scratch space does not contain EIP-1271\n                    // signature selector, revert.\n                    if iszero(eq(mload(0), EIP1271_isValidSignature_selector)) {\n                        // Revert with bad 1271 signature if signer has code.\n                        if extcodesize(signer) {\n                            // Bad contract signature.\n                            // Store left-padded selector with push4, mem[28:32]\n                            mstore(0, BadContractSignature_error_selector)\n\n                            // revert(abi.encodeWithSignature(\n                            //     \"BadContractSignature()\"\n                            // ))\n                            revert(\n                                Error_selector_offset,\n                                BadContractSignature_error_length\n                            )\n                        }\n\n                        // Check if signature length was invalid.\n                        if gt(sub(ECDSA_MaxLength, signatureLength), 1) {\n                            // Revert with generic invalid signature error.\n                            // Store left-padded selector with push4, mem[28:32]\n                            mstore(0, InvalidSignature_error_selector)\n\n                            // revert(abi.encodeWithSignature(\n                            //     \"InvalidSignature()\"\n                            // ))\n                            revert(\n                                Error_selector_offset,\n                                InvalidSignature_error_length\n                            )\n                        }\n\n                        // Check if v was invalid.\n                        if and(\n                            eq(signatureLength, ECDSA_MaxLength),\n                            iszero(\n                                byte(\n                                    byte(\n                                        0,\n                                        mload(\n                                            add(\n                                                signature,\n                                                ECDSA_signature_v_offset\n                                            )\n                                        )\n                                    ),\n                                    ECDSA_twentySeventhAndTwentyEighthBytesSet\n                                )\n                            )\n                        ) {\n                            // Revert with invalid v value.\n                            // Store left-padded selector with push4, mem[28:32]\n                            mstore(0, BadSignatureV_error_selector)\n                            mstore(\n                                BadSignatureV_error_v_ptr,\n                                byte(\n                                    0,\n                                    mload(\n                                        add(signature, ECDSA_signature_v_offset)\n                                    )\n                                )\n                            )\n\n                            // revert(abi.encodeWithSignature(\n                            //     \"BadSignatureV(uint8)\", v\n                            // ))\n                            revert(\n                                Error_selector_offset,\n                                BadSignatureV_error_length\n                            )\n                        }\n\n                        // Revert with generic invalid signer error message.\n                        // Store left-padded selector with push4, mem[28:32]\n                        mstore(0, InvalidSigner_error_selector)\n\n                        // revert(abi.encodeWithSignature(\"InvalidSigner()\"))\n                        revert(\n                            Error_selector_offset,\n                            InvalidSigner_error_length\n                        )\n                    }\n                }\n\n                // Restore the cached values overwritten by selector, digest and\n                // signature head.\n                mstore(wordBeforeSignaturePtr, cachedWordBeforeSignature)\n                mstore(selectorPtr, cachedWordOverwrittenBySelector)\n                mstore(\n                    sub(\n                        signature,\n                        EIP1271_isValidSignature_digest_negativeOffset\n                    ),\n                    cachedWordOverwrittenByDigest\n                )\n            }\n        }\n\n        // If the call failed...\n        if (!success) {\n            // Revert and pass reason along if one was returned.\n            _revertWithReasonIfOneIsReturned();\n\n            // Otherwise, revert with error indicating bad contract signature.\n            assembly {\n                // Store left-padded selector with push4, mem[28:32] = selector\n                mstore(0, BadContractSignature_error_selector)\n                // revert(abi.encodeWithSignature(\"BadContractSignature()\"))\n                revert(Error_selector_offset, BadContractSignature_error_length)\n            }\n        }\n    }\n}\n"},"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/seaport-types/src/lib/ConsiderationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport { Side } from \"./ConsiderationEnums.sol\";\n\nimport {\n    BadFraction_error_length,\n    BadFraction_error_selector,\n    CannotCancelOrder_error_length,\n    CannotCancelOrder_error_selector,\n    ConsiderationLengthNotEqualToTotalOriginal_error_length,\n    ConsiderationLengthNotEqualToTotalOriginal_error_selector,\n    ConsiderationNotMet_error_considerationIndex_ptr,\n    ConsiderationNotMet_error_length,\n    ConsiderationNotMet_error_orderIndex_ptr,\n    ConsiderationNotMet_error_selector,\n    ConsiderationNotMet_error_shortfallAmount_ptr,\n    CriteriaNotEnabledForItem_error_length,\n    CriteriaNotEnabledForItem_error_selector,\n    Error_selector_offset,\n    InsufficientNativeTokensSupplied_error_length,\n    InsufficientNativeTokensSupplied_error_selector,\n    InvalidBasicOrderParameterEncoding_error_length,\n    InvalidBasicOrderParameterEncoding_error_selector,\n    InvalidCallToConduit_error_conduit_ptr,\n    InvalidCallToConduit_error_length,\n    InvalidCallToConduit_error_selector,\n    InvalidConduit_error_conduit_ptr,\n    InvalidConduit_error_conduitKey_ptr,\n    InvalidConduit_error_length,\n    InvalidConduit_error_selector,\n    InvalidContractOrder_error_length,\n    InvalidContractOrder_error_orderHash_ptr,\n    InvalidContractOrder_error_selector,\n    InvalidERC721TransferAmount_error_amount_ptr,\n    InvalidERC721TransferAmount_error_length,\n    InvalidERC721TransferAmount_error_selector,\n    InvalidMsgValue_error_length,\n    InvalidMsgValue_error_selector,\n    InvalidMsgValue_error_value_ptr,\n    InvalidNativeOfferItem_error_length,\n    InvalidNativeOfferItem_error_selector,\n    InvalidProof_error_length,\n    InvalidProof_error_selector,\n    InvalidTime_error_endTime_ptr,\n    InvalidTime_error_length,\n    InvalidTime_error_selector,\n    InvalidTime_error_startTime_ptr,\n    MismatchedOfferAndConsiderationComponents_error_idx_ptr,\n    MismatchedOfferAndConsiderationComponents_error_length,\n    MismatchedOfferAndConsiderationComponents_error_selector,\n    MissingFulfillmentComponentOnAggregation_error_length,\n    MissingFulfillmentComponentOnAggregation_error_selector,\n    MissingFulfillmentComponentOnAggregation_error_side_ptr,\n    MissingOriginalConsiderationItems_error_length,\n    MissingOriginalConsiderationItems_error_selector,\n    NoReentrantCalls_error_length,\n    NoReentrantCalls_error_selector,\n    NoSpecifiedOrdersAvailable_error_length,\n    NoSpecifiedOrdersAvailable_error_selector,\n    OfferAndConsiderationRequiredOnFulfillment_error_length,\n    OfferAndConsiderationRequiredOnFulfillment_error_selector,\n    OrderAlreadyFilled_error_length,\n    OrderAlreadyFilled_error_orderHash_ptr,\n    OrderAlreadyFilled_error_selector,\n    OrderCriteriaResolverOutOfRange_error_length,\n    OrderCriteriaResolverOutOfRange_error_selector,\n    OrderCriteriaResolverOutOfRange_error_side_ptr,\n    OrderIsCancelled_error_length,\n    OrderIsCancelled_error_orderHash_ptr,\n    OrderIsCancelled_error_selector,\n    OrderPartiallyFilled_error_length,\n    OrderPartiallyFilled_error_orderHash_ptr,\n    OrderPartiallyFilled_error_selector,\n    PartialFillsNotEnabledForOrder_error_length,\n    PartialFillsNotEnabledForOrder_error_selector,\n    UnresolvedConsiderationCriteria_error_length,\n    UnresolvedConsiderationCriteria_error_orderIndex_ptr,\n    UnresolvedConsiderationCriteria_error_selector,\n    UnresolvedOfferCriteria_error_length,\n    UnresolvedOfferCriteria_error_offerIndex_ptr,\n    UnresolvedOfferCriteria_error_orderIndex_ptr,\n    UnresolvedOfferCriteria_error_selector,\n    UnusedItemParameters_error_length,\n    UnusedItemParameters_error_selector\n} from \"./ConsiderationErrorConstants.sol\";\n\n/**\n * @dev Reverts the current transaction with a \"BadFraction\" error message.\n */\nfunction _revertBadFraction() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, BadFraction_error_selector)\n\n        // revert(abi.encodeWithSignature(\"BadFraction()\"))\n        revert(Error_selector_offset, BadFraction_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with a \"ConsiderationNotMet\" error\n *      message, including the provided order index, consideration index, and\n *      shortfall amount.\n *\n * @param orderIndex         The index of the order that did not meet the\n *                           consideration criteria.\n * @param considerationIndex The index of the consideration item that did not\n *                           meet its criteria.\n * @param shortfallAmount    The amount by which the consideration criteria were\n *                           not met.\n */\nfunction _revertConsiderationNotMet(\n    uint256 orderIndex,\n    uint256 considerationIndex,\n    uint256 shortfallAmount\n) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, ConsiderationNotMet_error_selector)\n\n        // Store arguments.\n        mstore(ConsiderationNotMet_error_orderIndex_ptr, orderIndex)\n        mstore(\n            ConsiderationNotMet_error_considerationIndex_ptr, considerationIndex\n        )\n        mstore(ConsiderationNotMet_error_shortfallAmount_ptr, shortfallAmount)\n\n        // revert(abi.encodeWithSignature(\n        //     \"ConsiderationNotMet(uint256,uint256,uint256)\",\n        //     orderIndex,\n        //     considerationIndex,\n        //     shortfallAmount\n        // ))\n        revert(Error_selector_offset, ConsiderationNotMet_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with a \"CriteriaNotEnabledForItem\" error\n *      message.\n */\nfunction _revertCriteriaNotEnabledForItem() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, CriteriaNotEnabledForItem_error_selector)\n\n        // revert(abi.encodeWithSignature(\"CriteriaNotEnabledForItem()\"))\n        revert(Error_selector_offset, CriteriaNotEnabledForItem_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an\n *      \"InsufficientNativeTokensSupplied\" error message.\n */\nfunction _revertInsufficientNativeTokensSupplied() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InsufficientNativeTokensSupplied_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InsufficientNativeTokensSupplied()\"))\n        revert(\n            Error_selector_offset, InsufficientNativeTokensSupplied_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an\n *      \"InvalidBasicOrderParameterEncoding\" error message.\n */\nfunction _revertInvalidBasicOrderParameterEncoding() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidBasicOrderParameterEncoding_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidBasicOrderParameterEncoding()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            InvalidBasicOrderParameterEncoding_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidCallToConduit\" error\n *      message, including the provided address of the conduit that was called\n *      improperly.\n *\n * @param conduit The address of the conduit that was called improperly.\n */\nfunction _revertInvalidCallToConduit(address conduit) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidCallToConduit_error_selector)\n\n        // Store argument.\n        mstore(InvalidCallToConduit_error_conduit_ptr, conduit)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidCallToConduit(address)\",\n        //     conduit\n        // ))\n        revert(Error_selector_offset, InvalidCallToConduit_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"CannotCancelOrder\" error\n *      message.\n */\nfunction _revertCannotCancelOrder() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, CannotCancelOrder_error_selector)\n\n        // revert(abi.encodeWithSignature(\"CannotCancelOrder()\"))\n        revert(Error_selector_offset, CannotCancelOrder_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidConduit\" error message,\n *      including the provided key and address of the invalid conduit.\n *\n * @param conduitKey    The key of the invalid conduit.\n * @param conduit       The address of the invalid conduit.\n */\nfunction _revertInvalidConduit(bytes32 conduitKey, address conduit) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidConduit_error_selector)\n\n        // Store arguments.\n        mstore(InvalidConduit_error_conduitKey_ptr, conduitKey)\n        mstore(InvalidConduit_error_conduit_ptr, conduit)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidConduit(bytes32,address)\",\n        //     conduitKey,\n        //     conduit\n        // ))\n        revert(Error_selector_offset, InvalidConduit_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidERC721TransferAmount\"\n *      error message.\n *\n * @param amount The invalid amount.\n */\nfunction _revertInvalidERC721TransferAmount(uint256 amount) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidERC721TransferAmount_error_selector)\n\n        // Store argument.\n        mstore(InvalidERC721TransferAmount_error_amount_ptr, amount)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidERC721TransferAmount(uint256)\",\n        //     amount\n        // ))\n        revert(Error_selector_offset, InvalidERC721TransferAmount_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidMsgValue\" error message,\n *      including the invalid value that was sent in the transaction's\n *      `msg.value` field.\n *\n * @param value The invalid value that was sent in the transaction's `msg.value`\n *              field.\n */\nfunction _revertInvalidMsgValue(uint256 value) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidMsgValue_error_selector)\n\n        // Store argument.\n        mstore(InvalidMsgValue_error_value_ptr, value)\n\n        // revert(abi.encodeWithSignature(\"InvalidMsgValue(uint256)\", value))\n        revert(Error_selector_offset, InvalidMsgValue_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidNativeOfferItem\" error\n *      message.\n */\nfunction _revertInvalidNativeOfferItem() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidNativeOfferItem_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InvalidNativeOfferItem()\"))\n        revert(Error_selector_offset, InvalidNativeOfferItem_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidProof\" error message.\n */\nfunction _revertInvalidProof() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidProof_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InvalidProof()\"))\n        revert(Error_selector_offset, InvalidProof_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidContractOrder\" error\n *      message.\n *\n * @param orderHash The hash of the contract order that caused the error.\n */\nfunction _revertInvalidContractOrder(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidContractOrder_error_selector)\n\n        // Store arguments.\n        mstore(InvalidContractOrder_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidContractOrder(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, InvalidContractOrder_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidTime\" error message.\n *\n * @param startTime       The time at which the order becomes active.\n * @param endTime         The time at which the order becomes inactive.\n */\nfunction _revertInvalidTime(uint256 startTime, uint256 endTime) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidTime_error_selector)\n\n        // Store arguments.\n        mstore(InvalidTime_error_startTime_ptr, startTime)\n        mstore(InvalidTime_error_endTime_ptr, endTime)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidTime(uint256,uint256)\",\n        //     startTime,\n        //     endTime\n        // ))\n        revert(Error_selector_offset, InvalidTime_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"MissingFulfillmentComponentOnAggregation\"\n *       error message.\n *\n * @param side The side of the fulfillment component that is missing (0 for\n *             offer, 1 for consideration).\n *\n */\nfunction _revertMissingFulfillmentComponentOnAggregation(Side side) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, MissingFulfillmentComponentOnAggregation_error_selector)\n\n        // Store argument.\n        mstore(MissingFulfillmentComponentOnAggregation_error_side_ptr, side)\n\n        // revert(abi.encodeWithSignature(\n        //     \"MissingFulfillmentComponentOnAggregation(uint8)\",\n        //     side\n        // ))\n        revert(\n            Error_selector_offset,\n            MissingFulfillmentComponentOnAggregation_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with a \"MissingOriginalConsiderationItems\" error\n *      message.\n */\nfunction _revertMissingOriginalConsiderationItems() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, MissingOriginalConsiderationItems_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"MissingOriginalConsiderationItems()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            MissingOriginalConsiderationItems_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with a \"NoReentrantCalls\" error message.\n */\nfunction _revertNoReentrantCalls() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, NoReentrantCalls_error_selector)\n\n        // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n        revert(Error_selector_offset, NoReentrantCalls_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"NoSpecifiedOrdersAvailable\" error message.\n */\nfunction _revertNoSpecifiedOrdersAvailable() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, NoSpecifiedOrdersAvailable_error_selector)\n\n        // revert(abi.encodeWithSignature(\"NoSpecifiedOrdersAvailable()\"))\n        revert(Error_selector_offset, NoSpecifiedOrdersAvailable_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderAlreadyFilled\" error message.\n *\n * @param orderHash The hash of the order that has already been filled.\n */\nfunction _revertOrderAlreadyFilled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderAlreadyFilled_error_selector)\n\n        // Store argument.\n        mstore(OrderAlreadyFilled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderAlreadyFilled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderAlreadyFilled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderCriteriaResolverOutOfRange\" error\n *      message.\n *\n * @param side The side of the criteria that is missing (0 for offer, 1 for\n *             consideration).\n *\n */\nfunction _revertOrderCriteriaResolverOutOfRange(Side side) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderCriteriaResolverOutOfRange_error_selector)\n\n        // Store argument.\n        mstore(OrderCriteriaResolverOutOfRange_error_side_ptr, side)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderCriteriaResolverOutOfRange(uint8)\",\n        //     side\n        // ))\n        revert(\n            Error_selector_offset, OrderCriteriaResolverOutOfRange_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderIsCancelled\" error message.\n *\n * @param orderHash The hash of the order that has already been cancelled.\n */\nfunction _revertOrderIsCancelled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderIsCancelled_error_selector)\n\n        // Store argument.\n        mstore(OrderIsCancelled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderIsCancelled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderIsCancelled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderPartiallyFilled\" error message.\n *\n * @param orderHash The hash of the order that has already been partially\n *                  filled.\n */\nfunction _revertOrderPartiallyFilled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderPartiallyFilled_error_selector)\n\n        // Store argument.\n        mstore(OrderPartiallyFilled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderPartiallyFilled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderPartiallyFilled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"PartialFillsNotEnabledForOrder\" error message.\n */\nfunction _revertPartialFillsNotEnabledForOrder() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, PartialFillsNotEnabledForOrder_error_selector)\n\n        // revert(abi.encodeWithSignature(\"PartialFillsNotEnabledForOrder()\"))\n        revert(\n            Error_selector_offset, PartialFillsNotEnabledForOrder_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with an \"UnusedItemParameters\" error message.\n */\nfunction _revertUnusedItemParameters() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, UnusedItemParameters_error_selector)\n\n        // revert(abi.encodeWithSignature(\"UnusedItemParameters()\"))\n        revert(Error_selector_offset, UnusedItemParameters_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"ConsiderationLengthNotEqualToTotalOriginal\"\n *      error message.\n */\nfunction _revertConsiderationLengthNotEqualToTotalOriginal() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, ConsiderationLengthNotEqualToTotalOriginal_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"ConsiderationLengthNotEqualToTotalOriginal()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            ConsiderationLengthNotEqualToTotalOriginal_error_length\n        )\n    }\n}\n"},"lib/seaport-types/src/conduit/lib/ConduitEnums.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nenum ConduitItemType {\n    NATIVE, // unused\n    ERC20,\n    ERC721,\n    ERC1155\n}\n"},"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);\nMemoryPointer constant ZeroSlotPtr = MemoryPointer.wrap(0x60);\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 pptrOffset(\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 pptrOffset(\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 pptrOffset(\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-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-types/src/conduit/lib/ConduitStructs.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { ConduitItemType } from \"./ConduitEnums.sol\";\n\n/**\n * @dev A ConduitTransfer is a struct that contains the information needed for a\n *      conduit to transfer an item from one address to another.\n */\nstruct ConduitTransfer {\n    ConduitItemType itemType;\n    address token;\n    address from;\n    address to;\n    uint256 identifier;\n    uint256 amount;\n}\n\n/**\n * @dev A ConduitBatch1155Transfer is a struct that contains the information\n *      needed for a conduit to transfer a batch of ERC-1155 tokens from one\n *      address to another.\n */\nstruct ConduitBatch1155Transfer {\n    address token;\n    address from;\n    address to;\n    uint256[] ids;\n    uint256[] amounts;\n}\n"},"lib/seaport-types/src/lib/ConsiderationConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/*\n * -------------------------- Disambiguation & Other Notes ---------------------\n *    - The term \"head\" is used as it is in the documentation for ABI encoding,\n *      but only in reference to dynamic types, i.e. it always refers to the\n *      offset or pointer to the body of a dynamic type. In calldata, the head\n *      is always an offset (relative to the parent object), while in memory,\n *      the head is always the pointer to the body. More information found here:\n *      https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#argument-encoding\n *        - Note that the length of an array is separate from and precedes the\n *          head of the array.\n *\n *    - The term \"body\" is used in place of the term \"head\" used in the ABI\n *      documentation. It refers to the start of the data for a dynamic type,\n *      e.g. the first word of a struct or the first word of the first element\n *      in an array.\n *\n *    - The term \"pointer\" is used to describe the absolute position of a value\n *      and never an offset relative to another value.\n *        - The suffix \"_ptr\" refers to a memory pointer.\n *        - The suffix \"_cdPtr\" refers to a calldata pointer.\n *\n *    - The term \"offset\" is used to describe the position of a value relative\n *      to some parent value. For example, OrderParameters_conduit_offset is the\n *      offset to the \"conduit\" value in the OrderParameters struct relative to\n *      the start of the body.\n *        - Note: Offsets are used to derive pointers.\n *\n *    - Some structs have pointers defined for all of their fields in this file.\n *      Lines which are commented out are fields that are not used in the\n *      codebase but have been left in for readability.\n */\n\n// Declare constants for name, version, and reentrancy sentinel values.\n\n// Name is right padded, so it touches the length which is left padded. This\n// enables writing both values at once. Length goes at byte 95 in memory, and\n// name fills bytes 96-109, so both values can be written left-padded to 77.\nuint256 constant NameLengthPtr = 0x4D;\nuint256 constant NameWithLength = 0x0d436F6E73696465726174696F6E;\n\nuint256 constant information_version_offset = 0;\nuint256 constant information_version_cd_offset = 0x60;\nuint256 constant information_domainSeparator_offset = 0x20;\nuint256 constant information_conduitController_offset = 0x40;\nuint256 constant information_versionLengthPtr = 0x63;\nuint256 constant information_versionWithLength = 0x03312e36; // 1.6\nuint256 constant information_length = 0xa0;\n\n// uint256(uint32(bytes4(keccak256(\"_REENTRANCY_GUARD_SLOT\"))))\nuint256 constant _REENTRANCY_GUARD_SLOT = 0x929eee14;\n\n/*\n *\n * --------------------------------------------------------------------------+\n * Opcode      | Mnemonic         | Stack               | Memory             |\n * --------------------------------------------------------------------------|\n * 60 0x02     | PUSH1 0x02       | 0x02                |                    |\n * 60 0x1e     | PUSH1 0x1e       | 0x1e 0x02           |                    |\n * 61 0x3d5c   | PUSH2 0x3d5c     | 0x3d5c 0x1e 0x02    |                    |\n * 3d          | RETURNDATASIZE   | 0 0x3d5c 0x1e 0x02  |                    |\n *                                                                           |\n * ::: store deployed bytecode in memory: (3d) RETURNDATASIZE (5c) TLOAD ::: |\n * 52          | MSTORE           | 0x1e 0x02           | [0..0x20): 0x3d5c  |\n * f3          | RETURN           |                     | [0..0x20): 0x3d5c  |\n * --------------------------------------------------------------------------+\n */\nuint256 constant _TLOAD_TEST_PAYLOAD = 0x6002_601e_613d5c_3d_52_f3;\nuint256 constant _TLOAD_TEST_PAYLOAD_LENGTH = 0x0a;\nuint256 constant _TLOAD_TEST_PAYLOAD_OFFSET = 0x16;\nuint256 constant _NOT_ENTERED_TSTORE = 0;\nuint256 constant _ENTERED_TSTORE = 1;\nuint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_TSTORE = 2;\nuint256 constant _TSTORE_ENABLED_SSTORE = 0;\nuint256 constant _NOT_ENTERED_SSTORE = 1;\nuint256 constant _ENTERED_SSTORE = 2;\nuint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_SSTORE = 3;\n\nuint256 constant Offset_fulfillAdvancedOrder_criteriaResolvers = 0x20;\nuint256 constant Offset_fulfillAvailableOrders_offerFulfillments = 0x20;\nuint256 constant Offset_fulfillAvailableOrders_considerationFulfillments = 0x40;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_criteriaResolvers = 0x20;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_offerFulfillments = 0x40;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts =\n    (0x60);\n\nuint256 constant Offset_matchOrders_fulfillments = 0x20;\n\nuint256 constant Offset_matchAdvancedOrders_criteriaResolvers = 0x20;\nuint256 constant Offset_matchAdvancedOrders_fulfillments = 0x40;\n\n// Common Offsets\n// Offsets for identically positioned fields shared by:\n// OfferItem, ConsiderationItem, SpentItem, ReceivedItem\n\nuint256 constant Selector_length = 0x4;\n\nuint256 constant Common_token_offset = 0x20;\nuint256 constant Common_identifier_offset = 0x40;\nuint256 constant Common_amount_offset = 0x60;\nuint256 constant Common_endAmount_offset = 0x80;\n\nuint256 constant SpentItem_size = 0x80;\nuint256 constant SpentItem_size_shift = 0x7;\n\nuint256 constant OfferItem_size = 0xa0;\nuint256 constant OfferItem_size_with_head_pointer = 0xc0;\n\nuint256 constant ReceivedItem_size_excluding_recipient = 0x80;\nuint256 constant ReceivedItem_size = 0xa0;\nuint256 constant ReceivedItem_amount_offset = 0x60;\nuint256 constant ReceivedItem_recipient_offset = 0x80;\n\nuint256 constant ReceivedItem_CommonParams_size = 0x60;\n\nuint256 constant ConsiderationItem_size = 0xc0;\nuint256 constant ConsiderationItem_size_with_head_pointer = 0xe0;\n\nuint256 constant ConsiderationItem_recipient_offset = 0xa0;\n// Store the same constant in an abbreviated format for a line length fix.\nuint256 constant ConsiderItem_recipient_offset = 0xa0;\n\nuint256 constant Execution_offerer_offset = 0x20;\nuint256 constant Execution_conduit_offset = 0x40;\n\n// uint256 constant OrderParameters_offerer_offset = 0x00;\nuint256 constant OrderParameters_zone_offset = 0x20;\nuint256 constant OrderParameters_offer_head_offset = 0x40;\nuint256 constant OrderParameters_consideration_head_offset = 0x60;\n// uint256 constant OrderParameters_orderType_offset = 0x80;\nuint256 constant OrderParameters_startTime_offset = 0xa0;\nuint256 constant OrderParameters_endTime_offset = 0xc0;\nuint256 constant OrderParameters_zoneHash_offset = 0xe0;\nuint256 constant OrderParameters_salt_offset = 0x100;\nuint256 constant OrderParameters_conduit_offset = 0x120;\nuint256 constant OrderParameters_counter_offset = 0x140;\n\nuint256 constant Fulfillment_itemIndex_offset = 0x20;\n\nuint256 constant AdvancedOrder_head_size = 0xa0;\nuint256 constant AdvancedOrder_numerator_offset = 0x20;\nuint256 constant AdvancedOrder_denominator_offset = 0x40;\nuint256 constant AdvancedOrder_signature_offset = 0x60;\nuint256 constant AdvancedOrder_extraData_offset = 0x80;\n\nuint256 constant OrderStatus_ValidatedAndNotCancelled = 1;\nuint256 constant OrderStatus_filledNumerator_offset = 0x10;\nuint256 constant OrderStatus_filledDenominator_offset = 0x88;\nuint256 constant OrderStatus_ValidatedAndNotCancelledAndFullyFilled = (\n    0x0000000000000000000000000000010000000000000000000000000000010001\n);\n\nuint256 constant ThirtyOneBytes = 0x1f;\nuint256 constant OneWord = 0x20;\nuint256 constant TwoWords = 0x40;\nuint256 constant ThreeWords = 0x60;\nuint256 constant FourWords = 0x80;\nuint256 constant FiveWords = 0xa0;\n\nuint256 constant OneWordShift = 0x5;\nuint256 constant TwoWordsShift = 0x6;\n\nuint256 constant SixtyThreeBytes = 0x3f;\nuint256 constant OnlyFullWordMask = 0xffffffe0;\n\nuint256 constant FreeMemoryPointerSlot = 0x40;\nuint256 constant ZeroSlot = 0x60;\nuint256 constant DefaultFreeMemoryPointer = 0x80;\n\nuint256 constant Slot0x80 = 0x80;\nuint256 constant Slot0xA0 = 0xa0;\n\nuint256 constant BasicOrder_common_params_size = 0xa0;\nuint256 constant BasicOrder_considerationHashesArray_ptr = 0x160;\nuint256 constant BasicOrder_receivedItemByteMap =\n    (0x0000010102030000000000000000000000000000000000000000000000000000);\nuint256 constant BasicOrder_offeredItemByteMap =\n    (0x0203020301010000000000000000000000000000000000000000000000000000);\nuint256 constant BasicOrder_consideration_offset_from_offer = 0xa0;\n\nbytes32 constant OrdersMatchedTopic0 =\n    (0x4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e7);\n\nuint256 constant EIP712_Order_size = 0x180;\nuint256 constant EIP712_OfferItem_size = 0xc0;\nuint256 constant EIP712_ConsiderationItem_size = 0xe0;\nuint256 constant AdditionalRecipient_size = 0x40;\nuint256 constant AdditionalRecipient_size_shift = 0x6;\n\nuint256 constant EIP712_DomainSeparator_offset = 0x02;\nuint256 constant EIP712_OrderHash_offset = 0x22;\nuint256 constant EIP712_DigestPayload_size = 0x42;\n\nuint256 constant EIP712_domainData_nameHash_offset = 0x20;\nuint256 constant EIP712_domainData_versionHash_offset = 0x40;\nuint256 constant EIP712_domainData_chainId_offset = 0x60;\nuint256 constant EIP712_domainData_verifyingContract_offset = 0x80;\nuint256 constant EIP712_domainData_size = 0xa0;\n\n// Minimum BulkOrder proof size: 64 bytes for signature + 3 for key + 32 for 1\n// sibling. Maximum BulkOrder proof size: 65 bytes for signature + 3 for key +\n// 768 for 24 siblings.\n\nuint256 constant BulkOrderProof_minSize = 0x63;\nuint256 constant BulkOrderProof_rangeSize = 0x2e2;\nuint256 constant BulkOrderProof_lengthAdjustmentBeforeMask = 0x1d;\nuint256 constant BulkOrderProof_lengthRangeAfterMask = 0x2;\nuint256 constant BulkOrderProof_keyShift = 0xe8;\nuint256 constant BulkOrderProof_keySize = 0x3;\n\nuint256 constant BulkOrder_Typehash_Height_One =\n    (0x3ca2711d29384747a8f61d60aad3c450405f7aaff5613541dee28df2d6986d32);\nuint256 constant BulkOrder_Typehash_Height_Two =\n    (0xbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde30);\nuint256 constant BulkOrder_Typehash_Height_Three =\n    (0x53c6f6856e13104584dd0797ca2b2779202dc2597c6066a42e0d8fe990b0024d);\nuint256 constant BulkOrder_Typehash_Height_Four =\n    (0xa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af1);\nuint256 constant BulkOrder_Typehash_Height_Five =\n    (0x39c9d33c18e050dda0aeb9a8086fb16fc12d5d64536780e1da7405a800b0b9f6);\nuint256 constant BulkOrder_Typehash_Height_Six =\n    (0x1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b55);\nuint256 constant BulkOrder_Typehash_Height_Seven =\n    (0xca74fab2fece9a1d58234a274220ad05ca096a92ef6a1ca1750b9d90c948955c);\nuint256 constant BulkOrder_Typehash_Height_Eight =\n    (0x7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc14);\nuint256 constant BulkOrder_Typehash_Height_Nine =\n    (0xbed7be92d41c56f9e59ac7a6272185299b815ddfabc3f25deb51fe55fe2f9e8a);\nuint256 constant BulkOrder_Typehash_Height_Ten =\n    (0xd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da05);\nuint256 constant BulkOrder_Typehash_Height_Eleven =\n    (0x896c3f349c4da741c19b37fec49ed2e44d738e775a21d9c9860a69d67a3dae53);\nuint256 constant BulkOrder_Typehash_Height_Twelve =\n    (0xbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f);\nuint256 constant BulkOrder_Typehash_Height_Thirteen =\n    (0xe6ae19322608dd1f8a8d56aab48ed9c28be489b689f4b6c91268563efc85f20e);\nuint256 constant BulkOrder_Typehash_Height_Fourteen =\n    (0x6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a852590);\nuint256 constant BulkOrder_Typehash_Height_Fifteen =\n    (0xd1eb68309202b7106b891e109739dbbd334a1817fe5d6202c939e75cf5e35ca9);\nuint256 constant BulkOrder_Typehash_Height_Sixteen =\n    (0x1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde8);\nuint256 constant BulkOrder_Typehash_Height_Seventeen =\n    (0xeee9a1392aa395c7002308119a58f2582777a75e54e0c1d5d5437bd2e8bf6222);\nuint256 constant BulkOrder_Typehash_Height_Eighteen =\n    (0xc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d85877);\nuint256 constant BulkOrder_Typehash_Height_Nineteen =\n    (0x0efca7572ac20f5ae84db0e2940674f7eca0a4726fa1060ffc2d18cef54b203d);\nuint256 constant BulkOrder_Typehash_Height_Twenty =\n    (0x5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e64350017);\nuint256 constant BulkOrder_Typehash_Height_TwentyOne =\n    (0x80987079d291feebf21c2230e69add0f283cee0b8be492ca8050b4185a2ff719);\nuint256 constant BulkOrder_Typehash_Height_TwentyTwo =\n    (0x3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d);\nuint256 constant BulkOrder_Typehash_Height_TwentyThree =\n    (0x5d6a3f098a0bc373f808c619b1bb4028208721b3c4f8d6bc8a874d659814eb76);\nuint256 constant BulkOrder_Typehash_Height_TwentyFour =\n    (0x1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c);\n\nuint256 constant receivedItemsHash_ptr = 0x60;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  data for OrderFulfilled\n *\n *   event OrderFulfilled(\n *     bytes32 orderHash,\n *     address indexed offerer,\n *     address indexed zone,\n *     address fulfiller,\n *     SpentItem[] offer,\n *       > (itemType, token, id, amount)\n *     ReceivedItem[] consideration\n *       > (itemType, token, id, amount, recipient)\n *   )\n *\n *  - 0x00: orderHash\n *  - 0x20: fulfiller\n *  - 0x40: offer offset (0x80)\n *  - 0x60: consideration offset (0x120)\n *  - 0x80: offer.length (1)\n *  - 0xa0: offerItemType\n *  - 0xc0: offerToken\n *  - 0xe0: offerIdentifier\n *  - 0x100: offerAmount\n *  - 0x120: consideration.length (1 + additionalRecipients.length)\n *  - 0x140: considerationItemType\n *  - 0x160: considerationToken\n *  - 0x180: considerationIdentifier\n *  - 0x1a0: considerationAmount\n *  - 0x1c0: considerationRecipient\n *  - ...\n */\n\n// Minimum length of the OrderFulfilled event data.\n// Must be added to the size of the ReceivedItem array for additionalRecipients\n// (0xa0 * additionalRecipients.length) to calculate full size of the buffer.\nuint256 constant OrderFulfilled_baseSize = 0x1e0;\nuint256 constant OrderFulfilled_selector =\n    (0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31);\n\n// Minimum offset in memory to OrderFulfilled event data.\n// Must be added to the size of the EIP712 hash array for additionalRecipients\n// (32 * additionalRecipients.length) to calculate the pointer to event data.\nuint256 constant OrderFulfilled_baseOffset = 0x180;\nuint256 constant OrderFulfilled_consideration_length_baseOffset = 0x2a0;\nuint256 constant OrderFulfilled_offer_length_baseOffset = 0x200;\n\nuint256 constant OrderFulfilled_offer_length_offset_relativeTo_baseOffset = (\n    0x80\n);\nuint256 constant OrderFulfilled_offer_itemType_offset_relativeTo_baseOffset = (\n    0xa0\n);\nuint256 constant OrderFulfilled_offer_token_offset_relativeTo_baseOffset = 0xc0;\n\n// Related constants used for restricted order checks on basic orders.\nuint256 constant OrderFulfilled_baseDataSize = 0x160;\n// uint256 constant ValidateOrder_offerDataOffset = 0x184;\n// uint256 constant RatifyOrder_offerDataOffset = 0xc4;\n\n// uint256 constant OrderFulfilled_orderHash_offset = 0x00;\nuint256 constant OrderFulfilled_fulfiller_offset = 0x20;\nuint256 constant OrderFulfilled_offer_head_offset = 0x40;\nuint256 constant OrderFulfilled_offer_body_offset = 0x80;\nuint256 constant OrderFulfilled_consideration_head_offset = 0x60;\nuint256 constant OrderFulfilled_consideration_body_offset = 0x120;\n\n/*\n * 3 memory slots/words for `authorizeOrder` and `validateOrder` calldata\n * to be used for tails of extra data (length 0) and order hashes (length 1)\n */\nuint256 constant OrderFulfilled_post_memory_region_reservedBytes = 0x60;\n\n/*\n * OrderFulfilled_offer_length_baseOffset - 12 * 0x20\n * we back up 12 words from where the `OrderFulfilled`'s data\n * for spent items start to be rewritten for `authorizeOrder`\n * and `validateOrder`. Let the reference pointer be `ptr`\n * pointing to the `OrderFulfilled`'s spent item array's length memory\n * position then we would have:\n *\n * ptr - 0x0180 : zero-padded calldata selector\n * ptr - 0x0160 : ZoneParameter's struct head (0x20)\n * ptr - 0x0140 : order hash\n * ptr - 0x0120 : fulfiller (msg.sender)\n * ptr - 0x0100 : offerer\n * ptr - 0x00e0 : spent items' head\n * ptr - 0x00c0 : received items' head\n * ptr - 0x00a0 : extra data / context head\n * ptr - 0x0080 : order hashes head\n * ptr - 0x0060 : start time\n * ptr - 0x0040 : end time\n * ptr - 0x0020 : zone hash\n * ptr - 0x0000 : offer.length (1)\n * ...\n *\n * Note that the padded calldata selector will be at minimum at the\n * 0x80 memory slot.\n */\nuint256 constant authorizeOrder_calldata_baseOffset = (\n    OrderFulfilled_offer_length_baseOffset - 0x180\n);\n\n// BasicOrderParameters\nuint256 constant BasicOrder_parameters_cdPtr = 0x04;\nuint256 constant BasicOrder_considerationToken_cdPtr = 0x24;\nuint256 constant BasicOrder_considerationIdentifier_cdPtr = 0x44;\nuint256 constant BasicOrder_considerationAmount_cdPtr = 0x64;\nuint256 constant BasicOrder_offerer_cdPtr = 0x84;\nuint256 constant BasicOrder_zone_cdPtr = 0xa4;\nuint256 constant BasicOrder_offerToken_cdPtr = 0xc4;\nuint256 constant BasicOrder_offerIdentifier_cdPtr = 0xe4;\nuint256 constant BasicOrder_offerAmount_cdPtr = 0x104;\nuint256 constant BasicOrder_basicOrderParameters_cd_offset = 0x24;\nuint256 constant BasicOrder_basicOrderType_cdPtr = 0x124;\nuint256 constant BasicOrder_startTime_cdPtr = 0x144;\nuint256 constant BasicOrder_endTime_cdPtr = 0x164;\n// uint256 constant BasicOrder_zoneHash_cdPtr = 0x184;\n// uint256 constant BasicOrder_salt_cdPtr = 0x1a4;\nuint256 constant BasicOrder_offererConduit_cdPtr = 0x1c4;\nuint256 constant BasicOrder_fulfillerConduit_cdPtr = 0x1e4;\nuint256 constant BasicOrder_totalOriginalAdditionalRecipients_cdPtr = 0x204;\nuint256 constant BasicOrder_additionalRecipients_head_cdPtr = 0x224;\nuint256 constant BasicOrder_signature_cdPtr = 0x244;\nuint256 constant BasicOrder_additionalRecipients_length_cdPtr = 0x264;\nuint256 constant BasicOrder_addlRecipients_length_cdPtr = 0x264;\nuint256 constant BasicOrder_additionalRecipients_data_cdPtr = 0x284;\nuint256 constant BasicOrder_parameters_ptr = 0x20;\nuint256 constant BasicOrder_basicOrderType_range = 0x18; // 24 values\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for ConsiderationItem\n *   - 0x80: ConsiderationItem EIP-712 typehash (constant)\n *   - 0xa0: itemType\n *   - 0xc0: token\n *   - 0xe0: identifier\n *   - 0x100: startAmount\n *   - 0x120: endAmount\n *   - 0x140: recipient\n */\nuint256 constant BasicOrder_considerationItem_typeHash_ptr = 0x80; // memoryPtr\nuint256 constant BasicOrder_considerationItem_itemType_ptr = 0xa0;\nuint256 constant BasicOrder_considerationItem_token_ptr = 0xc0;\nuint256 constant BasicOrder_considerationItem_identifier_ptr = 0xe0;\nuint256 constant BasicOrder_considerationItem_startAmount_ptr = 0x100;\nuint256 constant BasicOrder_considerationItem_endAmount_ptr = 0x120;\n// uint256 constant BasicOrder_considerationItem_recipient_ptr = 0x140;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for OfferItem\n *   - 0x80:  OfferItem EIP-712 typehash (constant)\n *   - 0xa0:  itemType\n *   - 0xc0:  token\n *   - 0xe0:  identifier (reused for offeredItemsHash)\n *   - 0x100: startAmount\n *   - 0x120: endAmount\n */\nuint256 constant BasicOrder_offerItem_typeHash_ptr = 0x80;\nuint256 constant BasicOrder_offerItem_itemType_ptr = 0xa0;\nuint256 constant BasicOrder_offerItem_token_ptr = 0xc0;\n// uint256 constant BasicOrder_offerItem_identifier_ptr = 0xe0;\n// uint256 constant BasicOrder_offerItem_startAmount_ptr = 0x100;\nuint256 constant BasicOrder_offerItem_endAmount_ptr = 0x120;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for Order\n *   - 0x80:   Order EIP-712 typehash (constant)\n *   - 0xa0:   orderParameters.offerer\n *   - 0xc0:   orderParameters.zone\n *   - 0xe0:   keccak256(abi.encodePacked(offerHashes))\n *   - 0x100:  keccak256(abi.encodePacked(considerationHashes))\n *   - 0x120:  orderType\n *   - 0x140:  startTime\n *   - 0x160:  endTime\n *   - 0x180:  zoneHash\n *   - 0x1a0:  salt\n *   - 0x1c0:  conduit\n *   - 0x1e0:  _counters[orderParameters.offerer] (from storage)\n */\nuint256 constant BasicOrder_order_typeHash_ptr = 0x80;\nuint256 constant BasicOrder_order_offerer_ptr = 0xa0;\n// uint256 constant BasicOrder_order_zone_ptr = 0xc0;\nuint256 constant BasicOrder_order_offerHashes_ptr = 0xe0;\nuint256 constant BasicOrder_order_considerationHashes_ptr = 0x100;\nuint256 constant BasicOrder_order_orderType_ptr = 0x120;\nuint256 constant BasicOrder_order_startTime_ptr = 0x140;\n// uint256 constant BasicOrder_order_endTime_ptr = 0x160;\n// uint256 constant BasicOrder_order_zoneHash_ptr = 0x180;\n// uint256 constant BasicOrder_order_salt_ptr = 0x1a0;\n// uint256 constant BasicOrder_order_conduitKey_ptr = 0x1c0;\nuint256 constant BasicOrder_order_counter_ptr = 0x1e0;\nuint256 constant BasicOrder_additionalRecipients_head_ptr = 0x240;\nuint256 constant BasicOrder_signature_ptr = 0x260;\nuint256 constant BasicOrder_startTimeThroughZoneHash_size = 0x60;\n\nuint256 constant ContractOrder_orderHash_offerer_shift = 0x60;\n\nuint256 constant Counter_blockhash_shift = 0x80;\n\n// Signature-related\nbytes32 constant EIP2098_allButHighestBitMask =\n    (0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\nbytes32 constant ECDSA_twentySeventhAndTwentyEighthBytesSet =\n    (0x0000000000000000000000000000000000000000000000000000000101000000);\nuint256 constant ECDSA_MaxLength = 65;\nuint256 constant ECDSA_signature_s_offset = 0x40;\nuint256 constant ECDSA_signature_v_offset = 0x60;\n\nbytes32 constant EIP1271_isValidSignature_selector =\n    (0x1626ba7e00000000000000000000000000000000000000000000000000000000);\nuint256 constant EIP1271_isValidSignature_digest_negativeOffset = 0x40;\nuint256 constant EIP1271_isValidSignature_selector_negativeOffset = 0x44;\nuint256 constant EIP1271_isValidSignature_calldata_baseLength = 0x64;\nuint256 constant EIP1271_isValidSignature_signature_head_offset = 0x40;\n\nuint256 constant EIP_712_PREFIX =\n    (0x1901000000000000000000000000000000000000000000000000000000000000);\n\nuint256 constant ExtraGasBuffer = 0x20;\nuint256 constant CostPerWord = 0x3;\nuint256 constant MemoryExpansionCoefficientShift = 0x9;\n\nuint256 constant Create2AddressDerivation_ptr = 0x0b;\nuint256 constant Create2AddressDerivation_length = 0x55;\n\nuint256 constant MaskOverByteTwelve =\n    (0x0000000000000000000000ff0000000000000000000000000000000000000000);\nuint256 constant MaskOverLastTwentyBytes =\n    (0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff);\nuint256 constant AddressDirtyUpperBitThreshold =\n    (0x0000000000000000000000010000000000000000000000000000000000000000);\nuint256 constant MaskOverFirstFourBytes =\n    (0xffffffff00000000000000000000000000000000000000000000000000000000);\n\nuint256 constant Conduit_execute_signature =\n    (0x4ce34aa200000000000000000000000000000000000000000000000000000000);\n\nuint256 constant MaxUint8 = 0xff;\nuint256 constant MaxUint120 = 0xffffffffffffffffffffffffffffff;\n\nuint256 constant Conduit_execute_ConduitTransfer_ptr = 0x20;\nuint256 constant Conduit_execute_ConduitTransfer_length = 0x01;\nuint256 constant Conduit_execute_ConduitTransfer_offset_ptr = 0x04;\nuint256 constant Conduit_execute_ConduitTransfer_length_ptr = 0x24;\nuint256 constant Conduit_execute_transferItemType_ptr = 0x44;\nuint256 constant Conduit_execute_transferToken_ptr = 0x64;\nuint256 constant Conduit_execute_transferFrom_ptr = 0x84;\nuint256 constant Conduit_execute_transferTo_ptr = 0xa4;\nuint256 constant Conduit_execute_transferIdentifier_ptr = 0xc4;\nuint256 constant Conduit_execute_transferAmount_ptr = 0xe4;\n\nuint256 constant OneConduitExecute_size = 0x104;\n\n// Sentinel value to indicate that the conduit accumulator is not armed.\nuint256 constant AccumulatorDisarmed = 0x20;\nuint256 constant AccumulatorArmed = 0x40;\nuint256 constant Accumulator_conduitKey_ptr = 0x20;\nuint256 constant Accumulator_selector_ptr = 0x40;\nuint256 constant Accumulator_array_offset_ptr = 0x44;\nuint256 constant Accumulator_array_length_ptr = 0x64;\nuint256 constant Accumulator_itemSizeOffsetDifference = 0x3c;\nuint256 constant Accumulator_array_offset = 0x20;\n\nuint256 constant Conduit_transferItem_size = 0xc0;\nuint256 constant Conduit_transferItem_token_ptr = 0x20;\nuint256 constant Conduit_transferItem_from_ptr = 0x40;\nuint256 constant Conduit_transferItem_to_ptr = 0x60;\nuint256 constant Conduit_transferItem_identifier_ptr = 0x80;\nuint256 constant Conduit_transferItem_amount_ptr = 0xa0;\n\nuint256 constant Ecrecover_precompile = 0x1;\nuint256 constant Ecrecover_args_size = 0x80;\nuint256 constant Signature_lower_v = 27;\n\n// Bitmask that only gives a non-zero value if masked with a non-match selector.\nuint256 constant NonMatchSelector_MagicMask =\n    (0x4000000000000000000000000000000000000000000000000000000000);\n\n// First bit indicates that a NATIVE offer items has been used and the 231st bit\n// indicates that a non match selector has been called.\nuint256 constant NonMatchSelector_InvalidErrorValue =\n    (0x4000000000000000000000000000000000000000000000000000000001);\n\n/**\n * @dev Selector and offsets for generateOrder\n *\n * function generateOrder(\n *   address fulfiller,\n *   SpentItem[] calldata minimumReceived,\n *   SpentItem[] calldata maximumSpent,\n *   bytes calldata context\n * )\n */\nuint256 constant generateOrder_selector = 0x98919765;\nuint256 constant generateOrder_selector_offset = 0x1c;\nuint256 constant generateOrder_head_offset = 0x04;\nuint256 constant generateOrder_minimumReceived_head_offset = 0x20;\nuint256 constant generateOrder_maximumSpent_head_offset = 0x40;\nuint256 constant generateOrder_context_head_offset = 0x60;\nuint256 constant generateOrder_base_tail_offset = 0x80;\nuint256 constant generateOrder_maximum_returned_array_length = 0xffff;\n\nuint256 constant ratifyOrder_selector = 0xf4dd92ce;\nuint256 constant ratifyOrder_selector_offset = 0x1c;\nuint256 constant ratifyOrder_head_offset = 0x04;\n// uint256 constant ratifyOrder_offer_head_offset = 0x00;\nuint256 constant ratifyOrder_consideration_head_offset = 0x20;\nuint256 constant ratifyOrder_context_head_offset = 0x40;\nuint256 constant ratifyOrder_orderHashes_head_offset = 0x60;\nuint256 constant ratifyOrder_contractNonce_offset = 0x80;\nuint256 constant ratifyOrder_base_tail_offset = 0xa0;\n\nuint256 constant validateOrder_selector = 0x17b1f942;\nuint256 constant validateOrder_selector_offset = 0x1c;\nuint256 constant validateOrder_head_offset = 0x04;\nuint256 constant validateOrder_zoneParameters_offset = 0x20;\n\nuint256 constant authorizeOrder_selector = 0x01e4d72a;\nuint256 constant authorizeOrder_selector_offset = 0x1c;\nuint256 constant authorizeOrder_head_offset = 0x04;\nuint256 constant authorizeOrder_zoneParameters_offset = 0x20;\n\n// uint256 constant ZoneParameters_orderHash_offset = 0x00;\nuint256 constant ZoneParameters_fulfiller_offset = 0x20;\nuint256 constant ZoneParameters_offerer_offset = 0x40;\nuint256 constant ZoneParameters_offer_head_offset = 0x60;\nuint256 constant ZoneParameters_consideration_head_offset = 0x80;\nuint256 constant ZoneParameters_extraData_head_offset = 0xa0;\nuint256 constant ZoneParameters_orderHashes_head_offset = 0xc0;\nuint256 constant ZoneParameters_startTime_offset = 0xe0;\nuint256 constant ZoneParameters_endTime_offset = 0x100;\nuint256 constant ZoneParameters_zoneHash_offset = 0x120;\nuint256 constant ZoneParameters_base_tail_offset = 0x140;\nuint256 constant ZoneParameters_selectorAndPointer_length = 0x24;\nuint256 constant ZoneParameters_basicOrderFixedElements_length = 0x44;\n\n// ConsiderationDecoder Constants\nuint256 constant OrderParameters_head_size = 0x0160;\nuint256 constant OrderParameters_totalOriginalConsiderationItems_offset = (\n    0x0140\n);\nuint256 constant AdvancedOrderPlusOrderParameters_head_size = 0x0200;\n\nuint256 constant Order_signature_offset = 0x20;\nuint256 constant Order_head_size = 0x40;\n\nuint256 constant AdvancedOrder_fixed_segment_0 = 0x40;\n\nuint256 constant CriteriaResolver_head_size = 0xa0;\nuint256 constant CriteriaResolver_fixed_segment_0 = 0x80;\nuint256 constant CriteriaResolver_criteriaProof_offset = 0x80;\n\nuint256 constant FulfillmentComponent_mem_tail_size = 0x40;\nuint256 constant FulfillmentComponent_mem_tail_size_shift = 0x6;\nuint256 constant Fulfillment_head_size = 0x40;\nuint256 constant Fulfillment_considerationComponents_offset = 0x20;\n\nuint256 constant OrderComponents_OrderParameters_common_head_size = 0x0140;\n"},"lib/seaport-types/src/interfaces/ConduitInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    ConduitBatch1155Transfer,\n    ConduitTransfer\n} from \"../conduit/lib/ConduitStructs.sol\";\n\n/**\n * @title ConduitInterface\n * @author 0age\n * @notice ConduitInterface contains all external function interfaces, events,\n *         and errors for conduit contracts.\n */\ninterface ConduitInterface {\n    /**\n     * @dev Revert with an error when attempting to execute transfers using a\n     *      caller that does not have an open channel.\n     */\n    error ChannelClosed(address channel);\n\n    /**\n     * @dev Revert with an error when attempting to update a channel to the\n     *      current status of that channel.\n     */\n    error ChannelStatusAlreadySet(address channel, bool isOpen);\n\n    /**\n     * @dev Revert with an error when attempting to execute a transfer for an\n     *      item that does not have an ERC20/721/1155 item type.\n     */\n    error InvalidItemType();\n\n    /**\n     * @dev Revert with an error when attempting to update the status of a\n     *      channel from a caller that is not the conduit controller.\n     */\n    error InvalidController();\n\n    /**\n     * @dev Emit an event whenever a channel is opened or closed.\n     *\n     * @param channel The channel that has been updated.\n     * @param open    A boolean indicating whether the conduit is open or not.\n     */\n    event ChannelUpdated(address indexed channel, bool open);\n\n    /**\n     * @notice Execute a sequence of ERC20/721/1155 transfers. Only a caller\n     *         with an open channel can call this function.\n     *\n     * @param transfers The ERC20/721/1155 transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function execute(\n        ConduitTransfer[] calldata transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Execute a sequence of batch 1155 transfers. Only a caller with an\n     *         open channel can call this function.\n     *\n     * @param batch1155Transfers The 1155 batch transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function executeBatch1155(\n        ConduitBatch1155Transfer[] calldata batch1155Transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Execute a sequence of transfers, both single and batch 1155. Only\n     *         a caller with an open channel can call this function.\n     *\n     * @param standardTransfers  The ERC20/721/1155 transfers to perform.\n     * @param batch1155Transfers The 1155 batch transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function executeWithBatch1155(\n        ConduitTransfer[] calldata standardTransfers,\n        ConduitBatch1155Transfer[] calldata batch1155Transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Open or close a given channel. Only callable by the controller.\n     *\n     * @param channel The channel to open or close.\n     * @param isOpen  The status of the channel (either open or closed).\n     */\n    function updateChannel(address channel, bool isOpen) external;\n}\n"},"lib/seaport-types/src/interfaces/ReentrancyErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ReentrancyErrors\n * @author 0age\n * @notice ReentrancyErrors contains errors related to reentrancy.\n */\ninterface ReentrancyErrors {\n    /**\n     * @dev Revert with an error when a caller attempts to reenter a protected\n     *      function.\n     */\n    error NoReentrantCalls();\n\n    /**\n     * @dev Revert with an error when attempting to activate the TSTORE opcode\n     *      when it is already active.\n     */\n    error TStoreAlreadyActivated();\n\n    /**\n     * @dev Revert with an error when attempting to activate the TSTORE opcode\n     *      in an EVM environment that does not support it.\n     */\n    error TStoreNotSupported();\n\n    /**\n     * @dev Revert with an error when deployment of the contract for testing\n     *      TSTORE support fails.\n     */\n    error TloadTestContractDeploymentFailed();\n}\n"},"lib/seaport-types/src/lib/TokenTransferrerConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/*\n * -------------------------- Disambiguation & Other Notes ---------------------\n *    - The term \"head\" is used as it is in the documentation for ABI encoding,\n *      but only in reference to dynamic types, i.e. it always refers to the\n *      offset or pointer to the body of a dynamic type. In calldata, the head\n *      is always an offset (relative to the parent object), while in memory,\n *      the head is always the pointer to the body. More information found here:\n *      https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#argument-encoding\n *        - Note that the length of an array is separate from and precedes the\n *          head of the array.\n *\n *    - The term \"body\" is used in place of the term \"head\" used in the ABI\n *      documentation. It refers to the start of the data for a dynamic type,\n *      e.g. the first word of a struct or the first word of the first element\n *      in an array.\n *\n *    - The term \"pointer\" is used to describe the absolute position of a value\n *      and never an offset relative to another value.\n *        - The suffix \"_ptr\" refers to a memory pointer.\n *        - The suffix \"_cdPtr\" refers to a calldata pointer.\n *\n *    - The term \"offset\" is used to describe the position of a value relative\n *      to some parent value. For example, OrderParameters_conduit_offset is the\n *      offset to the \"conduit\" value in the OrderParameters struct relative to\n *      the start of the body.\n *        - Note: Offsets are used to derive pointers.\n *\n *    - Some structs have pointers defined for all of their fields in this file.\n *      Lines which are commented out are fields that are not used in the\n *      codebase but have been left in for readability.\n */\n\nuint256 constant ThirtyOneBytes = 0x1f;\nuint256 constant OneWord = 0x20;\nuint256 constant TwoWords = 0x40;\nuint256 constant ThreeWords = 0x60;\n\nuint256 constant OneWordShift = 0x5;\nuint256 constant TwoWordsShift = 0x6;\n\nuint256 constant FreeMemoryPointerSlot = 0x40;\nuint256 constant ZeroSlot = 0x60;\nuint256 constant DefaultFreeMemoryPointer = 0x80;\n\nuint256 constant Slot0x80 = 0x80;\nuint256 constant Slot0xA0 = 0xa0;\nuint256 constant Slot0xC0 = 0xc0;\n\nuint256 constant Generic_error_selector_offset = 0x1c;\n\n// abi.encodeWithSignature(\"transferFrom(address,address,uint256)\")\nuint256 constant ERC20_transferFrom_signature = (\n    0x23b872dd00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC20_transferFrom_sig_ptr = 0x0;\nuint256 constant ERC20_transferFrom_from_ptr = 0x04;\nuint256 constant ERC20_transferFrom_to_ptr = 0x24;\nuint256 constant ERC20_transferFrom_amount_ptr = 0x44;\nuint256 constant ERC20_transferFrom_length = 0x64; // 4 + 32 * 3 == 100\n\n// abi.encodeWithSignature(\n//     \"safeTransferFrom(address,address,uint256,uint256,bytes)\"\n// )\nuint256 constant ERC1155_safeTransferFrom_signature = (\n    0xf242432a00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC1155_safeTransferFrom_sig_ptr = 0x0;\nuint256 constant ERC1155_safeTransferFrom_from_ptr = 0x04;\nuint256 constant ERC1155_safeTransferFrom_to_ptr = 0x24;\nuint256 constant ERC1155_safeTransferFrom_id_ptr = 0x44;\nuint256 constant ERC1155_safeTransferFrom_amount_ptr = 0x64;\nuint256 constant ERC1155_safeTransferFrom_data_offset_ptr = 0x84;\nuint256 constant ERC1155_safeTransferFrom_data_length_ptr = 0xa4;\nuint256 constant ERC1155_safeTransferFrom_length = 0xc4; // 4 + 32 * 6 == 196\nuint256 constant ERC1155_safeTransferFrom_data_length_offset = 0xa0;\n\n// abi.encodeWithSignature(\n//     \"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\"\n// )\nuint256 constant ERC1155_safeBatchTransferFrom_signature = (\n    0x2eb2c2d600000000000000000000000000000000000000000000000000000000\n);\n\n// bytes4 constant ERC1155_safeBatchTransferFrom_selector = bytes4(\n//     bytes32(ERC1155_safeBatchTransferFrom_signature)\n// );\n\nuint256 constant ERC721_transferFrom_signature = (\n    0x23b872dd00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC721_transferFrom_sig_ptr = 0x0;\nuint256 constant ERC721_transferFrom_from_ptr = 0x04;\nuint256 constant ERC721_transferFrom_to_ptr = 0x24;\nuint256 constant ERC721_transferFrom_id_ptr = 0x44;\nuint256 constant ERC721_transferFrom_length = 0x64; // 4 + 32 * 3 == 100\n\n/*\n *  error NoContract(address account)\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x00: account\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant NoContract_error_selector = 0x5f15d672;\nuint256 constant NoContract_error_account_ptr = 0x20;\nuint256 constant NoContract_error_length = 0x24;\n\n/*\n *  error TokenTransferGenericFailure(\n *      address token,\n *      address from,\n *      address to,\n *      uint256 identifier,\n *      uint256 amount\n *  )\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: token\n *    - 0x40: from\n *    - 0x60: to\n *    - 0x80: identifier\n *    - 0xa0: amount\n * Revert buffer is memory[0x1c:0xc0]\n */\nuint256 constant TokenTransferGenericFailure_error_selector = 0xf486bc87;\nuint256 constant TokenTransferGenericFailure_error_token_ptr = 0x20;\nuint256 constant TokenTransferGenericFailure_error_from_ptr = 0x40;\nuint256 constant TokenTransferGenericFailure_error_to_ptr = 0x60;\nuint256 constant TokenTransferGenericFailure_error_identifier_ptr = 0x80;\nuint256 constant TokenTransferGenericFailure_err_identifier_ptr = 0x80;\nuint256 constant TokenTransferGenericFailure_error_amount_ptr = 0xa0;\nuint256 constant TokenTransferGenericFailure_error_length = 0xa4;\n\nuint256 constant ExtraGasBuffer = 0x20;\nuint256 constant CostPerWord = 0x3;\nuint256 constant MemoryExpansionCoefficientShift = 0x9;\n\n// Values are offset by 32 bytes in order to write the token to the beginning\n// in the event of a revert\nuint256 constant BatchTransfer1155Params_ptr = 0x24;\nuint256 constant BatchTransfer1155Params_ids_head_ptr = 0x64;\nuint256 constant BatchTransfer1155Params_amounts_head_ptr = 0x84;\nuint256 constant BatchTransfer1155Params_data_head_ptr = 0xa4;\nuint256 constant BatchTransfer1155Params_data_length_basePtr = 0xc4;\nuint256 constant BatchTransfer1155Params_calldata_baseSize = 0xc4;\n\nuint256 constant BatchTransfer1155Params_ids_length_ptr = 0xc4;\n\nuint256 constant BatchTransfer1155Params_ids_length_offset = 0xa0;\n// uint256 constant BatchTransfer1155Params_amounts_length_baseOffset = 0xc0;\n// uint256 constant BatchTransfer1155Params_data_length_baseOffset = 0xe0;\n\nuint256 constant ConduitBatch1155Transfer_usable_head_size = 0x80;\n\nuint256 constant ConduitBatch1155Transfer_from_offset = 0x20;\nuint256 constant ConduitBatch1155Transfer_ids_head_offset = 0x60;\n// uint256 constant ConduitBatch1155Transfer_amounts_head_offset = 0x80;\nuint256 constant ConduitBatch1155Transfer_ids_length_offset = 0xa0;\nuint256 constant ConduitBatch1155Transfer_amounts_length_baseOffset = 0xc0;\n// uint256 constant ConduitBatch1155Transfer_calldata_baseSize = 0xc0;\n\n// Note: abbreviated version of above constant to adhere to line length limit.\nuint256 constant ConduitBatchTransfer_amounts_head_offset = 0x80;\n\nuint256 constant Invalid1155BatchTransferEncoding_ptr = 0x00;\nuint256 constant Invalid1155BatchTransferEncoding_length = 0x04;\nuint256 constant Invalid1155BatchTransferEncoding_selector = (\n    0xeba2084c00000000000000000000000000000000000000000000000000000000\n);\n\nuint256 constant ERC1155BatchTransferGenericFailure_error_signature = (\n    0xafc445e200000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC1155BatchTransferGenericFailure_token_ptr = 0x04;\nuint256 constant ERC1155BatchTransferGenericFailure_ids_offset = 0xc0;\n\n/*\n *  error BadReturnValueFromERC20OnTransfer(\n *      address token, address from, address to, uint256 amount\n *  )\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x00: token\n *    - 0x20: from\n *    - 0x40: to\n *    - 0x60: amount\n * Revert buffer is memory[0x1c:0xa0]\n */\nuint256 constant BadReturnValueFromERC20OnTransfer_error_selector = 0x98891923;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_token_ptr = 0x20;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_from_ptr = 0x40;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_to_ptr = 0x60;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_amount_ptr = 0x80;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_length = 0x84;\n"},"lib/seaport-types/src/lib/ConsiderationErrorConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nuint256 constant Error_selector_offset = 0x1c;\n\n/*\n *  error MissingFulfillmentComponentOnAggregation(uint8 side)\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: side\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant MissingFulfillmentComponentOnAggregation_error_selector = (\n    0x375c24c1\n);\nuint256 constant MissingFulfillmentComponentOnAggregation_error_side_ptr = 0x20;\nuint256 constant MissingFulfillmentComponentOnAggregation_error_length = 0x24;\n\n/*\n *  error OfferAndConsiderationRequiredOnFulfillment()\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant OfferAndConsiderationRequiredOnFulfillment_error_selector = (\n    0x98e9db6e\n);\nuint256 constant OfferAndConsiderationRequiredOnFulfillment_error_length = 0x04;\n\n/*\n *  error MismatchedFulfillmentOfferAndConsiderationComponents(\n *      uint256 fulfillmentIndex\n *  )\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: fulfillmentIndex\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant MismatchedOfferAndConsiderationComponents_error_selector = (\n    0xbced929d\n);\nuint256 constant MismatchedOfferAndConsiderationComponents_error_idx_ptr = 0x20;\nuint256 constant MismatchedOfferAndConsiderationComponents_error_length = 0x24;\n\n/*\n *  error InvalidFulfillmentComponentData()\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidFulfillmentComponentData_error_selector = 0x7fda7279;\nuint256 constant InvalidFulfillmentComponentData_error_length = 0x04;\n\n/*\n *  error InexactFraction()\n *    - Defined in AmountDerivationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InexactFraction_error_selector = 0xc63cf089;\nuint256 constant InexactFraction_error_length = 0x04;\n\n/*\n *  error OrderCriteriaResolverOutOfRange(uint8 side)\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: side\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderCriteriaResolverOutOfRange_error_selector = 0x133c37c6;\nuint256 constant OrderCriteriaResolverOutOfRange_error_side_ptr = 0x20;\nuint256 constant OrderCriteriaResolverOutOfRange_error_length = 0x24;\n\n/*\n *  error UnresolvedOfferCriteria(uint256 orderIndex, uint256 offerIndex)\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: offerIndex\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant UnresolvedOfferCriteria_error_selector = 0xd6929332;\nuint256 constant UnresolvedOfferCriteria_error_orderIndex_ptr = 0x20;\nuint256 constant UnresolvedOfferCriteria_error_offerIndex_ptr = 0x40;\nuint256 constant UnresolvedOfferCriteria_error_length = 0x44;\n\n/*\n *  error UnresolvedConsiderationCriteria(\n *      uint256 orderIndex,\n *      uint256 considerationIndex\n *  )\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: considerationIndex\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant UnresolvedConsiderationCriteria_error_selector = 0xa8930e9a;\nuint256 constant UnresolvedConsiderationCriteria_error_orderIndex_ptr = 0x20;\nuint256 constant UnresolvedConsiderationCriteria_error_itemIndex_ptr = 0x40;\nuint256 constant UnresolvedConsiderationCriteria_error_length = 0x44;\n\n/*\n *  error OfferCriteriaResolverOutOfRange()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant OfferCriteriaResolverOutOfRange_error_selector = 0xbfb3f8ce;\n// uint256 constant OfferCriteriaResolverOutOfRange_error_length = 0x04;\n\n/*\n *  error ConsiderationCriteriaResolverOutOfRange()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant ConsiderationCriteriaResolverOutOfRange_error_selector = (\n    0x6088d7de\n);\nuint256 constant ConsiderationCriteriaResolverOutOfRange_err_selector = (\n    0x6088d7de\n);\n// uint256 constant ConsiderationCriteriaResolverOutOfRange_error_length = 0x04;\n\n/*\n *  error CriteriaNotEnabledForItem()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant CriteriaNotEnabledForItem_error_selector = 0x94eb6af6;\nuint256 constant CriteriaNotEnabledForItem_error_length = 0x04;\n\n/*\n *  error InvalidProof()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidProof_error_selector = 0x09bde339;\nuint256 constant InvalidProof_error_length = 0x04;\n\n/*\n *  error InvalidRestrictedOrder(bytes32 orderHash)\n *    - Defined in ZoneInteractionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidRestrictedOrder_error_selector = 0xfb5014fc;\nuint256 constant InvalidRestrictedOrder_error_orderHash_ptr = 0x20;\nuint256 constant InvalidRestrictedOrder_error_length = 0x24;\n\n/*\n *  error InvalidContractOrder(bytes32 orderHash)\n *    - Defined in ZoneInteractionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidContractOrder_error_selector = 0x93979285;\nuint256 constant InvalidContractOrder_error_orderHash_ptr = 0x20;\nuint256 constant InvalidContractOrder_error_length = 0x24;\n\n/*\n *  error BadSignatureV(uint8 v)\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: v\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant BadSignatureV_error_selector = 0x1f003d0a;\nuint256 constant BadSignatureV_error_v_ptr = 0x20;\nuint256 constant BadSignatureV_error_length = 0x24;\n\n/*\n *  error InvalidSigner()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidSigner_error_selector = 0x815e1d64;\nuint256 constant InvalidSigner_error_length = 0x04;\n\n/*\n *  error InvalidSignature()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidSignature_error_selector = 0x8baa579f;\nuint256 constant InvalidSignature_error_length = 0x04;\n\n/*\n *  error BadContractSignature()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant BadContractSignature_error_selector = 0x4f7fb80d;\nuint256 constant BadContractSignature_error_length = 0x04;\n\n/*\n *  error InvalidERC721TransferAmount(uint256 amount)\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: amount\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidERC721TransferAmount_error_selector = 0x69f95827;\nuint256 constant InvalidERC721TransferAmount_error_amount_ptr = 0x20;\nuint256 constant InvalidERC721TransferAmount_error_length = 0x24;\n\n/*\n *  error MissingItemAmount()\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant MissingItemAmount_error_selector = 0x91b3e514;\nuint256 constant MissingItemAmount_error_length = 0x04;\n\n/*\n *  error UnusedItemParameters()\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant UnusedItemParameters_error_selector = 0x6ab37ce7;\nuint256 constant UnusedItemParameters_error_length = 0x04;\n\n/*\n *  error NoReentrantCalls()\n *    - Defined in ReentrancyErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant NoReentrantCalls_error_selector = 0x7fa8a987;\nuint256 constant NoReentrantCalls_error_length = 0x04;\n\n/*\n *  error OrderAlreadyFilled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderAlreadyFilled_error_selector = 0x10fda3e1;\nuint256 constant OrderAlreadyFilled_error_orderHash_ptr = 0x20;\nuint256 constant OrderAlreadyFilled_error_length = 0x24;\n\n/*\n *  error InvalidTime(uint256 startTime, uint256 endTime)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: startTime\n *    - 0x40: endTime\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant InvalidTime_error_selector = 0x21ccfeb7;\nuint256 constant InvalidTime_error_startTime_ptr = 0x20;\nuint256 constant InvalidTime_error_endTime_ptr = 0x40;\nuint256 constant InvalidTime_error_length = 0x44;\n\n/*\n *  error InvalidConduit(bytes32 conduitKey, address conduit)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: conduitKey\n *    - 0x40: conduit\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant InvalidConduit_error_selector = 0x1cf99b26;\nuint256 constant InvalidConduit_error_conduitKey_ptr = 0x20;\nuint256 constant InvalidConduit_error_conduit_ptr = 0x40;\nuint256 constant InvalidConduit_error_length = 0x44;\n\n/*\n *  error MissingOriginalConsiderationItems()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant MissingOriginalConsiderationItems_error_selector = 0x466aa616;\nuint256 constant MissingOriginalConsiderationItems_error_length = 0x04;\n\n/*\n *  error InvalidCallToConduit(address conduit)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: conduit\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidCallToConduit_error_selector = 0xd13d53d4;\nuint256 constant InvalidCallToConduit_error_conduit_ptr = 0x20;\nuint256 constant InvalidCallToConduit_error_length = 0x24;\n\n/*\n *  error ConsiderationNotMet(\n *      uint256 orderIndex,\n *      uint256 considerationIndex,\n *      uint256 shortfallAmount\n *  )\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: considerationIndex\n *    - 0x60: shortfallAmount\n * Revert buffer is memory[0x1c:0x80]\n */\nuint256 constant ConsiderationNotMet_error_selector = 0xa5f54208;\nuint256 constant ConsiderationNotMet_error_orderIndex_ptr = 0x20;\nuint256 constant ConsiderationNotMet_error_considerationIndex_ptr = 0x40;\nuint256 constant ConsiderationNotMet_error_shortfallAmount_ptr = 0x60;\nuint256 constant ConsiderationNotMet_error_length = 0x64;\n\n/*\n *  error InsufficientNativeTokensSupplied()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InsufficientNativeTokensSupplied_error_selector = 0x8ffff980;\nuint256 constant InsufficientNativeTokensSupplied_error_length = 0x04;\n\n/*\n *  error NativeTokenTransferGenericFailure(address account, uint256 amount)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: account\n *    - 0x40: amount\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant NativeTokenTransferGenericFailure_error_selector = 0xbc806b96;\nuint256 constant NativeTokenTransferGenericFailure_error_account_ptr = 0x20;\nuint256 constant NativeTokenTransferGenericFailure_error_amount_ptr = 0x40;\nuint256 constant NativeTokenTransferGenericFailure_error_length = 0x44;\n\n/*\n *  error PartialFillsNotEnabledForOrder()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant PartialFillsNotEnabledForOrder_error_selector = 0xa11b63ff;\nuint256 constant PartialFillsNotEnabledForOrder_error_length = 0x04;\n\n/*\n *  error OrderIsCancelled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderIsCancelled_error_selector = 0x1a515574;\nuint256 constant OrderIsCancelled_error_orderHash_ptr = 0x20;\nuint256 constant OrderIsCancelled_error_length = 0x24;\n\n/*\n *  error OrderPartiallyFilled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderPartiallyFilled_error_selector = 0xee9e0e63;\nuint256 constant OrderPartiallyFilled_error_orderHash_ptr = 0x20;\nuint256 constant OrderPartiallyFilled_error_length = 0x24;\n\n/*\n *  error CannotCancelOrder()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant CannotCancelOrder_error_selector = 0xfed398fc;\nuint256 constant CannotCancelOrder_error_length = 0x04;\n\n/*\n *  error BadFraction()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant BadFraction_error_selector = 0x5a052b32;\nuint256 constant BadFraction_error_length = 0x04;\n\n/*\n *  error InvalidMsgValue(uint256 value)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: value\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidMsgValue_error_selector = 0xa61be9f0;\nuint256 constant InvalidMsgValue_error_value_ptr = 0x20;\nuint256 constant InvalidMsgValue_error_length = 0x24;\n\n/*\n *  error InvalidBasicOrderParameterEncoding()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidBasicOrderParameterEncoding_error_selector = 0x39f3e3fd;\nuint256 constant InvalidBasicOrderParameterEncoding_error_length = 0x04;\n\n/*\n *  error NoSpecifiedOrdersAvailable()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant NoSpecifiedOrdersAvailable_error_selector = 0xd5da9a1b;\nuint256 constant NoSpecifiedOrdersAvailable_error_length = 0x04;\n\n/*\n *  error InvalidNativeOfferItem()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidNativeOfferItem_error_selector = 0x12d3f5a3;\nuint256 constant InvalidNativeOfferItem_error_length = 0x04;\n\n/*\n *  error ConsiderationLengthNotEqualToTotalOriginal()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant ConsiderationLengthNotEqualToTotalOriginal_error_selector = (\n    0x2165628a\n);\nuint256 constant ConsiderationLengthNotEqualToTotalOriginal_error_length = 0x04;\n\n/*\n *  error Panic(uint256 code)\n *    - Built-in Solidity error\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: code\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant Panic_error_selector = 0x4e487b71;\nuint256 constant Panic_error_code_ptr = 0x20;\nuint256 constant Panic_error_length = 0x24;\n\nuint256 constant Panic_arithmetic = 0x11;\n// uint256 constant Panic_resource = 0x41;\n"},"lib/seaport-types/src/interfaces/ZoneInteractionErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ZoneInteractionErrors\n * @author 0age\n * @notice ZoneInteractionErrors contains errors related to zone interaction.\n */\ninterface ZoneInteractionErrors {\n    /**\n     * @dev Revert with an error when attempting to fill an order that specifies\n     *      a restricted submitter as its order type when not submitted by\n     *      either the offerer or the order's zone or approved as valid by the\n     *      zone in question via a call to `isValidOrder`.\n     *\n     * @param orderHash The order hash for the invalid restricted order.\n     */\n    error InvalidRestrictedOrder(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill a contract order that\n     *      fails to generate an order successfully, that does not adhere to the\n     *      requirements for minimum spent or maximum received supplied by the\n     *      fulfiller, or that fails the post-execution `ratifyOrder` check..\n     *\n     * @param orderHash The order hash for the invalid contract order.\n     */\n    error InvalidContractOrder(bytes32 orderHash);\n}\n"},"lib/seaport-types/src/interfaces/AmountDerivationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title AmountDerivationErrors\n * @author 0age\n * @notice AmountDerivationErrors contains errors related to amount derivation.\n */\ninterface AmountDerivationErrors {\n    /**\n     * @dev Revert with an error when attempting to apply a fraction as part of\n     *      a partial fill that does not divide the target amount cleanly.\n     */\n    error InexactFraction();\n}\n"},"lib/seaport-types/src/interfaces/ConsiderationInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    AdvancedOrder,\n    BasicOrderParameters,\n    CriteriaResolver,\n    Execution,\n    Fulfillment,\n    FulfillmentComponent,\n    Order,\n    OrderComponents\n} from \"../lib/ConsiderationStructs.sol\";\n\n/**\n * @title ConsiderationInterface\n * @author 0age\n * @custom:version 1.6\n * @notice Consideration is a generalized native token/ERC20/ERC721/ERC1155\n *         marketplace. It minimizes external calls to the greatest extent\n *         possible and provides lightweight methods for common routes as well\n *         as more flexible methods for composing advanced orders.\n *\n * @dev ConsiderationInterface contains all external function interfaces for\n *      Consideration.\n */\ninterface ConsiderationInterface {\n    /**\n     * @notice Fulfill an order offering an ERC721 token by supplying Ether (or\n     *         the native token for the given chain) as consideration for the\n     *         order. An arbitrary number of \"additional recipients\" may also be\n     *         supplied which will each receive native tokens from the fulfiller\n     *         as consideration.\n     *\n     * @param parameters Additional information on the fulfilled order. Note\n     *                   that the offerer must first approve this contract (or\n     *                   their preferred conduit if indicated by the order) for\n     *                   their offered ERC721 token to be transferred.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder(\n        BasicOrderParameters calldata parameters\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Fulfill an order with an arbitrary number of items for offer and\n     *         consideration. Note that this function does not support\n     *         criteria-based orders or partial filling of orders (though\n     *         filling the remainder of a partially-filled order is supported).\n     *\n     * @param order               The order to fulfill. Note that both the\n     *                            offerer and the fulfiller must first approve\n     *                            this contract (or the corresponding conduit if\n     *                            indicated) to transfer any relevant tokens on\n     *                            their behalf and that contracts must implement\n     *                            `onERC1155Received` to receive ERC1155 tokens\n     *                            as consideration.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillOrder(\n        Order calldata order,\n        bytes32 fulfillerConduitKey\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Fill an order, fully or partially, with an arbitrary number of\n     *         items for offer and consideration alongside criteria resolvers\n     *         containing specific token identifiers and associated proofs.\n     *\n     * @param advancedOrder       The order to fulfill along with the fraction\n     *                            of the order to attempt to fill. Note that\n     *                            both the offerer and the fulfiller must first\n     *                            approve this contract (or their preferred\n     *                            conduit if indicated by the order) to transfer\n     *                            any relevant tokens on their behalf and that\n     *                            contracts must implement `onERC1155Received`\n     *                            to receive ERC1155 tokens as consideration.\n     *                            Also note that all offer and consideration\n     *                            components must have no remainder after\n     *                            multiplication of the respective amount with\n     *                            the supplied fraction for the partial fill to\n     *                            be considered valid.\n     * @param criteriaResolvers   An array where each element contains a\n     *                            reference to a specific offer or\n     *                            consideration, a token identifier, and a proof\n     *                            that the supplied token identifier is\n     *                            contained in the merkle root held by the item\n     *                            in question's criteria element. Note that an\n     *                            empty criteria indicates that any\n     *                            (transferable) token identifier on the token\n     *                            in question is valid and that no associated\n     *                            proof needs to be supplied.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     * @param recipient           The intended recipient for all received items,\n     *                            with `address(0)` indicating that the caller\n     *                            should receive the items.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillAdvancedOrder(\n        AdvancedOrder calldata advancedOrder,\n        CriteriaResolver[] calldata criteriaResolvers,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Attempt to fill a group of orders, each with an arbitrary number\n     *         of items for offer and consideration. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *         Note that this function does not support criteria-based orders or\n     *         partial filling of orders (though filling the remainder of a\n     *         partially-filled order is supported).\n     *\n     * @param orders                    The orders to fulfill. Note that both\n     *                                  the offerer and the fulfiller must first\n     *                                  approve this contract (or the\n     *                                  corresponding conduit if indicated) to\n     *                                  transfer any relevant tokens on their\n     *                                  behalf and that contracts must implement\n     *                                  `onERC1155Received` to receive ERC1155\n     *                                  tokens as consideration.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used, with\n     *                                  direct approvals set on this contract.\n     * @param maximumFulfilled          The maximum number of orders to fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders. Note that unspent offer item amounts or\n     *                         native tokens will not be reflected as part of\n     *                         this array.\n     */\n    function fulfillAvailableOrders(\n        Order[] calldata orders,\n        FulfillmentComponent[][] calldata offerFulfillments,\n        FulfillmentComponent[][] calldata considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        returns (bool[] memory availableOrders, Execution[] memory executions);\n\n    /**\n     * @notice Attempt to fill a group of orders, fully or partially, with an\n     *         arbitrary number of items for offer and consideration per order\n     *         alongside criteria resolvers containing specific token\n     *         identifiers and associated proofs. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *\n     * @param advancedOrders            The orders to fulfill along with the\n     *                                  fraction of those orders to attempt to\n     *                                  fill. Note that both the offerer and the\n     *                                  fulfiller must first approve this\n     *                                  contract (or their preferred conduit if\n     *                                  indicated by the order) to transfer any\n     *                                  relevant tokens on their behalf and that\n     *                                  contracts must implement\n     *                                  `onERC1155Received` to enable receipt of\n     *                                  ERC1155 tokens as consideration. Also\n     *                                  note that all offer and consideration\n     *                                  components must have no remainder after\n     *                                  multiplication of the respective amount\n     *                                  with the supplied fraction for an\n     *                                  order's partial fill amount to be\n     *                                  considered valid.\n     * @param criteriaResolvers         An array where each element contains a\n     *                                  reference to a specific offer or\n     *                                  consideration, a token identifier, and a\n     *                                  proof that the supplied token identifier\n     *                                  is contained in the merkle root held by\n     *                                  the item in question's criteria element.\n     *                                  Note that an empty criteria indicates\n     *                                  that any (transferable) token\n     *                                  identifier on the token in question is\n     *                                  valid and that no associated proof needs\n     *                                  to be supplied.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used, with\n     *                                  direct approvals set on this contract.\n     * @param recipient                 The intended recipient for all received\n     *                                  items, with `address(0)` indicating that\n     *                                  the caller should receive the items.\n     * @param maximumFulfilled          The maximum number of orders to fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders. Note that unspent offer item amounts or\n     *                         native tokens will not be reflected as part of\n     *                         this array.\n     */\n    function fulfillAvailableAdvancedOrders(\n        AdvancedOrder[] calldata advancedOrders,\n        CriteriaResolver[] calldata criteriaResolvers,\n        FulfillmentComponent[][] calldata offerFulfillments,\n        FulfillmentComponent[][] calldata considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        address recipient,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        returns (bool[] memory availableOrders, Execution[] memory executions);\n\n    /**\n     * @notice Match an arbitrary number of orders, each with an arbitrary\n     *         number of items for offer and consideration along with a set of\n     *         fulfillments allocating offer components to consideration\n     *         components. Note that this function does not support\n     *         criteria-based or partial filling of orders (though filling the\n     *         remainder of a partially-filled order is supported). Any unspent\n     *         offer item amounts or native tokens will be transferred to the\n     *         caller.\n     *\n     * @param orders       The orders to match. Note that both the offerer and\n     *                     fulfiller on each order must first approve this\n     *                     contract (or their conduit if indicated by the order)\n     *                     to transfer any relevant tokens on their behalf and\n     *                     each consideration recipient must implement\n     *                     `onERC1155Received` to enable ERC1155 token receipt.\n     * @param fulfillments An array of elements allocating offer components to\n     *                     consideration components. Note that each\n     *                     consideration component must be fully met for the\n     *                     match operation to be valid.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders. Note that unspent offer item amounts or\n     *                    native tokens will not be reflected as part of this\n     *                    array.\n     */\n    function matchOrders(\n        Order[] calldata orders,\n        Fulfillment[] calldata fulfillments\n    ) external payable returns (Execution[] memory executions);\n\n    /**\n     * @notice Match an arbitrary number of full or partial orders, each with an\n     *         arbitrary number of items for offer and consideration, supplying\n     *         criteria resolvers containing specific token identifiers and\n     *         associated proofs as well as fulfillments allocating offer\n     *         components to consideration components. Any unspent offer item\n     *         amounts will be transferred to the designated recipient (with the\n     *         null address signifying to use the caller) and any unspent native\n     *         tokens will be returned to the caller.\n     *\n     * @param orders            The advanced orders to match. Note that both the\n     *                          offerer and fulfiller on each order must first\n     *                          approve this contract (or a preferred conduit if\n     *                          indicated by the order) to transfer any relevant\n     *                          tokens on their behalf and each consideration\n     *                          recipient must implement `onERC1155Received` in\n     *                          order to receive ERC1155 tokens. Also note that\n     *                          the offer and consideration components for each\n     *                          order must have no remainder after multiplying\n     *                          the respective amount with the supplied fraction\n     *                          in order for the group of partial fills to be\n     *                          considered valid.\n     * @param criteriaResolvers An array where each element contains a reference\n     *                          to a specific order as well as that order's\n     *                          offer or consideration, a token identifier, and\n     *                          a proof that the supplied token identifier is\n     *                          contained in the order's merkle root. Note that\n     *                          an empty root indicates that any (transferable)\n     *                          token identifier is valid and that no associated\n     *                          proof needs to be supplied.\n     * @param fulfillments      An array of elements allocating offer components\n     *                          to consideration components. Note that each\n     *                          consideration component must be fully met in\n     *                          order for the match operation to be valid.\n     * @param recipient         The intended recipient for all unspent offer\n     *                          item amounts, or the caller if the null address\n     *                          is supplied.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders. Note that unspent offer item amounts or native\n     *                    tokens will not be reflected as part of this array.\n     */\n    function matchAdvancedOrders(\n        AdvancedOrder[] calldata orders,\n        CriteriaResolver[] calldata criteriaResolvers,\n        Fulfillment[] calldata fulfillments,\n        address recipient\n    ) external payable returns (Execution[] memory executions);\n\n    /**\n     * @notice Cancel an arbitrary number of orders. Note that only the offerer\n     *         or the zone of a given order may cancel it. Callers should ensure\n     *         that the intended order was cancelled by calling `getOrderStatus`\n     *         and confirming that `isCancelled` returns `true`.\n     *\n     * @param orders The orders to cancel.\n     *\n     * @return cancelled A boolean indicating whether the supplied orders have\n     *                   been successfully cancelled.\n     */\n    function cancel(\n        OrderComponents[] calldata orders\n    ) external returns (bool cancelled);\n\n    /**\n     * @notice Validate an arbitrary number of orders, thereby registering their\n     *         signatures as valid and allowing the fulfiller to skip signature\n     *         verification on fulfillment. Note that validated orders may still\n     *         be unfulfillable due to invalid item amounts or other factors;\n     *         callers should determine whether validated orders are fulfillable\n     *         by simulating the fulfillment call prior to execution. Also note\n     *         that anyone can validate a signed order, but only the offerer can\n     *         validate an order without supplying a signature.\n     *\n     * @param orders The orders to validate.\n     *\n     * @return validated A boolean indicating whether the supplied orders have\n     *                   been successfully validated.\n     */\n    function validate(\n        Order[] calldata orders\n    ) external returns (bool validated);\n\n    /**\n     * @notice Cancel all orders from a given offerer with a given zone in bulk\n     *         by incrementing a counter. Note that only the offerer may\n     *         increment the counter.\n     *\n     * @return newCounter The new counter.\n     */\n    function incrementCounter() external returns (uint256 newCounter);\n\n    /**\n     * @notice Fulfill an order offering an ERC721 token by supplying Ether (or\n     *         the native token for the given chain) as consideration for the\n     *         order. An arbitrary number of \"additional recipients\" may also be\n     *         supplied which will each receive native tokens from the fulfiller\n     *         as consideration. Note that this function costs less gas than\n     *         `fulfillBasicOrder` due to the zero bytes in the function\n     *         selector (0x00000000) which also results in earlier function\n     *         dispatch.\n     *\n     * @param parameters Additional information on the fulfilled order. Note\n     *                   that the offerer must first approve this contract (or\n     *                   their preferred conduit if indicated by the order) for\n     *                   their offered ERC721 token to be transferred.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder_efficient_6GL6yc(\n        BasicOrderParameters calldata parameters\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Retrieve the order hash for a given order.\n     *\n     * @param order The components of the order.\n     *\n     * @return orderHash The order hash.\n     */\n    function getOrderHash(\n        OrderComponents calldata order\n    ) external view returns (bytes32 orderHash);\n\n    /**\n     * @notice Retrieve the status of a given order by hash, including whether\n     *         the order has been cancelled or validated and the fraction of the\n     *         order that has been filled.\n     *\n     * @param orderHash The order hash in question.\n     *\n     * @return isValidated A boolean indicating whether the order in question\n     *                     has been validated (i.e. previously approved or\n     *                     partially filled).\n     * @return isCancelled A boolean indicating whether the order in question\n     *                     has been cancelled.\n     * @return totalFilled The total portion of the order that has been filled\n     *                     (i.e. the \"numerator\").\n     * @return totalSize   The total size of the order that is either filled or\n     *                     unfilled (i.e. the \"denominator\").\n     */\n    function getOrderStatus(\n        bytes32 orderHash\n    )\n        external\n        view\n        returns (\n            bool isValidated,\n            bool isCancelled,\n            uint256 totalFilled,\n            uint256 totalSize\n        );\n\n    /**\n     * @notice Retrieve the current counter for a given offerer.\n     *\n     * @param offerer The offerer in question.\n     *\n     * @return counter The current counter.\n     */\n    function getCounter(\n        address offerer\n    ) external view returns (uint256 counter);\n\n    /**\n     * @notice Retrieve configuration information for this contract.\n     *\n     * @return version           The contract version.\n     * @return domainSeparator   The domain separator for this contract.\n     * @return conduitController The conduit Controller set for this contract.\n     */\n    function information()\n        external\n        view\n        returns (\n            string memory version,\n            bytes32 domainSeparator,\n            address conduitController\n        );\n\n    function getContractOffererNonce(\n        address contractOfferer\n    ) external view returns (uint256 nonce);\n\n    /**\n     * @notice Retrieve the name of this contract.\n     *\n     * @return contractName The name of this contract.\n     */\n    function name() external view returns (string memory contractName);\n}\n"},"lib/seaport-types/src/interfaces/TokenTransferrerErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title TokenTransferrerErrors\n */\ninterface TokenTransferrerErrors {\n    /**\n     * @dev Revert with an error when an ERC721 transfer with amount other than\n     *      one is attempted.\n     *\n     * @param amount The amount of the ERC721 tokens to transfer.\n     */\n    error InvalidERC721TransferAmount(uint256 amount);\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order where an\n     *      item has an amount of zero.\n     */\n    error MissingItemAmount();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order where an\n     *      item has unused parameters. This includes both the token and the\n     *      identifier parameters for native transfers as well as the identifier\n     *      parameter for ERC20 transfers. Note that the conduit does not\n     *      perform this check, leaving it up to the calling channel to enforce\n     *      when desired.\n     */\n    error UnusedItemParameters();\n\n    /**\n     * @dev Revert with an error when an ERC20, ERC721, or ERC1155 token\n     *      transfer reverts.\n     *\n     * @param token      The token for which the transfer was attempted.\n     * @param from       The source of the attempted transfer.\n     * @param to         The recipient of the attempted transfer.\n     * @param identifier The identifier for the attempted transfer.\n     * @param amount     The amount for the attempted transfer.\n     */\n    error TokenTransferGenericFailure(\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount\n    );\n\n    /**\n     * @dev Revert with an error when a batch ERC1155 token transfer reverts.\n     *\n     * @param token       The token for which the transfer was attempted.\n     * @param from        The source of the attempted transfer.\n     * @param to          The recipient of the attempted transfer.\n     * @param identifiers The identifiers for the attempted transfer.\n     * @param amounts     The amounts for the attempted transfer.\n     */\n    error ERC1155BatchTransferGenericFailure(\n        address token,\n        address from,\n        address to,\n        uint256[] identifiers,\n        uint256[] amounts\n    );\n\n    /**\n     * @dev Revert with an error when an ERC20 token transfer returns a falsey\n     *      value.\n     *\n     * @param token      The token for which the ERC20 transfer was attempted.\n     * @param from       The source of the attempted ERC20 transfer.\n     * @param to         The recipient of the attempted ERC20 transfer.\n     * @param amount     The amount for the attempted ERC20 transfer.\n     */\n    error BadReturnValueFromERC20OnTransfer(\n        address token,\n        address from,\n        address to,\n        uint256 amount\n    );\n\n    /**\n     * @dev Revert with an error when an account being called as an assumed\n     *      contract does not have code and returns no data.\n     *\n     * @param account The account that should contain code.\n     */\n    error NoContract(address account);\n\n    /**\n     * @dev Revert with an error when attempting to execute an 1155 batch\n     *      transfer using calldata not produced by default ABI encoding or with\n     *      different lengths for ids and amounts arrays.\n     */\n    error Invalid1155BatchTransferEncoding();\n}\n"},"lib/seaport-types/src/interfaces/CriteriaResolutionErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { Side } from \"../lib/ConsiderationEnums.sol\";\n\n/**\n * @title CriteriaResolutionErrors\n * @author 0age\n * @notice CriteriaResolutionErrors contains all errors related to criteria\n *         resolution.\n */\ninterface CriteriaResolutionErrors {\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order that has not been supplied.\n     *\n     * @param side The side of the order that was not supplied.\n     */\n    error OrderCriteriaResolverOutOfRange(Side side);\n\n    /**\n     * @dev Revert with an error if an offer item still has unresolved criteria\n     *      after applying all criteria resolvers.\n     *\n     * @param orderIndex The index of the order that contains the offer item.\n     * @param offerIndex The index of the offer item that still has unresolved\n     *                   criteria.\n     */\n    error UnresolvedOfferCriteria(uint256 orderIndex, uint256 offerIndex);\n\n    /**\n     * @dev Revert with an error if a consideration item still has unresolved\n     *      criteria after applying all criteria resolvers.\n     *\n     * @param orderIndex         The index of the order that contains the\n     *                           consideration item.\n     * @param considerationIndex The index of the consideration item that still\n     *                           has unresolved criteria.\n     */\n    error UnresolvedConsiderationCriteria(\n        uint256 orderIndex,\n        uint256 considerationIndex\n    );\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with an offer item that has not been supplied.\n     */\n    error OfferCriteriaResolverOutOfRange();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with a consideration item that has not been supplied.\n     */\n    error ConsiderationCriteriaResolverOutOfRange();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with an item that does not expect a criteria to be\n     *      resolved.\n     */\n    error CriteriaNotEnabledForItem();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that\n     *      contains an invalid proof with respect to the given item and\n     *      chosen identifier.\n     */\n    error InvalidProof();\n}\n"},"lib/seaport-types/src/interfaces/ConduitControllerInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ConduitControllerInterface\n * @author 0age\n * @notice ConduitControllerInterface contains all external function interfaces,\n *         structs, events, and errors for the conduit controller.\n */\ninterface ConduitControllerInterface {\n    /**\n     * @dev Track the conduit key, current owner, new potential owner, and open\n     *      channels for each deployed conduit.\n     */\n    struct ConduitProperties {\n        bytes32 key;\n        address owner;\n        address potentialOwner;\n        address[] channels;\n        mapping(address => uint256) channelIndexesPlusOne;\n    }\n\n    /**\n     * @dev Emit an event whenever a new conduit is created.\n     *\n     * @param conduit    The newly created conduit.\n     * @param conduitKey The conduit key used to create the new conduit.\n     */\n    event NewConduit(address conduit, bytes32 conduitKey);\n\n    /**\n     * @dev Emit an event whenever conduit ownership is transferred.\n     *\n     * @param conduit       The conduit for which ownership has been\n     *                      transferred.\n     * @param previousOwner The previous owner of the conduit.\n     * @param newOwner      The new owner of the conduit.\n     */\n    event OwnershipTransferred(\n        address indexed conduit,\n        address indexed previousOwner,\n        address indexed newOwner\n    );\n\n    /**\n     * @dev Emit an event whenever a conduit owner registers a new potential\n     *      owner for that conduit.\n     *\n     * @param newPotentialOwner The new potential owner of the conduit.\n     */\n    event PotentialOwnerUpdated(address indexed newPotentialOwner);\n\n    /**\n     * @dev Revert with an error when attempting to create a new conduit using a\n     *      conduit key where the first twenty bytes of the key do not match the\n     *      address of the caller.\n     */\n    error InvalidCreator();\n\n    /**\n     * @dev Revert with an error when attempting to create a new conduit when no\n     *      initial owner address is supplied.\n     */\n    error InvalidInitialOwner();\n\n    /**\n     * @dev Revert with an error when attempting to set a new potential owner\n     *      that is already set.\n     */\n    error NewPotentialOwnerAlreadySet(\n        address conduit,\n        address newPotentialOwner\n    );\n\n    /**\n     * @dev Revert with an error when attempting to cancel ownership transfer\n     *      when no new potential owner is currently set.\n     */\n    error NoPotentialOwnerCurrentlySet(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to interact with a conduit that\n     *      does not yet exist.\n     */\n    error NoConduit();\n\n    /**\n     * @dev Revert with an error when attempting to create a conduit that\n     *      already exists.\n     */\n    error ConduitAlreadyExists(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to update channels or transfer\n     *      ownership of a conduit when the caller is not the owner of the\n     *      conduit in question.\n     */\n    error CallerIsNotOwner(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to register a new potential\n     *      owner and supplying the null address.\n     */\n    error NewPotentialOwnerIsZeroAddress(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to claim ownership of a conduit\n     *      with a caller that is not the current potential owner for the\n     *      conduit in question.\n     */\n    error CallerIsNotNewPotentialOwner(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to retrieve a channel using an\n     *      index that is out of range.\n     */\n    error ChannelOutOfRange(address conduit);\n\n    /**\n     * @notice Deploy a new conduit using a supplied conduit key and assigning\n     *         an initial owner for the deployed conduit. Note that the first\n     *         twenty bytes of the supplied conduit key must match the caller\n     *         and that a new conduit cannot be created if one has already been\n     *         deployed using the same conduit key.\n     *\n     * @param conduitKey   The conduit key used to deploy the conduit. Note that\n     *                     the first twenty bytes of the conduit key must match\n     *                     the caller of this contract.\n     * @param initialOwner The initial owner to set for the new conduit.\n     *\n     * @return conduit The address of the newly deployed conduit.\n     */\n    function createConduit(\n        bytes32 conduitKey,\n        address initialOwner\n    ) external returns (address conduit);\n\n    /**\n     * @notice Open or close a channel on a given conduit, thereby allowing the\n     *         specified account to execute transfers against that conduit.\n     *         Extreme care must be taken when updating channels, as malicious\n     *         or vulnerable channels can transfer any ERC20, ERC721 and ERC1155\n     *         tokens where the token holder has granted the conduit approval.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to open or close the channel.\n     * @param channel The channel to open or close on the conduit.\n     * @param isOpen  A boolean indicating whether to open or close the channel.\n     */\n    function updateChannel(\n        address conduit,\n        address channel,\n        bool isOpen\n    ) external;\n\n    /**\n     * @notice Initiate conduit ownership transfer by assigning a new potential\n     *         owner for the given conduit. Once set, the new potential owner\n     *         may call `acceptOwnership` to claim ownership of the conduit.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to initiate ownership transfer.\n     * @param newPotentialOwner The new potential owner of the conduit.\n     */\n    function transferOwnership(\n        address conduit,\n        address newPotentialOwner\n    ) external;\n\n    /**\n     * @notice Clear the currently set potential owner, if any, from a conduit.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to cancel ownership transfer.\n     */\n    function cancelOwnershipTransfer(address conduit) external;\n\n    /**\n     * @notice Accept ownership of a supplied conduit. Only accounts that the\n     *         current owner has set as the new potential owner may call this\n     *         function.\n     *\n     * @param conduit The conduit for which to accept ownership.\n     */\n    function acceptOwnership(address conduit) external;\n\n    /**\n     * @notice Retrieve the current owner of a deployed conduit.\n     *\n     * @param conduit The conduit for which to retrieve the associated owner.\n     *\n     * @return owner The owner of the supplied conduit.\n     */\n    function ownerOf(address conduit) external view returns (address owner);\n\n    /**\n     * @notice Retrieve the conduit key for a deployed conduit via reverse\n     *         lookup.\n     *\n     * @param conduit The conduit for which to retrieve the associated conduit\n     *                key.\n     *\n     * @return conduitKey The conduit key used to deploy the supplied conduit.\n     */\n    function getKey(address conduit) external view returns (bytes32 conduitKey);\n\n    /**\n     * @notice Derive the conduit associated with a given conduit key and\n     *         determine whether that conduit exists (i.e. whether it has been\n     *         deployed).\n     *\n     * @param conduitKey The conduit key used to derive the conduit.\n     *\n     * @return conduit The derived address of the conduit.\n     * @return exists  A boolean indicating whether the derived conduit has been\n     *                 deployed or not.\n     */\n    function getConduit(\n        bytes32 conduitKey\n    ) external view returns (address conduit, bool exists);\n\n    /**\n     * @notice Retrieve the potential owner, if any, for a given conduit. The\n     *         current owner may set a new potential owner via\n     *         `transferOwnership` and that owner may then accept ownership of\n     *         the conduit in question via `acceptOwnership`.\n     *\n     * @param conduit The conduit for which to retrieve the potential owner.\n     *\n     * @return potentialOwner The potential owner, if any, for the conduit.\n     */\n    function getPotentialOwner(\n        address conduit\n    ) external view returns (address potentialOwner);\n\n    /**\n     * @notice Retrieve the status (either open or closed) of a given channel on\n     *         a conduit.\n     *\n     * @param conduit The conduit for which to retrieve the channel status.\n     * @param channel The channel for which to retrieve the status.\n     *\n     * @return isOpen The status of the channel on the given conduit.\n     */\n    function getChannelStatus(\n        address conduit,\n        address channel\n    ) external view returns (bool isOpen);\n\n    /**\n     * @notice Retrieve the total number of open channels for a given conduit.\n     *\n     * @param conduit The conduit for which to retrieve the total channel count.\n     *\n     * @return totalChannels The total number of open channels for the conduit.\n     */\n    function getTotalChannels(\n        address conduit\n    ) external view returns (uint256 totalChannels);\n\n    /**\n     * @notice Retrieve an open channel at a specific index for a given conduit.\n     *         Note that the index of a channel can change as a result of other\n     *         channels being closed on the conduit.\n     *\n     * @param conduit      The conduit for which to retrieve the open channel.\n     * @param channelIndex The index of the channel in question.\n     *\n     * @return channel The open channel, if any, at the specified channel index.\n     */\n    function getChannel(\n        address conduit,\n        uint256 channelIndex\n    ) external view returns (address channel);\n\n    /**\n     * @notice Retrieve all open channels for a given conduit. Note that calling\n     *         this function for a conduit with many channels will revert with\n     *         an out-of-gas error.\n     *\n     * @param conduit The conduit for which to retrieve open channels.\n     *\n     * @return channels An array of open channels on the given conduit.\n     */\n    function getChannels(\n        address conduit\n    ) external view returns (address[] memory channels);\n\n    /**\n     * @dev Retrieve the conduit creation code and runtime code hashes.\n     */\n    function getConduitCodeHashes()\n        external\n        view\n        returns (bytes32 creationCodeHash, bytes32 runtimeCodeHash);\n}\n"},"lib/seaport-types/src/interfaces/SignatureVerificationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title SignatureVerificationErrors\n * @author 0age\n * @notice SignatureVerificationErrors contains all errors related to signature\n *         verification.\n */\ninterface SignatureVerificationErrors {\n    /**\n     * @dev Revert with an error when a signature that does not contain a v\n     *      value of 27 or 28 has been supplied.\n     *\n     * @param v The invalid v value.\n     */\n    error BadSignatureV(uint8 v);\n\n    /**\n     * @dev Revert with an error when the signer recovered by the supplied\n     *      signature does not match the offerer or an allowed EIP-1271 signer\n     *      as specified by the offerer in the event they are a contract.\n     */\n    error InvalidSigner();\n\n    /**\n     * @dev Revert with an error when a signer cannot be recovered from the\n     *      supplied signature.\n     */\n    error InvalidSignature();\n\n    /**\n     * @dev Revert with an error when an EIP-1271 call to an account fails.\n     */\n    error BadContractSignature();\n}\n"},"lib/seaport-types/src/interfaces/ConsiderationEventsAndErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    OrderParameters,\n    ReceivedItem,\n    SpentItem\n} from \"../lib/ConsiderationStructs.sol\";\n\n/**\n * @title ConsiderationEventsAndErrors\n * @author 0age\n * @notice ConsiderationEventsAndErrors contains all events and errors.\n */\ninterface ConsiderationEventsAndErrors {\n    /**\n     * @dev Emit an event whenever an order is successfully fulfilled.\n     *\n     * @param orderHash     The hash of the fulfilled order.\n     * @param offerer       The offerer of the fulfilled order.\n     * @param zone          The zone of the fulfilled order.\n     * @param recipient     The recipient of each spent item on the fulfilled\n     *                      order, or the null address if there is no specific\n     *                      fulfiller (i.e. the order is part of a group of\n     *                      orders). Defaults to the caller unless explicitly\n     *                      specified otherwise by the fulfiller.\n     * @param offer         The offer items spent as part of the order.\n     * @param consideration The consideration items received as part of the\n     *                      order along with the recipients of each item.\n     */\n    event OrderFulfilled(\n        bytes32 orderHash,\n        address indexed offerer,\n        address indexed zone,\n        address recipient,\n        SpentItem[] offer,\n        ReceivedItem[] consideration\n    );\n\n    /**\n     * @dev Emit an event whenever an order is successfully cancelled.\n     *\n     * @param orderHash The hash of the cancelled order.\n     * @param offerer   The offerer of the cancelled order.\n     * @param zone      The zone of the cancelled order.\n     */\n    event OrderCancelled(\n        bytes32 orderHash,\n        address indexed offerer,\n        address indexed zone\n    );\n\n    /**\n     * @dev Emit an event whenever an order is explicitly validated. Note that\n     *      this event will not be emitted on partial fills even though they do\n     *      validate the order as part of partial fulfillment.\n     *\n     * @param orderHash        The hash of the validated order.\n     * @param orderParameters  The parameters of the validated order.\n     */\n    event OrderValidated(bytes32 orderHash, OrderParameters orderParameters);\n\n    /**\n     * @dev Emit an event whenever one or more orders are matched using either\n     *      matchOrders or matchAdvancedOrders.\n     *\n     * @param orderHashes The order hashes of the matched orders.\n     */\n    event OrdersMatched(bytes32[] orderHashes);\n\n    /**\n     * @dev Emit an event whenever a counter for a given offerer is incremented.\n     *\n     * @param newCounter The new counter for the offerer.\n     * @param offerer    The offerer in question.\n     */\n    event CounterIncremented(uint256 newCounter, address indexed offerer);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order that has\n     *      already been fully filled.\n     *\n     * @param orderHash The order hash on which a fill was attempted.\n     */\n    error OrderAlreadyFilled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order outside the\n     *      specified start time and end time.\n     *\n     * @param startTime The time at which the order becomes active.\n     * @param endTime   The time at which the order becomes inactive.\n     */\n    error InvalidTime(uint256 startTime, uint256 endTime);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order referencing an\n     *      invalid conduit (i.e. one that has not been deployed).\n     */\n    error InvalidConduit(bytes32 conduitKey, address conduit);\n\n    /**\n     * @dev Revert with an error when an order is supplied for fulfillment with\n     *      a consideration array that is shorter than the original array.\n     */\n    error MissingOriginalConsiderationItems();\n\n    /**\n     * @dev Revert with an error when an order is validated and the length of\n     *      the consideration array is not equal to the supplied total original\n     *      consideration items value. This error is also thrown when contract\n     *      orders supply a total original consideration items value that does\n     *      not match the supplied consideration array length.\n     */\n    error ConsiderationLengthNotEqualToTotalOriginal();\n\n    /**\n     * @dev Revert with an error when a call to a conduit fails with revert data\n     *      that is too expensive to return.\n     */\n    error InvalidCallToConduit(address conduit);\n\n    /**\n     * @dev Revert with an error if a consideration amount has not been fully\n     *      zeroed out after applying all fulfillments.\n     *\n     * @param orderIndex         The index of the order with the consideration\n     *                           item with a shortfall.\n     * @param considerationIndex The index of the consideration item on the\n     *                           order.\n     * @param shortfallAmount    The unfulfilled consideration amount.\n     */\n    error ConsiderationNotMet(\n        uint256 orderIndex,\n        uint256 considerationIndex,\n        uint256 shortfallAmount\n    );\n\n    /**\n     * @dev Revert with an error when insufficient native tokens are supplied as\n     *      part of msg.value when fulfilling orders.\n     */\n    error InsufficientNativeTokensSupplied();\n\n    /**\n     * @dev Revert with an error when a native token transfer reverts.\n     */\n    error NativeTokenTransferGenericFailure(address account, uint256 amount);\n\n    /**\n     * @dev Revert with an error when a partial fill is attempted on an order\n     *      that does not specify partial fill support in its order type.\n     */\n    error PartialFillsNotEnabledForOrder();\n\n    /**\n     * @dev Revert with an error when attempting to fill an order that has been\n     *      cancelled.\n     *\n     * @param orderHash The hash of the cancelled order.\n     */\n    error OrderIsCancelled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill a basic order that has\n     *      been partially filled.\n     *\n     * @param orderHash The hash of the partially used order.\n     */\n    error OrderPartiallyFilled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to cancel an order as a caller\n     *      other than the indicated offerer or zone or when attempting to\n     *      cancel a contract order.\n     */\n    error CannotCancelOrder();\n\n    /**\n     * @dev Revert with an error when supplying a fraction with a value of zero\n     *      for the numerator or denominator, or one where the numerator exceeds\n     *      the denominator.\n     */\n    error BadFraction();\n\n    /**\n     * @dev Revert with an error when a caller attempts to supply callvalue to a\n     *      non-payable basic order route or does not supply any callvalue to a\n     *      payable basic order route.\n     */\n    error InvalidMsgValue(uint256 value);\n\n    /**\n     * @dev Revert with an error when attempting to fill a basic order using\n     *      calldata not produced by default ABI encoding.\n     */\n    error InvalidBasicOrderParameterEncoding();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill any number of\n     *      available orders when none are fulfillable.\n     */\n    error NoSpecifiedOrdersAvailable();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order with an\n     *      offer for a native token outside of matching orders.\n     */\n    error InvalidNativeOfferItem();\n}\n"},"lib/seaport-types/src/interfaces/FulfillmentApplicationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { Side } from \"../lib/ConsiderationEnums.sol\";\n\n/**\n * @title FulfillmentApplicationErrors\n * @author 0age\n * @notice FulfillmentApplicationErrors contains errors related to fulfillment\n *         application and aggregation.\n */\ninterface FulfillmentApplicationErrors {\n    /**\n     * @dev Revert with an error when a fulfillment is provided that does not\n     *      declare at least one component as part of a call to fulfill\n     *      available orders.\n     */\n    error MissingFulfillmentComponentOnAggregation(Side side);\n\n    /**\n     * @dev Revert with an error when a fulfillment is provided that does not\n     *      declare at least one offer component and at least one consideration\n     *      component.\n     */\n    error OfferAndConsiderationRequiredOnFulfillment();\n\n    /**\n     * @dev Revert with an error when the initial offer item named by a\n     *      fulfillment component does not match the type, token, identifier,\n     *      or conduit preference of the initial consideration item.\n     *\n     * @param fulfillmentIndex The index of the fulfillment component that\n     *                         does not match the initial offer item.\n     */\n    error MismatchedFulfillmentOfferAndConsiderationComponents(\n        uint256 fulfillmentIndex\n    );\n\n    /**\n     * @dev Revert with an error when an order or item index are out of range\n     *      or a fulfillment component does not match the type, token,\n     *      identifier, or conduit preference of the initial consideration item.\n     */\n    error InvalidFulfillmentComponentData();\n}\n"},"seaport-types/src/conduit/lib/ConduitEnums.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nenum ConduitItemType {\n    NATIVE, // unused\n    ERC20,\n    ERC721,\n    ERC1155\n}\n"},"seaport-types/src/conduit/lib/ConduitStructs.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { ConduitItemType } from \"./ConduitEnums.sol\";\n\n/**\n * @dev A ConduitTransfer is a struct that contains the information needed for a\n *      conduit to transfer an item from one address to another.\n */\nstruct ConduitTransfer {\n    ConduitItemType itemType;\n    address token;\n    address from;\n    address to;\n    uint256 identifier;\n    uint256 amount;\n}\n\n/**\n * @dev A ConduitBatch1155Transfer is a struct that contains the information\n *      needed for a conduit to transfer a batch of ERC-1155 tokens from one\n *      address to another.\n */\nstruct ConduitBatch1155Transfer {\n    address token;\n    address from;\n    address to;\n    uint256[] ids;\n    uint256[] amounts;\n}\n"},"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);\nMemoryPointer constant ZeroSlotPtr = MemoryPointer.wrap(0x60);\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 pptrOffset(\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 pptrOffset(\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 pptrOffset(\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"},"seaport-types/src/interfaces/AmountDerivationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title AmountDerivationErrors\n * @author 0age\n * @notice AmountDerivationErrors contains errors related to amount derivation.\n */\ninterface AmountDerivationErrors {\n    /**\n     * @dev Revert with an error when attempting to apply a fraction as part of\n     *      a partial fill that does not divide the target amount cleanly.\n     */\n    error InexactFraction();\n}\n"},"seaport-types/src/interfaces/ConduitControllerInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ConduitControllerInterface\n * @author 0age\n * @notice ConduitControllerInterface contains all external function interfaces,\n *         structs, events, and errors for the conduit controller.\n */\ninterface ConduitControllerInterface {\n    /**\n     * @dev Track the conduit key, current owner, new potential owner, and open\n     *      channels for each deployed conduit.\n     */\n    struct ConduitProperties {\n        bytes32 key;\n        address owner;\n        address potentialOwner;\n        address[] channels;\n        mapping(address => uint256) channelIndexesPlusOne;\n    }\n\n    /**\n     * @dev Emit an event whenever a new conduit is created.\n     *\n     * @param conduit    The newly created conduit.\n     * @param conduitKey The conduit key used to create the new conduit.\n     */\n    event NewConduit(address conduit, bytes32 conduitKey);\n\n    /**\n     * @dev Emit an event whenever conduit ownership is transferred.\n     *\n     * @param conduit       The conduit for which ownership has been\n     *                      transferred.\n     * @param previousOwner The previous owner of the conduit.\n     * @param newOwner      The new owner of the conduit.\n     */\n    event OwnershipTransferred(\n        address indexed conduit,\n        address indexed previousOwner,\n        address indexed newOwner\n    );\n\n    /**\n     * @dev Emit an event whenever a conduit owner registers a new potential\n     *      owner for that conduit.\n     *\n     * @param newPotentialOwner The new potential owner of the conduit.\n     */\n    event PotentialOwnerUpdated(address indexed newPotentialOwner);\n\n    /**\n     * @dev Revert with an error when attempting to create a new conduit using a\n     *      conduit key where the first twenty bytes of the key do not match the\n     *      address of the caller.\n     */\n    error InvalidCreator();\n\n    /**\n     * @dev Revert with an error when attempting to create a new conduit when no\n     *      initial owner address is supplied.\n     */\n    error InvalidInitialOwner();\n\n    /**\n     * @dev Revert with an error when attempting to set a new potential owner\n     *      that is already set.\n     */\n    error NewPotentialOwnerAlreadySet(\n        address conduit,\n        address newPotentialOwner\n    );\n\n    /**\n     * @dev Revert with an error when attempting to cancel ownership transfer\n     *      when no new potential owner is currently set.\n     */\n    error NoPotentialOwnerCurrentlySet(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to interact with a conduit that\n     *      does not yet exist.\n     */\n    error NoConduit();\n\n    /**\n     * @dev Revert with an error when attempting to create a conduit that\n     *      already exists.\n     */\n    error ConduitAlreadyExists(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to update channels or transfer\n     *      ownership of a conduit when the caller is not the owner of the\n     *      conduit in question.\n     */\n    error CallerIsNotOwner(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to register a new potential\n     *      owner and supplying the null address.\n     */\n    error NewPotentialOwnerIsZeroAddress(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to claim ownership of a conduit\n     *      with a caller that is not the current potential owner for the\n     *      conduit in question.\n     */\n    error CallerIsNotNewPotentialOwner(address conduit);\n\n    /**\n     * @dev Revert with an error when attempting to retrieve a channel using an\n     *      index that is out of range.\n     */\n    error ChannelOutOfRange(address conduit);\n\n    /**\n     * @notice Deploy a new conduit using a supplied conduit key and assigning\n     *         an initial owner for the deployed conduit. Note that the first\n     *         twenty bytes of the supplied conduit key must match the caller\n     *         and that a new conduit cannot be created if one has already been\n     *         deployed using the same conduit key.\n     *\n     * @param conduitKey   The conduit key used to deploy the conduit. Note that\n     *                     the first twenty bytes of the conduit key must match\n     *                     the caller of this contract.\n     * @param initialOwner The initial owner to set for the new conduit.\n     *\n     * @return conduit The address of the newly deployed conduit.\n     */\n    function createConduit(\n        bytes32 conduitKey,\n        address initialOwner\n    ) external returns (address conduit);\n\n    /**\n     * @notice Open or close a channel on a given conduit, thereby allowing the\n     *         specified account to execute transfers against that conduit.\n     *         Extreme care must be taken when updating channels, as malicious\n     *         or vulnerable channels can transfer any ERC20, ERC721 and ERC1155\n     *         tokens where the token holder has granted the conduit approval.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to open or close the channel.\n     * @param channel The channel to open or close on the conduit.\n     * @param isOpen  A boolean indicating whether to open or close the channel.\n     */\n    function updateChannel(\n        address conduit,\n        address channel,\n        bool isOpen\n    ) external;\n\n    /**\n     * @notice Initiate conduit ownership transfer by assigning a new potential\n     *         owner for the given conduit. Once set, the new potential owner\n     *         may call `acceptOwnership` to claim ownership of the conduit.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to initiate ownership transfer.\n     * @param newPotentialOwner The new potential owner of the conduit.\n     */\n    function transferOwnership(\n        address conduit,\n        address newPotentialOwner\n    ) external;\n\n    /**\n     * @notice Clear the currently set potential owner, if any, from a conduit.\n     *         Only the owner of the conduit in question may call this function.\n     *\n     * @param conduit The conduit for which to cancel ownership transfer.\n     */\n    function cancelOwnershipTransfer(address conduit) external;\n\n    /**\n     * @notice Accept ownership of a supplied conduit. Only accounts that the\n     *         current owner has set as the new potential owner may call this\n     *         function.\n     *\n     * @param conduit The conduit for which to accept ownership.\n     */\n    function acceptOwnership(address conduit) external;\n\n    /**\n     * @notice Retrieve the current owner of a deployed conduit.\n     *\n     * @param conduit The conduit for which to retrieve the associated owner.\n     *\n     * @return owner The owner of the supplied conduit.\n     */\n    function ownerOf(address conduit) external view returns (address owner);\n\n    /**\n     * @notice Retrieve the conduit key for a deployed conduit via reverse\n     *         lookup.\n     *\n     * @param conduit The conduit for which to retrieve the associated conduit\n     *                key.\n     *\n     * @return conduitKey The conduit key used to deploy the supplied conduit.\n     */\n    function getKey(address conduit) external view returns (bytes32 conduitKey);\n\n    /**\n     * @notice Derive the conduit associated with a given conduit key and\n     *         determine whether that conduit exists (i.e. whether it has been\n     *         deployed).\n     *\n     * @param conduitKey The conduit key used to derive the conduit.\n     *\n     * @return conduit The derived address of the conduit.\n     * @return exists  A boolean indicating whether the derived conduit has been\n     *                 deployed or not.\n     */\n    function getConduit(\n        bytes32 conduitKey\n    ) external view returns (address conduit, bool exists);\n\n    /**\n     * @notice Retrieve the potential owner, if any, for a given conduit. The\n     *         current owner may set a new potential owner via\n     *         `transferOwnership` and that owner may then accept ownership of\n     *         the conduit in question via `acceptOwnership`.\n     *\n     * @param conduit The conduit for which to retrieve the potential owner.\n     *\n     * @return potentialOwner The potential owner, if any, for the conduit.\n     */\n    function getPotentialOwner(\n        address conduit\n    ) external view returns (address potentialOwner);\n\n    /**\n     * @notice Retrieve the status (either open or closed) of a given channel on\n     *         a conduit.\n     *\n     * @param conduit The conduit for which to retrieve the channel status.\n     * @param channel The channel for which to retrieve the status.\n     *\n     * @return isOpen The status of the channel on the given conduit.\n     */\n    function getChannelStatus(\n        address conduit,\n        address channel\n    ) external view returns (bool isOpen);\n\n    /**\n     * @notice Retrieve the total number of open channels for a given conduit.\n     *\n     * @param conduit The conduit for which to retrieve the total channel count.\n     *\n     * @return totalChannels The total number of open channels for the conduit.\n     */\n    function getTotalChannels(\n        address conduit\n    ) external view returns (uint256 totalChannels);\n\n    /**\n     * @notice Retrieve an open channel at a specific index for a given conduit.\n     *         Note that the index of a channel can change as a result of other\n     *         channels being closed on the conduit.\n     *\n     * @param conduit      The conduit for which to retrieve the open channel.\n     * @param channelIndex The index of the channel in question.\n     *\n     * @return channel The open channel, if any, at the specified channel index.\n     */\n    function getChannel(\n        address conduit,\n        uint256 channelIndex\n    ) external view returns (address channel);\n\n    /**\n     * @notice Retrieve all open channels for a given conduit. Note that calling\n     *         this function for a conduit with many channels will revert with\n     *         an out-of-gas error.\n     *\n     * @param conduit The conduit for which to retrieve open channels.\n     *\n     * @return channels An array of open channels on the given conduit.\n     */\n    function getChannels(\n        address conduit\n    ) external view returns (address[] memory channels);\n\n    /**\n     * @dev Retrieve the conduit creation code and runtime code hashes.\n     */\n    function getConduitCodeHashes()\n        external\n        view\n        returns (bytes32 creationCodeHash, bytes32 runtimeCodeHash);\n}\n"},"seaport-types/src/interfaces/ConduitInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    ConduitBatch1155Transfer,\n    ConduitTransfer\n} from \"../conduit/lib/ConduitStructs.sol\";\n\n/**\n * @title ConduitInterface\n * @author 0age\n * @notice ConduitInterface contains all external function interfaces, events,\n *         and errors for conduit contracts.\n */\ninterface ConduitInterface {\n    /**\n     * @dev Revert with an error when attempting to execute transfers using a\n     *      caller that does not have an open channel.\n     */\n    error ChannelClosed(address channel);\n\n    /**\n     * @dev Revert with an error when attempting to update a channel to the\n     *      current status of that channel.\n     */\n    error ChannelStatusAlreadySet(address channel, bool isOpen);\n\n    /**\n     * @dev Revert with an error when attempting to execute a transfer for an\n     *      item that does not have an ERC20/721/1155 item type.\n     */\n    error InvalidItemType();\n\n    /**\n     * @dev Revert with an error when attempting to update the status of a\n     *      channel from a caller that is not the conduit controller.\n     */\n    error InvalidController();\n\n    /**\n     * @dev Emit an event whenever a channel is opened or closed.\n     *\n     * @param channel The channel that has been updated.\n     * @param open    A boolean indicating whether the conduit is open or not.\n     */\n    event ChannelUpdated(address indexed channel, bool open);\n\n    /**\n     * @notice Execute a sequence of ERC20/721/1155 transfers. Only a caller\n     *         with an open channel can call this function.\n     *\n     * @param transfers The ERC20/721/1155 transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function execute(\n        ConduitTransfer[] calldata transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Execute a sequence of batch 1155 transfers. Only a caller with an\n     *         open channel can call this function.\n     *\n     * @param batch1155Transfers The 1155 batch transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function executeBatch1155(\n        ConduitBatch1155Transfer[] calldata batch1155Transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Execute a sequence of transfers, both single and batch 1155. Only\n     *         a caller with an open channel can call this function.\n     *\n     * @param standardTransfers  The ERC20/721/1155 transfers to perform.\n     * @param batch1155Transfers The 1155 batch transfers to perform.\n     *\n     * @return magicValue A magic value indicating that the transfers were\n     *                    performed successfully.\n     */\n    function executeWithBatch1155(\n        ConduitTransfer[] calldata standardTransfers,\n        ConduitBatch1155Transfer[] calldata batch1155Transfers\n    ) external returns (bytes4 magicValue);\n\n    /**\n     * @notice Open or close a given channel. Only callable by the controller.\n     *\n     * @param channel The channel to open or close.\n     * @param isOpen  The status of the channel (either open or closed).\n     */\n    function updateChannel(address channel, bool isOpen) external;\n}\n"},"seaport-types/src/interfaces/ConsiderationEventsAndErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    OrderParameters,\n    ReceivedItem,\n    SpentItem\n} from \"../lib/ConsiderationStructs.sol\";\n\n/**\n * @title ConsiderationEventsAndErrors\n * @author 0age\n * @notice ConsiderationEventsAndErrors contains all events and errors.\n */\ninterface ConsiderationEventsAndErrors {\n    /**\n     * @dev Emit an event whenever an order is successfully fulfilled.\n     *\n     * @param orderHash     The hash of the fulfilled order.\n     * @param offerer       The offerer of the fulfilled order.\n     * @param zone          The zone of the fulfilled order.\n     * @param recipient     The recipient of each spent item on the fulfilled\n     *                      order, or the null address if there is no specific\n     *                      fulfiller (i.e. the order is part of a group of\n     *                      orders). Defaults to the caller unless explicitly\n     *                      specified otherwise by the fulfiller.\n     * @param offer         The offer items spent as part of the order.\n     * @param consideration The consideration items received as part of the\n     *                      order along with the recipients of each item.\n     */\n    event OrderFulfilled(\n        bytes32 orderHash,\n        address indexed offerer,\n        address indexed zone,\n        address recipient,\n        SpentItem[] offer,\n        ReceivedItem[] consideration\n    );\n\n    /**\n     * @dev Emit an event whenever an order is successfully cancelled.\n     *\n     * @param orderHash The hash of the cancelled order.\n     * @param offerer   The offerer of the cancelled order.\n     * @param zone      The zone of the cancelled order.\n     */\n    event OrderCancelled(\n        bytes32 orderHash,\n        address indexed offerer,\n        address indexed zone\n    );\n\n    /**\n     * @dev Emit an event whenever an order is explicitly validated. Note that\n     *      this event will not be emitted on partial fills even though they do\n     *      validate the order as part of partial fulfillment.\n     *\n     * @param orderHash        The hash of the validated order.\n     * @param orderParameters  The parameters of the validated order.\n     */\n    event OrderValidated(bytes32 orderHash, OrderParameters orderParameters);\n\n    /**\n     * @dev Emit an event whenever one or more orders are matched using either\n     *      matchOrders or matchAdvancedOrders.\n     *\n     * @param orderHashes The order hashes of the matched orders.\n     */\n    event OrdersMatched(bytes32[] orderHashes);\n\n    /**\n     * @dev Emit an event whenever a counter for a given offerer is incremented.\n     *\n     * @param newCounter The new counter for the offerer.\n     * @param offerer    The offerer in question.\n     */\n    event CounterIncremented(uint256 newCounter, address indexed offerer);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order that has\n     *      already been fully filled.\n     *\n     * @param orderHash The order hash on which a fill was attempted.\n     */\n    error OrderAlreadyFilled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order outside the\n     *      specified start time and end time.\n     *\n     * @param startTime The time at which the order becomes active.\n     * @param endTime   The time at which the order becomes inactive.\n     */\n    error InvalidTime(uint256 startTime, uint256 endTime);\n\n    /**\n     * @dev Revert with an error when attempting to fill an order referencing an\n     *      invalid conduit (i.e. one that has not been deployed).\n     */\n    error InvalidConduit(bytes32 conduitKey, address conduit);\n\n    /**\n     * @dev Revert with an error when an order is supplied for fulfillment with\n     *      a consideration array that is shorter than the original array.\n     */\n    error MissingOriginalConsiderationItems();\n\n    /**\n     * @dev Revert with an error when an order is validated and the length of\n     *      the consideration array is not equal to the supplied total original\n     *      consideration items value. This error is also thrown when contract\n     *      orders supply a total original consideration items value that does\n     *      not match the supplied consideration array length.\n     */\n    error ConsiderationLengthNotEqualToTotalOriginal();\n\n    /**\n     * @dev Revert with an error when a call to a conduit fails with revert data\n     *      that is too expensive to return.\n     */\n    error InvalidCallToConduit(address conduit);\n\n    /**\n     * @dev Revert with an error if a consideration amount has not been fully\n     *      zeroed out after applying all fulfillments.\n     *\n     * @param orderIndex         The index of the order with the consideration\n     *                           item with a shortfall.\n     * @param considerationIndex The index of the consideration item on the\n     *                           order.\n     * @param shortfallAmount    The unfulfilled consideration amount.\n     */\n    error ConsiderationNotMet(\n        uint256 orderIndex,\n        uint256 considerationIndex,\n        uint256 shortfallAmount\n    );\n\n    /**\n     * @dev Revert with an error when insufficient native tokens are supplied as\n     *      part of msg.value when fulfilling orders.\n     */\n    error InsufficientNativeTokensSupplied();\n\n    /**\n     * @dev Revert with an error when a native token transfer reverts.\n     */\n    error NativeTokenTransferGenericFailure(address account, uint256 amount);\n\n    /**\n     * @dev Revert with an error when a partial fill is attempted on an order\n     *      that does not specify partial fill support in its order type.\n     */\n    error PartialFillsNotEnabledForOrder();\n\n    /**\n     * @dev Revert with an error when attempting to fill an order that has been\n     *      cancelled.\n     *\n     * @param orderHash The hash of the cancelled order.\n     */\n    error OrderIsCancelled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill a basic order that has\n     *      been partially filled.\n     *\n     * @param orderHash The hash of the partially used order.\n     */\n    error OrderPartiallyFilled(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to cancel an order as a caller\n     *      other than the indicated offerer or zone or when attempting to\n     *      cancel a contract order.\n     */\n    error CannotCancelOrder();\n\n    /**\n     * @dev Revert with an error when supplying a fraction with a value of zero\n     *      for the numerator or denominator, or one where the numerator exceeds\n     *      the denominator.\n     */\n    error BadFraction();\n\n    /**\n     * @dev Revert with an error when a caller attempts to supply callvalue to a\n     *      non-payable basic order route or does not supply any callvalue to a\n     *      payable basic order route.\n     */\n    error InvalidMsgValue(uint256 value);\n\n    /**\n     * @dev Revert with an error when attempting to fill a basic order using\n     *      calldata not produced by default ABI encoding.\n     */\n    error InvalidBasicOrderParameterEncoding();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill any number of\n     *      available orders when none are fulfillable.\n     */\n    error NoSpecifiedOrdersAvailable();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order with an\n     *      offer for a native token outside of matching orders.\n     */\n    error InvalidNativeOfferItem();\n}\n"},"seaport-types/src/interfaces/ConsiderationInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n    AdvancedOrder,\n    BasicOrderParameters,\n    CriteriaResolver,\n    Execution,\n    Fulfillment,\n    FulfillmentComponent,\n    Order,\n    OrderComponents\n} from \"../lib/ConsiderationStructs.sol\";\n\n/**\n * @title ConsiderationInterface\n * @author 0age\n * @custom:version 1.6\n * @notice Consideration is a generalized native token/ERC20/ERC721/ERC1155\n *         marketplace. It minimizes external calls to the greatest extent\n *         possible and provides lightweight methods for common routes as well\n *         as more flexible methods for composing advanced orders.\n *\n * @dev ConsiderationInterface contains all external function interfaces for\n *      Consideration.\n */\ninterface ConsiderationInterface {\n    /**\n     * @notice Fulfill an order offering an ERC721 token by supplying Ether (or\n     *         the native token for the given chain) as consideration for the\n     *         order. An arbitrary number of \"additional recipients\" may also be\n     *         supplied which will each receive native tokens from the fulfiller\n     *         as consideration.\n     *\n     * @param parameters Additional information on the fulfilled order. Note\n     *                   that the offerer must first approve this contract (or\n     *                   their preferred conduit if indicated by the order) for\n     *                   their offered ERC721 token to be transferred.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder(\n        BasicOrderParameters calldata parameters\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Fulfill an order with an arbitrary number of items for offer and\n     *         consideration. Note that this function does not support\n     *         criteria-based orders or partial filling of orders (though\n     *         filling the remainder of a partially-filled order is supported).\n     *\n     * @param order               The order to fulfill. Note that both the\n     *                            offerer and the fulfiller must first approve\n     *                            this contract (or the corresponding conduit if\n     *                            indicated) to transfer any relevant tokens on\n     *                            their behalf and that contracts must implement\n     *                            `onERC1155Received` to receive ERC1155 tokens\n     *                            as consideration.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillOrder(\n        Order calldata order,\n        bytes32 fulfillerConduitKey\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Fill an order, fully or partially, with an arbitrary number of\n     *         items for offer and consideration alongside criteria resolvers\n     *         containing specific token identifiers and associated proofs.\n     *\n     * @param advancedOrder       The order to fulfill along with the fraction\n     *                            of the order to attempt to fill. Note that\n     *                            both the offerer and the fulfiller must first\n     *                            approve this contract (or their preferred\n     *                            conduit if indicated by the order) to transfer\n     *                            any relevant tokens on their behalf and that\n     *                            contracts must implement `onERC1155Received`\n     *                            to receive ERC1155 tokens as consideration.\n     *                            Also note that all offer and consideration\n     *                            components must have no remainder after\n     *                            multiplication of the respective amount with\n     *                            the supplied fraction for the partial fill to\n     *                            be considered valid.\n     * @param criteriaResolvers   An array where each element contains a\n     *                            reference to a specific offer or\n     *                            consideration, a token identifier, and a proof\n     *                            that the supplied token identifier is\n     *                            contained in the merkle root held by the item\n     *                            in question's criteria element. Note that an\n     *                            empty criteria indicates that any\n     *                            (transferable) token identifier on the token\n     *                            in question is valid and that no associated\n     *                            proof needs to be supplied.\n     * @param fulfillerConduitKey A bytes32 value indicating what conduit, if\n     *                            any, to source the fulfiller's token approvals\n     *                            from. The zero hash signifies that no conduit\n     *                            should be used, with direct approvals set on\n     *                            Consideration.\n     * @param recipient           The intended recipient for all received items,\n     *                            with `address(0)` indicating that the caller\n     *                            should receive the items.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillAdvancedOrder(\n        AdvancedOrder calldata advancedOrder,\n        CriteriaResolver[] calldata criteriaResolvers,\n        bytes32 fulfillerConduitKey,\n        address recipient\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Attempt to fill a group of orders, each with an arbitrary number\n     *         of items for offer and consideration. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *         Note that this function does not support criteria-based orders or\n     *         partial filling of orders (though filling the remainder of a\n     *         partially-filled order is supported).\n     *\n     * @param orders                    The orders to fulfill. Note that both\n     *                                  the offerer and the fulfiller must first\n     *                                  approve this contract (or the\n     *                                  corresponding conduit if indicated) to\n     *                                  transfer any relevant tokens on their\n     *                                  behalf and that contracts must implement\n     *                                  `onERC1155Received` to receive ERC1155\n     *                                  tokens as consideration.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used, with\n     *                                  direct approvals set on this contract.\n     * @param maximumFulfilled          The maximum number of orders to fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders. Note that unspent offer item amounts or\n     *                         native tokens will not be reflected as part of\n     *                         this array.\n     */\n    function fulfillAvailableOrders(\n        Order[] calldata orders,\n        FulfillmentComponent[][] calldata offerFulfillments,\n        FulfillmentComponent[][] calldata considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        returns (bool[] memory availableOrders, Execution[] memory executions);\n\n    /**\n     * @notice Attempt to fill a group of orders, fully or partially, with an\n     *         arbitrary number of items for offer and consideration per order\n     *         alongside criteria resolvers containing specific token\n     *         identifiers and associated proofs. Any order that is not\n     *         currently active, has already been fully filled, or has been\n     *         cancelled will be omitted. Remaining offer and consideration\n     *         items will then be aggregated where possible as indicated by the\n     *         supplied offer and consideration component arrays and aggregated\n     *         items will be transferred to the fulfiller or to each intended\n     *         recipient, respectively. Note that a failing item transfer or an\n     *         issue with order formatting will cause the entire batch to fail.\n     *\n     * @param advancedOrders            The orders to fulfill along with the\n     *                                  fraction of those orders to attempt to\n     *                                  fill. Note that both the offerer and the\n     *                                  fulfiller must first approve this\n     *                                  contract (or their preferred conduit if\n     *                                  indicated by the order) to transfer any\n     *                                  relevant tokens on their behalf and that\n     *                                  contracts must implement\n     *                                  `onERC1155Received` to enable receipt of\n     *                                  ERC1155 tokens as consideration. Also\n     *                                  note that all offer and consideration\n     *                                  components must have no remainder after\n     *                                  multiplication of the respective amount\n     *                                  with the supplied fraction for an\n     *                                  order's partial fill amount to be\n     *                                  considered valid.\n     * @param criteriaResolvers         An array where each element contains a\n     *                                  reference to a specific offer or\n     *                                  consideration, a token identifier, and a\n     *                                  proof that the supplied token identifier\n     *                                  is contained in the merkle root held by\n     *                                  the item in question's criteria element.\n     *                                  Note that an empty criteria indicates\n     *                                  that any (transferable) token\n     *                                  identifier on the token in question is\n     *                                  valid and that no associated proof needs\n     *                                  to be supplied.\n     * @param offerFulfillments         An array of FulfillmentComponent arrays\n     *                                  indicating which offer items to attempt\n     *                                  to aggregate when preparing executions.\n     * @param considerationFulfillments An array of FulfillmentComponent arrays\n     *                                  indicating which consideration items to\n     *                                  attempt to aggregate when preparing\n     *                                  executions.\n     * @param fulfillerConduitKey       A bytes32 value indicating what conduit,\n     *                                  if any, to source the fulfiller's token\n     *                                  approvals from. The zero hash signifies\n     *                                  that no conduit should be used, with\n     *                                  direct approvals set on this contract.\n     * @param recipient                 The intended recipient for all received\n     *                                  items, with `address(0)` indicating that\n     *                                  the caller should receive the items.\n     * @param maximumFulfilled          The maximum number of orders to fulfill.\n     *\n     * @return availableOrders An array of booleans indicating if each order\n     *                         with an index corresponding to the index of the\n     *                         returned boolean was fulfillable or not.\n     * @return executions      An array of elements indicating the sequence of\n     *                         transfers performed as part of matching the given\n     *                         orders. Note that unspent offer item amounts or\n     *                         native tokens will not be reflected as part of\n     *                         this array.\n     */\n    function fulfillAvailableAdvancedOrders(\n        AdvancedOrder[] calldata advancedOrders,\n        CriteriaResolver[] calldata criteriaResolvers,\n        FulfillmentComponent[][] calldata offerFulfillments,\n        FulfillmentComponent[][] calldata considerationFulfillments,\n        bytes32 fulfillerConduitKey,\n        address recipient,\n        uint256 maximumFulfilled\n    )\n        external\n        payable\n        returns (bool[] memory availableOrders, Execution[] memory executions);\n\n    /**\n     * @notice Match an arbitrary number of orders, each with an arbitrary\n     *         number of items for offer and consideration along with a set of\n     *         fulfillments allocating offer components to consideration\n     *         components. Note that this function does not support\n     *         criteria-based or partial filling of orders (though filling the\n     *         remainder of a partially-filled order is supported). Any unspent\n     *         offer item amounts or native tokens will be transferred to the\n     *         caller.\n     *\n     * @param orders       The orders to match. Note that both the offerer and\n     *                     fulfiller on each order must first approve this\n     *                     contract (or their conduit if indicated by the order)\n     *                     to transfer any relevant tokens on their behalf and\n     *                     each consideration recipient must implement\n     *                     `onERC1155Received` to enable ERC1155 token receipt.\n     * @param fulfillments An array of elements allocating offer components to\n     *                     consideration components. Note that each\n     *                     consideration component must be fully met for the\n     *                     match operation to be valid.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders. Note that unspent offer item amounts or\n     *                    native tokens will not be reflected as part of this\n     *                    array.\n     */\n    function matchOrders(\n        Order[] calldata orders,\n        Fulfillment[] calldata fulfillments\n    ) external payable returns (Execution[] memory executions);\n\n    /**\n     * @notice Match an arbitrary number of full or partial orders, each with an\n     *         arbitrary number of items for offer and consideration, supplying\n     *         criteria resolvers containing specific token identifiers and\n     *         associated proofs as well as fulfillments allocating offer\n     *         components to consideration components. Any unspent offer item\n     *         amounts will be transferred to the designated recipient (with the\n     *         null address signifying to use the caller) and any unspent native\n     *         tokens will be returned to the caller.\n     *\n     * @param orders            The advanced orders to match. Note that both the\n     *                          offerer and fulfiller on each order must first\n     *                          approve this contract (or a preferred conduit if\n     *                          indicated by the order) to transfer any relevant\n     *                          tokens on their behalf and each consideration\n     *                          recipient must implement `onERC1155Received` in\n     *                          order to receive ERC1155 tokens. Also note that\n     *                          the offer and consideration components for each\n     *                          order must have no remainder after multiplying\n     *                          the respective amount with the supplied fraction\n     *                          in order for the group of partial fills to be\n     *                          considered valid.\n     * @param criteriaResolvers An array where each element contains a reference\n     *                          to a specific order as well as that order's\n     *                          offer or consideration, a token identifier, and\n     *                          a proof that the supplied token identifier is\n     *                          contained in the order's merkle root. Note that\n     *                          an empty root indicates that any (transferable)\n     *                          token identifier is valid and that no associated\n     *                          proof needs to be supplied.\n     * @param fulfillments      An array of elements allocating offer components\n     *                          to consideration components. Note that each\n     *                          consideration component must be fully met in\n     *                          order for the match operation to be valid.\n     * @param recipient         The intended recipient for all unspent offer\n     *                          item amounts, or the caller if the null address\n     *                          is supplied.\n     *\n     * @return executions An array of elements indicating the sequence of\n     *                    transfers performed as part of matching the given\n     *                    orders. Note that unspent offer item amounts or native\n     *                    tokens will not be reflected as part of this array.\n     */\n    function matchAdvancedOrders(\n        AdvancedOrder[] calldata orders,\n        CriteriaResolver[] calldata criteriaResolvers,\n        Fulfillment[] calldata fulfillments,\n        address recipient\n    ) external payable returns (Execution[] memory executions);\n\n    /**\n     * @notice Cancel an arbitrary number of orders. Note that only the offerer\n     *         or the zone of a given order may cancel it. Callers should ensure\n     *         that the intended order was cancelled by calling `getOrderStatus`\n     *         and confirming that `isCancelled` returns `true`.\n     *\n     * @param orders The orders to cancel.\n     *\n     * @return cancelled A boolean indicating whether the supplied orders have\n     *                   been successfully cancelled.\n     */\n    function cancel(\n        OrderComponents[] calldata orders\n    ) external returns (bool cancelled);\n\n    /**\n     * @notice Validate an arbitrary number of orders, thereby registering their\n     *         signatures as valid and allowing the fulfiller to skip signature\n     *         verification on fulfillment. Note that validated orders may still\n     *         be unfulfillable due to invalid item amounts or other factors;\n     *         callers should determine whether validated orders are fulfillable\n     *         by simulating the fulfillment call prior to execution. Also note\n     *         that anyone can validate a signed order, but only the offerer can\n     *         validate an order without supplying a signature.\n     *\n     * @param orders The orders to validate.\n     *\n     * @return validated A boolean indicating whether the supplied orders have\n     *                   been successfully validated.\n     */\n    function validate(\n        Order[] calldata orders\n    ) external returns (bool validated);\n\n    /**\n     * @notice Cancel all orders from a given offerer with a given zone in bulk\n     *         by incrementing a counter. Note that only the offerer may\n     *         increment the counter.\n     *\n     * @return newCounter The new counter.\n     */\n    function incrementCounter() external returns (uint256 newCounter);\n\n    /**\n     * @notice Fulfill an order offering an ERC721 token by supplying Ether (or\n     *         the native token for the given chain) as consideration for the\n     *         order. An arbitrary number of \"additional recipients\" may also be\n     *         supplied which will each receive native tokens from the fulfiller\n     *         as consideration. Note that this function costs less gas than\n     *         `fulfillBasicOrder` due to the zero bytes in the function\n     *         selector (0x00000000) which also results in earlier function\n     *         dispatch.\n     *\n     * @param parameters Additional information on the fulfilled order. Note\n     *                   that the offerer must first approve this contract (or\n     *                   their preferred conduit if indicated by the order) for\n     *                   their offered ERC721 token to be transferred.\n     *\n     * @return fulfilled A boolean indicating whether the order has been\n     *                   successfully fulfilled.\n     */\n    function fulfillBasicOrder_efficient_6GL6yc(\n        BasicOrderParameters calldata parameters\n    ) external payable returns (bool fulfilled);\n\n    /**\n     * @notice Retrieve the order hash for a given order.\n     *\n     * @param order The components of the order.\n     *\n     * @return orderHash The order hash.\n     */\n    function getOrderHash(\n        OrderComponents calldata order\n    ) external view returns (bytes32 orderHash);\n\n    /**\n     * @notice Retrieve the status of a given order by hash, including whether\n     *         the order has been cancelled or validated and the fraction of the\n     *         order that has been filled.\n     *\n     * @param orderHash The order hash in question.\n     *\n     * @return isValidated A boolean indicating whether the order in question\n     *                     has been validated (i.e. previously approved or\n     *                     partially filled).\n     * @return isCancelled A boolean indicating whether the order in question\n     *                     has been cancelled.\n     * @return totalFilled The total portion of the order that has been filled\n     *                     (i.e. the \"numerator\").\n     * @return totalSize   The total size of the order that is either filled or\n     *                     unfilled (i.e. the \"denominator\").\n     */\n    function getOrderStatus(\n        bytes32 orderHash\n    )\n        external\n        view\n        returns (\n            bool isValidated,\n            bool isCancelled,\n            uint256 totalFilled,\n            uint256 totalSize\n        );\n\n    /**\n     * @notice Retrieve the current counter for a given offerer.\n     *\n     * @param offerer The offerer in question.\n     *\n     * @return counter The current counter.\n     */\n    function getCounter(\n        address offerer\n    ) external view returns (uint256 counter);\n\n    /**\n     * @notice Retrieve configuration information for this contract.\n     *\n     * @return version           The contract version.\n     * @return domainSeparator   The domain separator for this contract.\n     * @return conduitController The conduit Controller set for this contract.\n     */\n    function information()\n        external\n        view\n        returns (\n            string memory version,\n            bytes32 domainSeparator,\n            address conduitController\n        );\n\n    function getContractOffererNonce(\n        address contractOfferer\n    ) external view returns (uint256 nonce);\n\n    /**\n     * @notice Retrieve the name of this contract.\n     *\n     * @return contractName The name of this contract.\n     */\n    function name() external view returns (string memory contractName);\n}\n"},"seaport-types/src/interfaces/CriteriaResolutionErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { Side } from \"../lib/ConsiderationEnums.sol\";\n\n/**\n * @title CriteriaResolutionErrors\n * @author 0age\n * @notice CriteriaResolutionErrors contains all errors related to criteria\n *         resolution.\n */\ninterface CriteriaResolutionErrors {\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order that has not been supplied.\n     *\n     * @param side The side of the order that was not supplied.\n     */\n    error OrderCriteriaResolverOutOfRange(Side side);\n\n    /**\n     * @dev Revert with an error if an offer item still has unresolved criteria\n     *      after applying all criteria resolvers.\n     *\n     * @param orderIndex The index of the order that contains the offer item.\n     * @param offerIndex The index of the offer item that still has unresolved\n     *                   criteria.\n     */\n    error UnresolvedOfferCriteria(uint256 orderIndex, uint256 offerIndex);\n\n    /**\n     * @dev Revert with an error if a consideration item still has unresolved\n     *      criteria after applying all criteria resolvers.\n     *\n     * @param orderIndex         The index of the order that contains the\n     *                           consideration item.\n     * @param considerationIndex The index of the consideration item that still\n     *                           has unresolved criteria.\n     */\n    error UnresolvedConsiderationCriteria(\n        uint256 orderIndex,\n        uint256 considerationIndex\n    );\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with an offer item that has not been supplied.\n     */\n    error OfferCriteriaResolverOutOfRange();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with a consideration item that has not been supplied.\n     */\n    error ConsiderationCriteriaResolverOutOfRange();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that refers\n     *      to an order with an item that does not expect a criteria to be\n     *      resolved.\n     */\n    error CriteriaNotEnabledForItem();\n\n    /**\n     * @dev Revert with an error when providing a criteria resolver that\n     *      contains an invalid proof with respect to the given item and\n     *      chosen identifier.\n     */\n    error InvalidProof();\n}\n"},"seaport-types/src/interfaces/FulfillmentApplicationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport { Side } from \"../lib/ConsiderationEnums.sol\";\n\n/**\n * @title FulfillmentApplicationErrors\n * @author 0age\n * @notice FulfillmentApplicationErrors contains errors related to fulfillment\n *         application and aggregation.\n */\ninterface FulfillmentApplicationErrors {\n    /**\n     * @dev Revert with an error when a fulfillment is provided that does not\n     *      declare at least one component as part of a call to fulfill\n     *      available orders.\n     */\n    error MissingFulfillmentComponentOnAggregation(Side side);\n\n    /**\n     * @dev Revert with an error when a fulfillment is provided that does not\n     *      declare at least one offer component and at least one consideration\n     *      component.\n     */\n    error OfferAndConsiderationRequiredOnFulfillment();\n\n    /**\n     * @dev Revert with an error when the initial offer item named by a\n     *      fulfillment component does not match the type, token, identifier,\n     *      or conduit preference of the initial consideration item.\n     *\n     * @param fulfillmentIndex The index of the fulfillment component that\n     *                         does not match the initial offer item.\n     */\n    error MismatchedFulfillmentOfferAndConsiderationComponents(\n        uint256 fulfillmentIndex\n    );\n\n    /**\n     * @dev Revert with an error when an order or item index are out of range\n     *      or a fulfillment component does not match the type, token,\n     *      identifier, or conduit preference of the initial consideration item.\n     */\n    error InvalidFulfillmentComponentData();\n}\n"},"seaport-types/src/interfaces/ReentrancyErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ReentrancyErrors\n * @author 0age\n * @notice ReentrancyErrors contains errors related to reentrancy.\n */\ninterface ReentrancyErrors {\n    /**\n     * @dev Revert with an error when a caller attempts to reenter a protected\n     *      function.\n     */\n    error NoReentrantCalls();\n\n    /**\n     * @dev Revert with an error when attempting to activate the TSTORE opcode\n     *      when it is already active.\n     */\n    error TStoreAlreadyActivated();\n\n    /**\n     * @dev Revert with an error when attempting to activate the TSTORE opcode\n     *      in an EVM environment that does not support it.\n     */\n    error TStoreNotSupported();\n\n    /**\n     * @dev Revert with an error when deployment of the contract for testing\n     *      TSTORE support fails.\n     */\n    error TloadTestContractDeploymentFailed();\n}\n"},"seaport-types/src/interfaces/SignatureVerificationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title SignatureVerificationErrors\n * @author 0age\n * @notice SignatureVerificationErrors contains all errors related to signature\n *         verification.\n */\ninterface SignatureVerificationErrors {\n    /**\n     * @dev Revert with an error when a signature that does not contain a v\n     *      value of 27 or 28 has been supplied.\n     *\n     * @param v The invalid v value.\n     */\n    error BadSignatureV(uint8 v);\n\n    /**\n     * @dev Revert with an error when the signer recovered by the supplied\n     *      signature does not match the offerer or an allowed EIP-1271 signer\n     *      as specified by the offerer in the event they are a contract.\n     */\n    error InvalidSigner();\n\n    /**\n     * @dev Revert with an error when a signer cannot be recovered from the\n     *      supplied signature.\n     */\n    error InvalidSignature();\n\n    /**\n     * @dev Revert with an error when an EIP-1271 call to an account fails.\n     */\n    error BadContractSignature();\n}\n"},"seaport-types/src/interfaces/TokenTransferrerErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title TokenTransferrerErrors\n */\ninterface TokenTransferrerErrors {\n    /**\n     * @dev Revert with an error when an ERC721 transfer with amount other than\n     *      one is attempted.\n     *\n     * @param amount The amount of the ERC721 tokens to transfer.\n     */\n    error InvalidERC721TransferAmount(uint256 amount);\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order where an\n     *      item has an amount of zero.\n     */\n    error MissingItemAmount();\n\n    /**\n     * @dev Revert with an error when attempting to fulfill an order where an\n     *      item has unused parameters. This includes both the token and the\n     *      identifier parameters for native transfers as well as the identifier\n     *      parameter for ERC20 transfers. Note that the conduit does not\n     *      perform this check, leaving it up to the calling channel to enforce\n     *      when desired.\n     */\n    error UnusedItemParameters();\n\n    /**\n     * @dev Revert with an error when an ERC20, ERC721, or ERC1155 token\n     *      transfer reverts.\n     *\n     * @param token      The token for which the transfer was attempted.\n     * @param from       The source of the attempted transfer.\n     * @param to         The recipient of the attempted transfer.\n     * @param identifier The identifier for the attempted transfer.\n     * @param amount     The amount for the attempted transfer.\n     */\n    error TokenTransferGenericFailure(\n        address token,\n        address from,\n        address to,\n        uint256 identifier,\n        uint256 amount\n    );\n\n    /**\n     * @dev Revert with an error when a batch ERC1155 token transfer reverts.\n     *\n     * @param token       The token for which the transfer was attempted.\n     * @param from        The source of the attempted transfer.\n     * @param to          The recipient of the attempted transfer.\n     * @param identifiers The identifiers for the attempted transfer.\n     * @param amounts     The amounts for the attempted transfer.\n     */\n    error ERC1155BatchTransferGenericFailure(\n        address token,\n        address from,\n        address to,\n        uint256[] identifiers,\n        uint256[] amounts\n    );\n\n    /**\n     * @dev Revert with an error when an ERC20 token transfer returns a falsey\n     *      value.\n     *\n     * @param token      The token for which the ERC20 transfer was attempted.\n     * @param from       The source of the attempted ERC20 transfer.\n     * @param to         The recipient of the attempted ERC20 transfer.\n     * @param amount     The amount for the attempted ERC20 transfer.\n     */\n    error BadReturnValueFromERC20OnTransfer(\n        address token,\n        address from,\n        address to,\n        uint256 amount\n    );\n\n    /**\n     * @dev Revert with an error when an account being called as an assumed\n     *      contract does not have code and returns no data.\n     *\n     * @param account The account that should contain code.\n     */\n    error NoContract(address account);\n\n    /**\n     * @dev Revert with an error when attempting to execute an 1155 batch\n     *      transfer using calldata not produced by default ABI encoding or with\n     *      different lengths for ids and amounts arrays.\n     */\n    error Invalid1155BatchTransferEncoding();\n}\n"},"seaport-types/src/interfaces/ZoneInteractionErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/**\n * @title ZoneInteractionErrors\n * @author 0age\n * @notice ZoneInteractionErrors contains errors related to zone interaction.\n */\ninterface ZoneInteractionErrors {\n    /**\n     * @dev Revert with an error when attempting to fill an order that specifies\n     *      a restricted submitter as its order type when not submitted by\n     *      either the offerer or the order's zone or approved as valid by the\n     *      zone in question via a call to `isValidOrder`.\n     *\n     * @param orderHash The order hash for the invalid restricted order.\n     */\n    error InvalidRestrictedOrder(bytes32 orderHash);\n\n    /**\n     * @dev Revert with an error when attempting to fill a contract order that\n     *      fails to generate an order successfully, that does not adhere to the\n     *      requirements for minimum spent or maximum received supplied by the\n     *      fulfiller, or that fails the post-execution `ratifyOrder` check..\n     *\n     * @param orderHash The order hash for the invalid contract order.\n     */\n    error InvalidContractOrder(bytes32 orderHash);\n}\n"},"seaport-types/src/lib/ConsiderationConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/*\n * -------------------------- Disambiguation & Other Notes ---------------------\n *    - The term \"head\" is used as it is in the documentation for ABI encoding,\n *      but only in reference to dynamic types, i.e. it always refers to the\n *      offset or pointer to the body of a dynamic type. In calldata, the head\n *      is always an offset (relative to the parent object), while in memory,\n *      the head is always the pointer to the body. More information found here:\n *      https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#argument-encoding\n *        - Note that the length of an array is separate from and precedes the\n *          head of the array.\n *\n *    - The term \"body\" is used in place of the term \"head\" used in the ABI\n *      documentation. It refers to the start of the data for a dynamic type,\n *      e.g. the first word of a struct or the first word of the first element\n *      in an array.\n *\n *    - The term \"pointer\" is used to describe the absolute position of a value\n *      and never an offset relative to another value.\n *        - The suffix \"_ptr\" refers to a memory pointer.\n *        - The suffix \"_cdPtr\" refers to a calldata pointer.\n *\n *    - The term \"offset\" is used to describe the position of a value relative\n *      to some parent value. For example, OrderParameters_conduit_offset is the\n *      offset to the \"conduit\" value in the OrderParameters struct relative to\n *      the start of the body.\n *        - Note: Offsets are used to derive pointers.\n *\n *    - Some structs have pointers defined for all of their fields in this file.\n *      Lines which are commented out are fields that are not used in the\n *      codebase but have been left in for readability.\n */\n\n// Declare constants for name, version, and reentrancy sentinel values.\n\n// Name is right padded, so it touches the length which is left padded. This\n// enables writing both values at once. Length goes at byte 95 in memory, and\n// name fills bytes 96-109, so both values can be written left-padded to 77.\nuint256 constant NameLengthPtr = 0x4D;\nuint256 constant NameWithLength = 0x0d436F6E73696465726174696F6E;\n\nuint256 constant information_version_offset = 0;\nuint256 constant information_version_cd_offset = 0x60;\nuint256 constant information_domainSeparator_offset = 0x20;\nuint256 constant information_conduitController_offset = 0x40;\nuint256 constant information_versionLengthPtr = 0x63;\nuint256 constant information_versionWithLength = 0x03312e36; // 1.6\nuint256 constant information_length = 0xa0;\n\n// uint256(uint32(bytes4(keccak256(\"_REENTRANCY_GUARD_SLOT\"))))\nuint256 constant _REENTRANCY_GUARD_SLOT = 0x929eee14;\n\n/*\n *\n * --------------------------------------------------------------------------+\n * Opcode      | Mnemonic         | Stack               | Memory             |\n * --------------------------------------------------------------------------|\n * 60 0x02     | PUSH1 0x02       | 0x02                |                    |\n * 60 0x1e     | PUSH1 0x1e       | 0x1e 0x02           |                    |\n * 61 0x3d5c   | PUSH2 0x3d5c     | 0x3d5c 0x1e 0x02    |                    |\n * 3d          | RETURNDATASIZE   | 0 0x3d5c 0x1e 0x02  |                    |\n *                                                                           |\n * ::: store deployed bytecode in memory: (3d) RETURNDATASIZE (5c) TLOAD ::: |\n * 52          | MSTORE           | 0x1e 0x02           | [0..0x20): 0x3d5c  |\n * f3          | RETURN           |                     | [0..0x20): 0x3d5c  |\n * --------------------------------------------------------------------------+\n */\nuint256 constant _TLOAD_TEST_PAYLOAD = 0x6002_601e_613d5c_3d_52_f3;\nuint256 constant _TLOAD_TEST_PAYLOAD_LENGTH = 0x0a;\nuint256 constant _TLOAD_TEST_PAYLOAD_OFFSET = 0x16;\nuint256 constant _NOT_ENTERED_TSTORE = 0;\nuint256 constant _ENTERED_TSTORE = 1;\nuint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_TSTORE = 2;\nuint256 constant _TSTORE_ENABLED_SSTORE = 0;\nuint256 constant _NOT_ENTERED_SSTORE = 1;\nuint256 constant _ENTERED_SSTORE = 2;\nuint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS_SSTORE = 3;\n\nuint256 constant Offset_fulfillAdvancedOrder_criteriaResolvers = 0x20;\nuint256 constant Offset_fulfillAvailableOrders_offerFulfillments = 0x20;\nuint256 constant Offset_fulfillAvailableOrders_considerationFulfillments = 0x40;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_criteriaResolvers = 0x20;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_offerFulfillments = 0x40;\nuint256 constant Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts =\n    (0x60);\n\nuint256 constant Offset_matchOrders_fulfillments = 0x20;\n\nuint256 constant Offset_matchAdvancedOrders_criteriaResolvers = 0x20;\nuint256 constant Offset_matchAdvancedOrders_fulfillments = 0x40;\n\n// Common Offsets\n// Offsets for identically positioned fields shared by:\n// OfferItem, ConsiderationItem, SpentItem, ReceivedItem\n\nuint256 constant Selector_length = 0x4;\n\nuint256 constant Common_token_offset = 0x20;\nuint256 constant Common_identifier_offset = 0x40;\nuint256 constant Common_amount_offset = 0x60;\nuint256 constant Common_endAmount_offset = 0x80;\n\nuint256 constant SpentItem_size = 0x80;\nuint256 constant SpentItem_size_shift = 0x7;\n\nuint256 constant OfferItem_size = 0xa0;\nuint256 constant OfferItem_size_with_head_pointer = 0xc0;\n\nuint256 constant ReceivedItem_size_excluding_recipient = 0x80;\nuint256 constant ReceivedItem_size = 0xa0;\nuint256 constant ReceivedItem_amount_offset = 0x60;\nuint256 constant ReceivedItem_recipient_offset = 0x80;\n\nuint256 constant ReceivedItem_CommonParams_size = 0x60;\n\nuint256 constant ConsiderationItem_size = 0xc0;\nuint256 constant ConsiderationItem_size_with_head_pointer = 0xe0;\n\nuint256 constant ConsiderationItem_recipient_offset = 0xa0;\n// Store the same constant in an abbreviated format for a line length fix.\nuint256 constant ConsiderItem_recipient_offset = 0xa0;\n\nuint256 constant Execution_offerer_offset = 0x20;\nuint256 constant Execution_conduit_offset = 0x40;\n\n// uint256 constant OrderParameters_offerer_offset = 0x00;\nuint256 constant OrderParameters_zone_offset = 0x20;\nuint256 constant OrderParameters_offer_head_offset = 0x40;\nuint256 constant OrderParameters_consideration_head_offset = 0x60;\n// uint256 constant OrderParameters_orderType_offset = 0x80;\nuint256 constant OrderParameters_startTime_offset = 0xa0;\nuint256 constant OrderParameters_endTime_offset = 0xc0;\nuint256 constant OrderParameters_zoneHash_offset = 0xe0;\nuint256 constant OrderParameters_salt_offset = 0x100;\nuint256 constant OrderParameters_conduit_offset = 0x120;\nuint256 constant OrderParameters_counter_offset = 0x140;\n\nuint256 constant Fulfillment_itemIndex_offset = 0x20;\n\nuint256 constant AdvancedOrder_head_size = 0xa0;\nuint256 constant AdvancedOrder_numerator_offset = 0x20;\nuint256 constant AdvancedOrder_denominator_offset = 0x40;\nuint256 constant AdvancedOrder_signature_offset = 0x60;\nuint256 constant AdvancedOrder_extraData_offset = 0x80;\n\nuint256 constant OrderStatus_ValidatedAndNotCancelled = 1;\nuint256 constant OrderStatus_filledNumerator_offset = 0x10;\nuint256 constant OrderStatus_filledDenominator_offset = 0x88;\nuint256 constant OrderStatus_ValidatedAndNotCancelledAndFullyFilled = (\n    0x0000000000000000000000000000010000000000000000000000000000010001\n);\n\nuint256 constant ThirtyOneBytes = 0x1f;\nuint256 constant OneWord = 0x20;\nuint256 constant TwoWords = 0x40;\nuint256 constant ThreeWords = 0x60;\nuint256 constant FourWords = 0x80;\nuint256 constant FiveWords = 0xa0;\n\nuint256 constant OneWordShift = 0x5;\nuint256 constant TwoWordsShift = 0x6;\n\nuint256 constant SixtyThreeBytes = 0x3f;\nuint256 constant OnlyFullWordMask = 0xffffffe0;\n\nuint256 constant FreeMemoryPointerSlot = 0x40;\nuint256 constant ZeroSlot = 0x60;\nuint256 constant DefaultFreeMemoryPointer = 0x80;\n\nuint256 constant Slot0x80 = 0x80;\nuint256 constant Slot0xA0 = 0xa0;\n\nuint256 constant BasicOrder_common_params_size = 0xa0;\nuint256 constant BasicOrder_considerationHashesArray_ptr = 0x160;\nuint256 constant BasicOrder_receivedItemByteMap =\n    (0x0000010102030000000000000000000000000000000000000000000000000000);\nuint256 constant BasicOrder_offeredItemByteMap =\n    (0x0203020301010000000000000000000000000000000000000000000000000000);\nuint256 constant BasicOrder_consideration_offset_from_offer = 0xa0;\n\nbytes32 constant OrdersMatchedTopic0 =\n    (0x4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e7);\n\nuint256 constant EIP712_Order_size = 0x180;\nuint256 constant EIP712_OfferItem_size = 0xc0;\nuint256 constant EIP712_ConsiderationItem_size = 0xe0;\nuint256 constant AdditionalRecipient_size = 0x40;\nuint256 constant AdditionalRecipient_size_shift = 0x6;\n\nuint256 constant EIP712_DomainSeparator_offset = 0x02;\nuint256 constant EIP712_OrderHash_offset = 0x22;\nuint256 constant EIP712_DigestPayload_size = 0x42;\n\nuint256 constant EIP712_domainData_nameHash_offset = 0x20;\nuint256 constant EIP712_domainData_versionHash_offset = 0x40;\nuint256 constant EIP712_domainData_chainId_offset = 0x60;\nuint256 constant EIP712_domainData_verifyingContract_offset = 0x80;\nuint256 constant EIP712_domainData_size = 0xa0;\n\n// Minimum BulkOrder proof size: 64 bytes for signature + 3 for key + 32 for 1\n// sibling. Maximum BulkOrder proof size: 65 bytes for signature + 3 for key +\n// 768 for 24 siblings.\n\nuint256 constant BulkOrderProof_minSize = 0x63;\nuint256 constant BulkOrderProof_rangeSize = 0x2e2;\nuint256 constant BulkOrderProof_lengthAdjustmentBeforeMask = 0x1d;\nuint256 constant BulkOrderProof_lengthRangeAfterMask = 0x2;\nuint256 constant BulkOrderProof_keyShift = 0xe8;\nuint256 constant BulkOrderProof_keySize = 0x3;\n\nuint256 constant BulkOrder_Typehash_Height_One =\n    (0x3ca2711d29384747a8f61d60aad3c450405f7aaff5613541dee28df2d6986d32);\nuint256 constant BulkOrder_Typehash_Height_Two =\n    (0xbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde30);\nuint256 constant BulkOrder_Typehash_Height_Three =\n    (0x53c6f6856e13104584dd0797ca2b2779202dc2597c6066a42e0d8fe990b0024d);\nuint256 constant BulkOrder_Typehash_Height_Four =\n    (0xa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af1);\nuint256 constant BulkOrder_Typehash_Height_Five =\n    (0x39c9d33c18e050dda0aeb9a8086fb16fc12d5d64536780e1da7405a800b0b9f6);\nuint256 constant BulkOrder_Typehash_Height_Six =\n    (0x1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b55);\nuint256 constant BulkOrder_Typehash_Height_Seven =\n    (0xca74fab2fece9a1d58234a274220ad05ca096a92ef6a1ca1750b9d90c948955c);\nuint256 constant BulkOrder_Typehash_Height_Eight =\n    (0x7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc14);\nuint256 constant BulkOrder_Typehash_Height_Nine =\n    (0xbed7be92d41c56f9e59ac7a6272185299b815ddfabc3f25deb51fe55fe2f9e8a);\nuint256 constant BulkOrder_Typehash_Height_Ten =\n    (0xd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da05);\nuint256 constant BulkOrder_Typehash_Height_Eleven =\n    (0x896c3f349c4da741c19b37fec49ed2e44d738e775a21d9c9860a69d67a3dae53);\nuint256 constant BulkOrder_Typehash_Height_Twelve =\n    (0xbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f);\nuint256 constant BulkOrder_Typehash_Height_Thirteen =\n    (0xe6ae19322608dd1f8a8d56aab48ed9c28be489b689f4b6c91268563efc85f20e);\nuint256 constant BulkOrder_Typehash_Height_Fourteen =\n    (0x6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a852590);\nuint256 constant BulkOrder_Typehash_Height_Fifteen =\n    (0xd1eb68309202b7106b891e109739dbbd334a1817fe5d6202c939e75cf5e35ca9);\nuint256 constant BulkOrder_Typehash_Height_Sixteen =\n    (0x1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde8);\nuint256 constant BulkOrder_Typehash_Height_Seventeen =\n    (0xeee9a1392aa395c7002308119a58f2582777a75e54e0c1d5d5437bd2e8bf6222);\nuint256 constant BulkOrder_Typehash_Height_Eighteen =\n    (0xc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d85877);\nuint256 constant BulkOrder_Typehash_Height_Nineteen =\n    (0x0efca7572ac20f5ae84db0e2940674f7eca0a4726fa1060ffc2d18cef54b203d);\nuint256 constant BulkOrder_Typehash_Height_Twenty =\n    (0x5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e64350017);\nuint256 constant BulkOrder_Typehash_Height_TwentyOne =\n    (0x80987079d291feebf21c2230e69add0f283cee0b8be492ca8050b4185a2ff719);\nuint256 constant BulkOrder_Typehash_Height_TwentyTwo =\n    (0x3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d);\nuint256 constant BulkOrder_Typehash_Height_TwentyThree =\n    (0x5d6a3f098a0bc373f808c619b1bb4028208721b3c4f8d6bc8a874d659814eb76);\nuint256 constant BulkOrder_Typehash_Height_TwentyFour =\n    (0x1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c);\n\nuint256 constant receivedItemsHash_ptr = 0x60;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  data for OrderFulfilled\n *\n *   event OrderFulfilled(\n *     bytes32 orderHash,\n *     address indexed offerer,\n *     address indexed zone,\n *     address fulfiller,\n *     SpentItem[] offer,\n *       > (itemType, token, id, amount)\n *     ReceivedItem[] consideration\n *       > (itemType, token, id, amount, recipient)\n *   )\n *\n *  - 0x00: orderHash\n *  - 0x20: fulfiller\n *  - 0x40: offer offset (0x80)\n *  - 0x60: consideration offset (0x120)\n *  - 0x80: offer.length (1)\n *  - 0xa0: offerItemType\n *  - 0xc0: offerToken\n *  - 0xe0: offerIdentifier\n *  - 0x100: offerAmount\n *  - 0x120: consideration.length (1 + additionalRecipients.length)\n *  - 0x140: considerationItemType\n *  - 0x160: considerationToken\n *  - 0x180: considerationIdentifier\n *  - 0x1a0: considerationAmount\n *  - 0x1c0: considerationRecipient\n *  - ...\n */\n\n// Minimum length of the OrderFulfilled event data.\n// Must be added to the size of the ReceivedItem array for additionalRecipients\n// (0xa0 * additionalRecipients.length) to calculate full size of the buffer.\nuint256 constant OrderFulfilled_baseSize = 0x1e0;\nuint256 constant OrderFulfilled_selector =\n    (0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31);\n\n// Minimum offset in memory to OrderFulfilled event data.\n// Must be added to the size of the EIP712 hash array for additionalRecipients\n// (32 * additionalRecipients.length) to calculate the pointer to event data.\nuint256 constant OrderFulfilled_baseOffset = 0x180;\nuint256 constant OrderFulfilled_consideration_length_baseOffset = 0x2a0;\nuint256 constant OrderFulfilled_offer_length_baseOffset = 0x200;\n\nuint256 constant OrderFulfilled_offer_length_offset_relativeTo_baseOffset = (\n    0x80\n);\nuint256 constant OrderFulfilled_offer_itemType_offset_relativeTo_baseOffset = (\n    0xa0\n);\nuint256 constant OrderFulfilled_offer_token_offset_relativeTo_baseOffset = 0xc0;\n\n// Related constants used for restricted order checks on basic orders.\nuint256 constant OrderFulfilled_baseDataSize = 0x160;\n// uint256 constant ValidateOrder_offerDataOffset = 0x184;\n// uint256 constant RatifyOrder_offerDataOffset = 0xc4;\n\n// uint256 constant OrderFulfilled_orderHash_offset = 0x00;\nuint256 constant OrderFulfilled_fulfiller_offset = 0x20;\nuint256 constant OrderFulfilled_offer_head_offset = 0x40;\nuint256 constant OrderFulfilled_offer_body_offset = 0x80;\nuint256 constant OrderFulfilled_consideration_head_offset = 0x60;\nuint256 constant OrderFulfilled_consideration_body_offset = 0x120;\n\n/*\n * 3 memory slots/words for `authorizeOrder` and `validateOrder` calldata\n * to be used for tails of extra data (length 0) and order hashes (length 1)\n */\nuint256 constant OrderFulfilled_post_memory_region_reservedBytes = 0x60;\n\n/*\n * OrderFulfilled_offer_length_baseOffset - 12 * 0x20\n * we back up 12 words from where the `OrderFulfilled`'s data\n * for spent items start to be rewritten for `authorizeOrder`\n * and `validateOrder`. Let the reference pointer be `ptr`\n * pointing to the `OrderFulfilled`'s spent item array's length memory\n * position then we would have:\n *\n * ptr - 0x0180 : zero-padded calldata selector\n * ptr - 0x0160 : ZoneParameter's struct head (0x20)\n * ptr - 0x0140 : order hash\n * ptr - 0x0120 : fulfiller (msg.sender)\n * ptr - 0x0100 : offerer\n * ptr - 0x00e0 : spent items' head\n * ptr - 0x00c0 : received items' head\n * ptr - 0x00a0 : extra data / context head\n * ptr - 0x0080 : order hashes head\n * ptr - 0x0060 : start time\n * ptr - 0x0040 : end time\n * ptr - 0x0020 : zone hash\n * ptr - 0x0000 : offer.length (1)\n * ...\n *\n * Note that the padded calldata selector will be at minimum at the\n * 0x80 memory slot.\n */\nuint256 constant authorizeOrder_calldata_baseOffset = (\n    OrderFulfilled_offer_length_baseOffset - 0x180\n);\n\n// BasicOrderParameters\nuint256 constant BasicOrder_parameters_cdPtr = 0x04;\nuint256 constant BasicOrder_considerationToken_cdPtr = 0x24;\nuint256 constant BasicOrder_considerationIdentifier_cdPtr = 0x44;\nuint256 constant BasicOrder_considerationAmount_cdPtr = 0x64;\nuint256 constant BasicOrder_offerer_cdPtr = 0x84;\nuint256 constant BasicOrder_zone_cdPtr = 0xa4;\nuint256 constant BasicOrder_offerToken_cdPtr = 0xc4;\nuint256 constant BasicOrder_offerIdentifier_cdPtr = 0xe4;\nuint256 constant BasicOrder_offerAmount_cdPtr = 0x104;\nuint256 constant BasicOrder_basicOrderParameters_cd_offset = 0x24;\nuint256 constant BasicOrder_basicOrderType_cdPtr = 0x124;\nuint256 constant BasicOrder_startTime_cdPtr = 0x144;\nuint256 constant BasicOrder_endTime_cdPtr = 0x164;\n// uint256 constant BasicOrder_zoneHash_cdPtr = 0x184;\n// uint256 constant BasicOrder_salt_cdPtr = 0x1a4;\nuint256 constant BasicOrder_offererConduit_cdPtr = 0x1c4;\nuint256 constant BasicOrder_fulfillerConduit_cdPtr = 0x1e4;\nuint256 constant BasicOrder_totalOriginalAdditionalRecipients_cdPtr = 0x204;\nuint256 constant BasicOrder_additionalRecipients_head_cdPtr = 0x224;\nuint256 constant BasicOrder_signature_cdPtr = 0x244;\nuint256 constant BasicOrder_additionalRecipients_length_cdPtr = 0x264;\nuint256 constant BasicOrder_addlRecipients_length_cdPtr = 0x264;\nuint256 constant BasicOrder_additionalRecipients_data_cdPtr = 0x284;\nuint256 constant BasicOrder_parameters_ptr = 0x20;\nuint256 constant BasicOrder_basicOrderType_range = 0x18; // 24 values\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for ConsiderationItem\n *   - 0x80: ConsiderationItem EIP-712 typehash (constant)\n *   - 0xa0: itemType\n *   - 0xc0: token\n *   - 0xe0: identifier\n *   - 0x100: startAmount\n *   - 0x120: endAmount\n *   - 0x140: recipient\n */\nuint256 constant BasicOrder_considerationItem_typeHash_ptr = 0x80; // memoryPtr\nuint256 constant BasicOrder_considerationItem_itemType_ptr = 0xa0;\nuint256 constant BasicOrder_considerationItem_token_ptr = 0xc0;\nuint256 constant BasicOrder_considerationItem_identifier_ptr = 0xe0;\nuint256 constant BasicOrder_considerationItem_startAmount_ptr = 0x100;\nuint256 constant BasicOrder_considerationItem_endAmount_ptr = 0x120;\n// uint256 constant BasicOrder_considerationItem_recipient_ptr = 0x140;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for OfferItem\n *   - 0x80:  OfferItem EIP-712 typehash (constant)\n *   - 0xa0:  itemType\n *   - 0xc0:  token\n *   - 0xe0:  identifier (reused for offeredItemsHash)\n *   - 0x100: startAmount\n *   - 0x120: endAmount\n */\nuint256 constant BasicOrder_offerItem_typeHash_ptr = 0x80;\nuint256 constant BasicOrder_offerItem_itemType_ptr = 0xa0;\nuint256 constant BasicOrder_offerItem_token_ptr = 0xc0;\n// uint256 constant BasicOrder_offerItem_identifier_ptr = 0xe0;\n// uint256 constant BasicOrder_offerItem_startAmount_ptr = 0x100;\nuint256 constant BasicOrder_offerItem_endAmount_ptr = 0x120;\n\n/*\n *  Memory layout in _prepareBasicFulfillmentFromCalldata of\n *  EIP712 data for Order\n *   - 0x80:   Order EIP-712 typehash (constant)\n *   - 0xa0:   orderParameters.offerer\n *   - 0xc0:   orderParameters.zone\n *   - 0xe0:   keccak256(abi.encodePacked(offerHashes))\n *   - 0x100:  keccak256(abi.encodePacked(considerationHashes))\n *   - 0x120:  orderType\n *   - 0x140:  startTime\n *   - 0x160:  endTime\n *   - 0x180:  zoneHash\n *   - 0x1a0:  salt\n *   - 0x1c0:  conduit\n *   - 0x1e0:  _counters[orderParameters.offerer] (from storage)\n */\nuint256 constant BasicOrder_order_typeHash_ptr = 0x80;\nuint256 constant BasicOrder_order_offerer_ptr = 0xa0;\n// uint256 constant BasicOrder_order_zone_ptr = 0xc0;\nuint256 constant BasicOrder_order_offerHashes_ptr = 0xe0;\nuint256 constant BasicOrder_order_considerationHashes_ptr = 0x100;\nuint256 constant BasicOrder_order_orderType_ptr = 0x120;\nuint256 constant BasicOrder_order_startTime_ptr = 0x140;\n// uint256 constant BasicOrder_order_endTime_ptr = 0x160;\n// uint256 constant BasicOrder_order_zoneHash_ptr = 0x180;\n// uint256 constant BasicOrder_order_salt_ptr = 0x1a0;\n// uint256 constant BasicOrder_order_conduitKey_ptr = 0x1c0;\nuint256 constant BasicOrder_order_counter_ptr = 0x1e0;\nuint256 constant BasicOrder_additionalRecipients_head_ptr = 0x240;\nuint256 constant BasicOrder_signature_ptr = 0x260;\nuint256 constant BasicOrder_startTimeThroughZoneHash_size = 0x60;\n\nuint256 constant ContractOrder_orderHash_offerer_shift = 0x60;\n\nuint256 constant Counter_blockhash_shift = 0x80;\n\n// Signature-related\nbytes32 constant EIP2098_allButHighestBitMask =\n    (0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\nbytes32 constant ECDSA_twentySeventhAndTwentyEighthBytesSet =\n    (0x0000000000000000000000000000000000000000000000000000000101000000);\nuint256 constant ECDSA_MaxLength = 65;\nuint256 constant ECDSA_signature_s_offset = 0x40;\nuint256 constant ECDSA_signature_v_offset = 0x60;\n\nbytes32 constant EIP1271_isValidSignature_selector =\n    (0x1626ba7e00000000000000000000000000000000000000000000000000000000);\nuint256 constant EIP1271_isValidSignature_digest_negativeOffset = 0x40;\nuint256 constant EIP1271_isValidSignature_selector_negativeOffset = 0x44;\nuint256 constant EIP1271_isValidSignature_calldata_baseLength = 0x64;\nuint256 constant EIP1271_isValidSignature_signature_head_offset = 0x40;\n\nuint256 constant EIP_712_PREFIX =\n    (0x1901000000000000000000000000000000000000000000000000000000000000);\n\nuint256 constant ExtraGasBuffer = 0x20;\nuint256 constant CostPerWord = 0x3;\nuint256 constant MemoryExpansionCoefficientShift = 0x9;\n\nuint256 constant Create2AddressDerivation_ptr = 0x0b;\nuint256 constant Create2AddressDerivation_length = 0x55;\n\nuint256 constant MaskOverByteTwelve =\n    (0x0000000000000000000000ff0000000000000000000000000000000000000000);\nuint256 constant MaskOverLastTwentyBytes =\n    (0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff);\nuint256 constant AddressDirtyUpperBitThreshold =\n    (0x0000000000000000000000010000000000000000000000000000000000000000);\nuint256 constant MaskOverFirstFourBytes =\n    (0xffffffff00000000000000000000000000000000000000000000000000000000);\n\nuint256 constant Conduit_execute_signature =\n    (0x4ce34aa200000000000000000000000000000000000000000000000000000000);\n\nuint256 constant MaxUint8 = 0xff;\nuint256 constant MaxUint120 = 0xffffffffffffffffffffffffffffff;\n\nuint256 constant Conduit_execute_ConduitTransfer_ptr = 0x20;\nuint256 constant Conduit_execute_ConduitTransfer_length = 0x01;\nuint256 constant Conduit_execute_ConduitTransfer_offset_ptr = 0x04;\nuint256 constant Conduit_execute_ConduitTransfer_length_ptr = 0x24;\nuint256 constant Conduit_execute_transferItemType_ptr = 0x44;\nuint256 constant Conduit_execute_transferToken_ptr = 0x64;\nuint256 constant Conduit_execute_transferFrom_ptr = 0x84;\nuint256 constant Conduit_execute_transferTo_ptr = 0xa4;\nuint256 constant Conduit_execute_transferIdentifier_ptr = 0xc4;\nuint256 constant Conduit_execute_transferAmount_ptr = 0xe4;\n\nuint256 constant OneConduitExecute_size = 0x104;\n\n// Sentinel value to indicate that the conduit accumulator is not armed.\nuint256 constant AccumulatorDisarmed = 0x20;\nuint256 constant AccumulatorArmed = 0x40;\nuint256 constant Accumulator_conduitKey_ptr = 0x20;\nuint256 constant Accumulator_selector_ptr = 0x40;\nuint256 constant Accumulator_array_offset_ptr = 0x44;\nuint256 constant Accumulator_array_length_ptr = 0x64;\nuint256 constant Accumulator_itemSizeOffsetDifference = 0x3c;\nuint256 constant Accumulator_array_offset = 0x20;\n\nuint256 constant Conduit_transferItem_size = 0xc0;\nuint256 constant Conduit_transferItem_token_ptr = 0x20;\nuint256 constant Conduit_transferItem_from_ptr = 0x40;\nuint256 constant Conduit_transferItem_to_ptr = 0x60;\nuint256 constant Conduit_transferItem_identifier_ptr = 0x80;\nuint256 constant Conduit_transferItem_amount_ptr = 0xa0;\n\nuint256 constant Ecrecover_precompile = 0x1;\nuint256 constant Ecrecover_args_size = 0x80;\nuint256 constant Signature_lower_v = 27;\n\n// Bitmask that only gives a non-zero value if masked with a non-match selector.\nuint256 constant NonMatchSelector_MagicMask =\n    (0x4000000000000000000000000000000000000000000000000000000000);\n\n// First bit indicates that a NATIVE offer items has been used and the 231st bit\n// indicates that a non match selector has been called.\nuint256 constant NonMatchSelector_InvalidErrorValue =\n    (0x4000000000000000000000000000000000000000000000000000000001);\n\n/**\n * @dev Selector and offsets for generateOrder\n *\n * function generateOrder(\n *   address fulfiller,\n *   SpentItem[] calldata minimumReceived,\n *   SpentItem[] calldata maximumSpent,\n *   bytes calldata context\n * )\n */\nuint256 constant generateOrder_selector = 0x98919765;\nuint256 constant generateOrder_selector_offset = 0x1c;\nuint256 constant generateOrder_head_offset = 0x04;\nuint256 constant generateOrder_minimumReceived_head_offset = 0x20;\nuint256 constant generateOrder_maximumSpent_head_offset = 0x40;\nuint256 constant generateOrder_context_head_offset = 0x60;\nuint256 constant generateOrder_base_tail_offset = 0x80;\nuint256 constant generateOrder_maximum_returned_array_length = 0xffff;\n\nuint256 constant ratifyOrder_selector = 0xf4dd92ce;\nuint256 constant ratifyOrder_selector_offset = 0x1c;\nuint256 constant ratifyOrder_head_offset = 0x04;\n// uint256 constant ratifyOrder_offer_head_offset = 0x00;\nuint256 constant ratifyOrder_consideration_head_offset = 0x20;\nuint256 constant ratifyOrder_context_head_offset = 0x40;\nuint256 constant ratifyOrder_orderHashes_head_offset = 0x60;\nuint256 constant ratifyOrder_contractNonce_offset = 0x80;\nuint256 constant ratifyOrder_base_tail_offset = 0xa0;\n\nuint256 constant validateOrder_selector = 0x17b1f942;\nuint256 constant validateOrder_selector_offset = 0x1c;\nuint256 constant validateOrder_head_offset = 0x04;\nuint256 constant validateOrder_zoneParameters_offset = 0x20;\n\nuint256 constant authorizeOrder_selector = 0x01e4d72a;\nuint256 constant authorizeOrder_selector_offset = 0x1c;\nuint256 constant authorizeOrder_head_offset = 0x04;\nuint256 constant authorizeOrder_zoneParameters_offset = 0x20;\n\n// uint256 constant ZoneParameters_orderHash_offset = 0x00;\nuint256 constant ZoneParameters_fulfiller_offset = 0x20;\nuint256 constant ZoneParameters_offerer_offset = 0x40;\nuint256 constant ZoneParameters_offer_head_offset = 0x60;\nuint256 constant ZoneParameters_consideration_head_offset = 0x80;\nuint256 constant ZoneParameters_extraData_head_offset = 0xa0;\nuint256 constant ZoneParameters_orderHashes_head_offset = 0xc0;\nuint256 constant ZoneParameters_startTime_offset = 0xe0;\nuint256 constant ZoneParameters_endTime_offset = 0x100;\nuint256 constant ZoneParameters_zoneHash_offset = 0x120;\nuint256 constant ZoneParameters_base_tail_offset = 0x140;\nuint256 constant ZoneParameters_selectorAndPointer_length = 0x24;\nuint256 constant ZoneParameters_basicOrderFixedElements_length = 0x44;\n\n// ConsiderationDecoder Constants\nuint256 constant OrderParameters_head_size = 0x0160;\nuint256 constant OrderParameters_totalOriginalConsiderationItems_offset = (\n    0x0140\n);\nuint256 constant AdvancedOrderPlusOrderParameters_head_size = 0x0200;\n\nuint256 constant Order_signature_offset = 0x20;\nuint256 constant Order_head_size = 0x40;\n\nuint256 constant AdvancedOrder_fixed_segment_0 = 0x40;\n\nuint256 constant CriteriaResolver_head_size = 0xa0;\nuint256 constant CriteriaResolver_fixed_segment_0 = 0x80;\nuint256 constant CriteriaResolver_criteriaProof_offset = 0x80;\n\nuint256 constant FulfillmentComponent_mem_tail_size = 0x40;\nuint256 constant FulfillmentComponent_mem_tail_size_shift = 0x6;\nuint256 constant Fulfillment_head_size = 0x40;\nuint256 constant Fulfillment_considerationComponents_offset = 0x20;\n\nuint256 constant OrderComponents_OrderParameters_common_head_size = 0x0140;\n"},"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"},"seaport-types/src/lib/ConsiderationErrorConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nuint256 constant Error_selector_offset = 0x1c;\n\n/*\n *  error MissingFulfillmentComponentOnAggregation(uint8 side)\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: side\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant MissingFulfillmentComponentOnAggregation_error_selector = (\n    0x375c24c1\n);\nuint256 constant MissingFulfillmentComponentOnAggregation_error_side_ptr = 0x20;\nuint256 constant MissingFulfillmentComponentOnAggregation_error_length = 0x24;\n\n/*\n *  error OfferAndConsiderationRequiredOnFulfillment()\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant OfferAndConsiderationRequiredOnFulfillment_error_selector = (\n    0x98e9db6e\n);\nuint256 constant OfferAndConsiderationRequiredOnFulfillment_error_length = 0x04;\n\n/*\n *  error MismatchedFulfillmentOfferAndConsiderationComponents(\n *      uint256 fulfillmentIndex\n *  )\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: fulfillmentIndex\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant MismatchedOfferAndConsiderationComponents_error_selector = (\n    0xbced929d\n);\nuint256 constant MismatchedOfferAndConsiderationComponents_error_idx_ptr = 0x20;\nuint256 constant MismatchedOfferAndConsiderationComponents_error_length = 0x24;\n\n/*\n *  error InvalidFulfillmentComponentData()\n *    - Defined in FulfillmentApplicationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidFulfillmentComponentData_error_selector = 0x7fda7279;\nuint256 constant InvalidFulfillmentComponentData_error_length = 0x04;\n\n/*\n *  error InexactFraction()\n *    - Defined in AmountDerivationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InexactFraction_error_selector = 0xc63cf089;\nuint256 constant InexactFraction_error_length = 0x04;\n\n/*\n *  error OrderCriteriaResolverOutOfRange(uint8 side)\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: side\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderCriteriaResolverOutOfRange_error_selector = 0x133c37c6;\nuint256 constant OrderCriteriaResolverOutOfRange_error_side_ptr = 0x20;\nuint256 constant OrderCriteriaResolverOutOfRange_error_length = 0x24;\n\n/*\n *  error UnresolvedOfferCriteria(uint256 orderIndex, uint256 offerIndex)\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: offerIndex\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant UnresolvedOfferCriteria_error_selector = 0xd6929332;\nuint256 constant UnresolvedOfferCriteria_error_orderIndex_ptr = 0x20;\nuint256 constant UnresolvedOfferCriteria_error_offerIndex_ptr = 0x40;\nuint256 constant UnresolvedOfferCriteria_error_length = 0x44;\n\n/*\n *  error UnresolvedConsiderationCriteria(\n *      uint256 orderIndex,\n *      uint256 considerationIndex\n *  )\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: considerationIndex\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant UnresolvedConsiderationCriteria_error_selector = 0xa8930e9a;\nuint256 constant UnresolvedConsiderationCriteria_error_orderIndex_ptr = 0x20;\nuint256 constant UnresolvedConsiderationCriteria_error_itemIndex_ptr = 0x40;\nuint256 constant UnresolvedConsiderationCriteria_error_length = 0x44;\n\n/*\n *  error OfferCriteriaResolverOutOfRange()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant OfferCriteriaResolverOutOfRange_error_selector = 0xbfb3f8ce;\n// uint256 constant OfferCriteriaResolverOutOfRange_error_length = 0x04;\n\n/*\n *  error ConsiderationCriteriaResolverOutOfRange()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant ConsiderationCriteriaResolverOutOfRange_error_selector = (\n    0x6088d7de\n);\nuint256 constant ConsiderationCriteriaResolverOutOfRange_err_selector = (\n    0x6088d7de\n);\n// uint256 constant ConsiderationCriteriaResolverOutOfRange_error_length = 0x04;\n\n/*\n *  error CriteriaNotEnabledForItem()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant CriteriaNotEnabledForItem_error_selector = 0x94eb6af6;\nuint256 constant CriteriaNotEnabledForItem_error_length = 0x04;\n\n/*\n *  error InvalidProof()\n *    - Defined in CriteriaResolutionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidProof_error_selector = 0x09bde339;\nuint256 constant InvalidProof_error_length = 0x04;\n\n/*\n *  error InvalidRestrictedOrder(bytes32 orderHash)\n *    - Defined in ZoneInteractionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidRestrictedOrder_error_selector = 0xfb5014fc;\nuint256 constant InvalidRestrictedOrder_error_orderHash_ptr = 0x20;\nuint256 constant InvalidRestrictedOrder_error_length = 0x24;\n\n/*\n *  error InvalidContractOrder(bytes32 orderHash)\n *    - Defined in ZoneInteractionErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidContractOrder_error_selector = 0x93979285;\nuint256 constant InvalidContractOrder_error_orderHash_ptr = 0x20;\nuint256 constant InvalidContractOrder_error_length = 0x24;\n\n/*\n *  error BadSignatureV(uint8 v)\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: v\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant BadSignatureV_error_selector = 0x1f003d0a;\nuint256 constant BadSignatureV_error_v_ptr = 0x20;\nuint256 constant BadSignatureV_error_length = 0x24;\n\n/*\n *  error InvalidSigner()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidSigner_error_selector = 0x815e1d64;\nuint256 constant InvalidSigner_error_length = 0x04;\n\n/*\n *  error InvalidSignature()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidSignature_error_selector = 0x8baa579f;\nuint256 constant InvalidSignature_error_length = 0x04;\n\n/*\n *  error BadContractSignature()\n *    - Defined in SignatureVerificationErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant BadContractSignature_error_selector = 0x4f7fb80d;\nuint256 constant BadContractSignature_error_length = 0x04;\n\n/*\n *  error InvalidERC721TransferAmount(uint256 amount)\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: amount\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidERC721TransferAmount_error_selector = 0x69f95827;\nuint256 constant InvalidERC721TransferAmount_error_amount_ptr = 0x20;\nuint256 constant InvalidERC721TransferAmount_error_length = 0x24;\n\n/*\n *  error MissingItemAmount()\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant MissingItemAmount_error_selector = 0x91b3e514;\nuint256 constant MissingItemAmount_error_length = 0x04;\n\n/*\n *  error UnusedItemParameters()\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant UnusedItemParameters_error_selector = 0x6ab37ce7;\nuint256 constant UnusedItemParameters_error_length = 0x04;\n\n/*\n *  error NoReentrantCalls()\n *    - Defined in ReentrancyErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant NoReentrantCalls_error_selector = 0x7fa8a987;\nuint256 constant NoReentrantCalls_error_length = 0x04;\n\n/*\n *  error OrderAlreadyFilled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderAlreadyFilled_error_selector = 0x10fda3e1;\nuint256 constant OrderAlreadyFilled_error_orderHash_ptr = 0x20;\nuint256 constant OrderAlreadyFilled_error_length = 0x24;\n\n/*\n *  error InvalidTime(uint256 startTime, uint256 endTime)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: startTime\n *    - 0x40: endTime\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant InvalidTime_error_selector = 0x21ccfeb7;\nuint256 constant InvalidTime_error_startTime_ptr = 0x20;\nuint256 constant InvalidTime_error_endTime_ptr = 0x40;\nuint256 constant InvalidTime_error_length = 0x44;\n\n/*\n *  error InvalidConduit(bytes32 conduitKey, address conduit)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: conduitKey\n *    - 0x40: conduit\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant InvalidConduit_error_selector = 0x1cf99b26;\nuint256 constant InvalidConduit_error_conduitKey_ptr = 0x20;\nuint256 constant InvalidConduit_error_conduit_ptr = 0x40;\nuint256 constant InvalidConduit_error_length = 0x44;\n\n/*\n *  error MissingOriginalConsiderationItems()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant MissingOriginalConsiderationItems_error_selector = 0x466aa616;\nuint256 constant MissingOriginalConsiderationItems_error_length = 0x04;\n\n/*\n *  error InvalidCallToConduit(address conduit)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: conduit\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidCallToConduit_error_selector = 0xd13d53d4;\nuint256 constant InvalidCallToConduit_error_conduit_ptr = 0x20;\nuint256 constant InvalidCallToConduit_error_length = 0x24;\n\n/*\n *  error ConsiderationNotMet(\n *      uint256 orderIndex,\n *      uint256 considerationIndex,\n *      uint256 shortfallAmount\n *  )\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderIndex\n *    - 0x40: considerationIndex\n *    - 0x60: shortfallAmount\n * Revert buffer is memory[0x1c:0x80]\n */\nuint256 constant ConsiderationNotMet_error_selector = 0xa5f54208;\nuint256 constant ConsiderationNotMet_error_orderIndex_ptr = 0x20;\nuint256 constant ConsiderationNotMet_error_considerationIndex_ptr = 0x40;\nuint256 constant ConsiderationNotMet_error_shortfallAmount_ptr = 0x60;\nuint256 constant ConsiderationNotMet_error_length = 0x64;\n\n/*\n *  error InsufficientNativeTokensSupplied()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InsufficientNativeTokensSupplied_error_selector = 0x8ffff980;\nuint256 constant InsufficientNativeTokensSupplied_error_length = 0x04;\n\n/*\n *  error NativeTokenTransferGenericFailure(address account, uint256 amount)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: account\n *    - 0x40: amount\n * Revert buffer is memory[0x1c:0x60]\n */\nuint256 constant NativeTokenTransferGenericFailure_error_selector = 0xbc806b96;\nuint256 constant NativeTokenTransferGenericFailure_error_account_ptr = 0x20;\nuint256 constant NativeTokenTransferGenericFailure_error_amount_ptr = 0x40;\nuint256 constant NativeTokenTransferGenericFailure_error_length = 0x44;\n\n/*\n *  error PartialFillsNotEnabledForOrder()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant PartialFillsNotEnabledForOrder_error_selector = 0xa11b63ff;\nuint256 constant PartialFillsNotEnabledForOrder_error_length = 0x04;\n\n/*\n *  error OrderIsCancelled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderIsCancelled_error_selector = 0x1a515574;\nuint256 constant OrderIsCancelled_error_orderHash_ptr = 0x20;\nuint256 constant OrderIsCancelled_error_length = 0x24;\n\n/*\n *  error OrderPartiallyFilled(bytes32 orderHash)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: orderHash\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant OrderPartiallyFilled_error_selector = 0xee9e0e63;\nuint256 constant OrderPartiallyFilled_error_orderHash_ptr = 0x20;\nuint256 constant OrderPartiallyFilled_error_length = 0x24;\n\n/*\n *  error CannotCancelOrder()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant CannotCancelOrder_error_selector = 0xfed398fc;\nuint256 constant CannotCancelOrder_error_length = 0x04;\n\n/*\n *  error BadFraction()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant BadFraction_error_selector = 0x5a052b32;\nuint256 constant BadFraction_error_length = 0x04;\n\n/*\n *  error InvalidMsgValue(uint256 value)\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: value\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant InvalidMsgValue_error_selector = 0xa61be9f0;\nuint256 constant InvalidMsgValue_error_value_ptr = 0x20;\nuint256 constant InvalidMsgValue_error_length = 0x24;\n\n/*\n *  error InvalidBasicOrderParameterEncoding()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidBasicOrderParameterEncoding_error_selector = 0x39f3e3fd;\nuint256 constant InvalidBasicOrderParameterEncoding_error_length = 0x04;\n\n/*\n *  error NoSpecifiedOrdersAvailable()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant NoSpecifiedOrdersAvailable_error_selector = 0xd5da9a1b;\nuint256 constant NoSpecifiedOrdersAvailable_error_length = 0x04;\n\n/*\n *  error InvalidNativeOfferItem()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant InvalidNativeOfferItem_error_selector = 0x12d3f5a3;\nuint256 constant InvalidNativeOfferItem_error_length = 0x04;\n\n/*\n *  error ConsiderationLengthNotEqualToTotalOriginal()\n *    - Defined in ConsiderationEventsAndErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n * Revert buffer is memory[0x1c:0x20]\n */\nuint256 constant ConsiderationLengthNotEqualToTotalOriginal_error_selector = (\n    0x2165628a\n);\nuint256 constant ConsiderationLengthNotEqualToTotalOriginal_error_length = 0x04;\n\n/*\n *  error Panic(uint256 code)\n *    - Built-in Solidity error\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: code\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant Panic_error_selector = 0x4e487b71;\nuint256 constant Panic_error_code_ptr = 0x20;\nuint256 constant Panic_error_length = 0x24;\n\nuint256 constant Panic_arithmetic = 0x11;\n// uint256 constant Panic_resource = 0x41;\n"},"seaport-types/src/lib/ConsiderationErrors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport { Side } from \"./ConsiderationEnums.sol\";\n\nimport {\n    BadFraction_error_length,\n    BadFraction_error_selector,\n    CannotCancelOrder_error_length,\n    CannotCancelOrder_error_selector,\n    ConsiderationLengthNotEqualToTotalOriginal_error_length,\n    ConsiderationLengthNotEqualToTotalOriginal_error_selector,\n    ConsiderationNotMet_error_considerationIndex_ptr,\n    ConsiderationNotMet_error_length,\n    ConsiderationNotMet_error_orderIndex_ptr,\n    ConsiderationNotMet_error_selector,\n    ConsiderationNotMet_error_shortfallAmount_ptr,\n    CriteriaNotEnabledForItem_error_length,\n    CriteriaNotEnabledForItem_error_selector,\n    Error_selector_offset,\n    InsufficientNativeTokensSupplied_error_length,\n    InsufficientNativeTokensSupplied_error_selector,\n    InvalidBasicOrderParameterEncoding_error_length,\n    InvalidBasicOrderParameterEncoding_error_selector,\n    InvalidCallToConduit_error_conduit_ptr,\n    InvalidCallToConduit_error_length,\n    InvalidCallToConduit_error_selector,\n    InvalidConduit_error_conduit_ptr,\n    InvalidConduit_error_conduitKey_ptr,\n    InvalidConduit_error_length,\n    InvalidConduit_error_selector,\n    InvalidContractOrder_error_length,\n    InvalidContractOrder_error_orderHash_ptr,\n    InvalidContractOrder_error_selector,\n    InvalidERC721TransferAmount_error_amount_ptr,\n    InvalidERC721TransferAmount_error_length,\n    InvalidERC721TransferAmount_error_selector,\n    InvalidMsgValue_error_length,\n    InvalidMsgValue_error_selector,\n    InvalidMsgValue_error_value_ptr,\n    InvalidNativeOfferItem_error_length,\n    InvalidNativeOfferItem_error_selector,\n    InvalidProof_error_length,\n    InvalidProof_error_selector,\n    InvalidTime_error_endTime_ptr,\n    InvalidTime_error_length,\n    InvalidTime_error_selector,\n    InvalidTime_error_startTime_ptr,\n    MismatchedOfferAndConsiderationComponents_error_idx_ptr,\n    MismatchedOfferAndConsiderationComponents_error_length,\n    MismatchedOfferAndConsiderationComponents_error_selector,\n    MissingFulfillmentComponentOnAggregation_error_length,\n    MissingFulfillmentComponentOnAggregation_error_selector,\n    MissingFulfillmentComponentOnAggregation_error_side_ptr,\n    MissingOriginalConsiderationItems_error_length,\n    MissingOriginalConsiderationItems_error_selector,\n    NoReentrantCalls_error_length,\n    NoReentrantCalls_error_selector,\n    NoSpecifiedOrdersAvailable_error_length,\n    NoSpecifiedOrdersAvailable_error_selector,\n    OfferAndConsiderationRequiredOnFulfillment_error_length,\n    OfferAndConsiderationRequiredOnFulfillment_error_selector,\n    OrderAlreadyFilled_error_length,\n    OrderAlreadyFilled_error_orderHash_ptr,\n    OrderAlreadyFilled_error_selector,\n    OrderCriteriaResolverOutOfRange_error_length,\n    OrderCriteriaResolverOutOfRange_error_selector,\n    OrderCriteriaResolverOutOfRange_error_side_ptr,\n    OrderIsCancelled_error_length,\n    OrderIsCancelled_error_orderHash_ptr,\n    OrderIsCancelled_error_selector,\n    OrderPartiallyFilled_error_length,\n    OrderPartiallyFilled_error_orderHash_ptr,\n    OrderPartiallyFilled_error_selector,\n    PartialFillsNotEnabledForOrder_error_length,\n    PartialFillsNotEnabledForOrder_error_selector,\n    UnresolvedConsiderationCriteria_error_length,\n    UnresolvedConsiderationCriteria_error_orderIndex_ptr,\n    UnresolvedConsiderationCriteria_error_selector,\n    UnresolvedOfferCriteria_error_length,\n    UnresolvedOfferCriteria_error_offerIndex_ptr,\n    UnresolvedOfferCriteria_error_orderIndex_ptr,\n    UnresolvedOfferCriteria_error_selector,\n    UnusedItemParameters_error_length,\n    UnusedItemParameters_error_selector\n} from \"./ConsiderationErrorConstants.sol\";\n\n/**\n * @dev Reverts the current transaction with a \"BadFraction\" error message.\n */\nfunction _revertBadFraction() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, BadFraction_error_selector)\n\n        // revert(abi.encodeWithSignature(\"BadFraction()\"))\n        revert(Error_selector_offset, BadFraction_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with a \"ConsiderationNotMet\" error\n *      message, including the provided order index, consideration index, and\n *      shortfall amount.\n *\n * @param orderIndex         The index of the order that did not meet the\n *                           consideration criteria.\n * @param considerationIndex The index of the consideration item that did not\n *                           meet its criteria.\n * @param shortfallAmount    The amount by which the consideration criteria were\n *                           not met.\n */\nfunction _revertConsiderationNotMet(\n    uint256 orderIndex,\n    uint256 considerationIndex,\n    uint256 shortfallAmount\n) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, ConsiderationNotMet_error_selector)\n\n        // Store arguments.\n        mstore(ConsiderationNotMet_error_orderIndex_ptr, orderIndex)\n        mstore(\n            ConsiderationNotMet_error_considerationIndex_ptr, considerationIndex\n        )\n        mstore(ConsiderationNotMet_error_shortfallAmount_ptr, shortfallAmount)\n\n        // revert(abi.encodeWithSignature(\n        //     \"ConsiderationNotMet(uint256,uint256,uint256)\",\n        //     orderIndex,\n        //     considerationIndex,\n        //     shortfallAmount\n        // ))\n        revert(Error_selector_offset, ConsiderationNotMet_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with a \"CriteriaNotEnabledForItem\" error\n *      message.\n */\nfunction _revertCriteriaNotEnabledForItem() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, CriteriaNotEnabledForItem_error_selector)\n\n        // revert(abi.encodeWithSignature(\"CriteriaNotEnabledForItem()\"))\n        revert(Error_selector_offset, CriteriaNotEnabledForItem_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an\n *      \"InsufficientNativeTokensSupplied\" error message.\n */\nfunction _revertInsufficientNativeTokensSupplied() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InsufficientNativeTokensSupplied_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InsufficientNativeTokensSupplied()\"))\n        revert(\n            Error_selector_offset, InsufficientNativeTokensSupplied_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an\n *      \"InvalidBasicOrderParameterEncoding\" error message.\n */\nfunction _revertInvalidBasicOrderParameterEncoding() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidBasicOrderParameterEncoding_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidBasicOrderParameterEncoding()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            InvalidBasicOrderParameterEncoding_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidCallToConduit\" error\n *      message, including the provided address of the conduit that was called\n *      improperly.\n *\n * @param conduit The address of the conduit that was called improperly.\n */\nfunction _revertInvalidCallToConduit(address conduit) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidCallToConduit_error_selector)\n\n        // Store argument.\n        mstore(InvalidCallToConduit_error_conduit_ptr, conduit)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidCallToConduit(address)\",\n        //     conduit\n        // ))\n        revert(Error_selector_offset, InvalidCallToConduit_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"CannotCancelOrder\" error\n *      message.\n */\nfunction _revertCannotCancelOrder() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, CannotCancelOrder_error_selector)\n\n        // revert(abi.encodeWithSignature(\"CannotCancelOrder()\"))\n        revert(Error_selector_offset, CannotCancelOrder_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidConduit\" error message,\n *      including the provided key and address of the invalid conduit.\n *\n * @param conduitKey    The key of the invalid conduit.\n * @param conduit       The address of the invalid conduit.\n */\nfunction _revertInvalidConduit(bytes32 conduitKey, address conduit) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidConduit_error_selector)\n\n        // Store arguments.\n        mstore(InvalidConduit_error_conduitKey_ptr, conduitKey)\n        mstore(InvalidConduit_error_conduit_ptr, conduit)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidConduit(bytes32,address)\",\n        //     conduitKey,\n        //     conduit\n        // ))\n        revert(Error_selector_offset, InvalidConduit_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidERC721TransferAmount\"\n *      error message.\n *\n * @param amount The invalid amount.\n */\nfunction _revertInvalidERC721TransferAmount(uint256 amount) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidERC721TransferAmount_error_selector)\n\n        // Store argument.\n        mstore(InvalidERC721TransferAmount_error_amount_ptr, amount)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidERC721TransferAmount(uint256)\",\n        //     amount\n        // ))\n        revert(Error_selector_offset, InvalidERC721TransferAmount_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidMsgValue\" error message,\n *      including the invalid value that was sent in the transaction's\n *      `msg.value` field.\n *\n * @param value The invalid value that was sent in the transaction's `msg.value`\n *              field.\n */\nfunction _revertInvalidMsgValue(uint256 value) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidMsgValue_error_selector)\n\n        // Store argument.\n        mstore(InvalidMsgValue_error_value_ptr, value)\n\n        // revert(abi.encodeWithSignature(\"InvalidMsgValue(uint256)\", value))\n        revert(Error_selector_offset, InvalidMsgValue_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidNativeOfferItem\" error\n *      message.\n */\nfunction _revertInvalidNativeOfferItem() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidNativeOfferItem_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InvalidNativeOfferItem()\"))\n        revert(Error_selector_offset, InvalidNativeOfferItem_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidProof\" error message.\n */\nfunction _revertInvalidProof() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidProof_error_selector)\n\n        // revert(abi.encodeWithSignature(\"InvalidProof()\"))\n        revert(Error_selector_offset, InvalidProof_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidContractOrder\" error\n *      message.\n *\n * @param orderHash The hash of the contract order that caused the error.\n */\nfunction _revertInvalidContractOrder(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidContractOrder_error_selector)\n\n        // Store arguments.\n        mstore(InvalidContractOrder_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidContractOrder(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, InvalidContractOrder_error_length)\n    }\n}\n\n/**\n * @dev Reverts the current transaction with an \"InvalidTime\" error message.\n *\n * @param startTime       The time at which the order becomes active.\n * @param endTime         The time at which the order becomes inactive.\n */\nfunction _revertInvalidTime(uint256 startTime, uint256 endTime) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, InvalidTime_error_selector)\n\n        // Store arguments.\n        mstore(InvalidTime_error_startTime_ptr, startTime)\n        mstore(InvalidTime_error_endTime_ptr, endTime)\n\n        // revert(abi.encodeWithSignature(\n        //     \"InvalidTime(uint256,uint256)\",\n        //     startTime,\n        //     endTime\n        // ))\n        revert(Error_selector_offset, InvalidTime_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"MissingFulfillmentComponentOnAggregation\"\n *       error message.\n *\n * @param side The side of the fulfillment component that is missing (0 for\n *             offer, 1 for consideration).\n *\n */\nfunction _revertMissingFulfillmentComponentOnAggregation(Side side) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, MissingFulfillmentComponentOnAggregation_error_selector)\n\n        // Store argument.\n        mstore(MissingFulfillmentComponentOnAggregation_error_side_ptr, side)\n\n        // revert(abi.encodeWithSignature(\n        //     \"MissingFulfillmentComponentOnAggregation(uint8)\",\n        //     side\n        // ))\n        revert(\n            Error_selector_offset,\n            MissingFulfillmentComponentOnAggregation_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with a \"MissingOriginalConsiderationItems\" error\n *      message.\n */\nfunction _revertMissingOriginalConsiderationItems() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, MissingOriginalConsiderationItems_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"MissingOriginalConsiderationItems()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            MissingOriginalConsiderationItems_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with a \"NoReentrantCalls\" error message.\n */\nfunction _revertNoReentrantCalls() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, NoReentrantCalls_error_selector)\n\n        // revert(abi.encodeWithSignature(\"NoReentrantCalls()\"))\n        revert(Error_selector_offset, NoReentrantCalls_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"NoSpecifiedOrdersAvailable\" error message.\n */\nfunction _revertNoSpecifiedOrdersAvailable() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, NoSpecifiedOrdersAvailable_error_selector)\n\n        // revert(abi.encodeWithSignature(\"NoSpecifiedOrdersAvailable()\"))\n        revert(Error_selector_offset, NoSpecifiedOrdersAvailable_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderAlreadyFilled\" error message.\n *\n * @param orderHash The hash of the order that has already been filled.\n */\nfunction _revertOrderAlreadyFilled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderAlreadyFilled_error_selector)\n\n        // Store argument.\n        mstore(OrderAlreadyFilled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderAlreadyFilled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderAlreadyFilled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderCriteriaResolverOutOfRange\" error\n *      message.\n *\n * @param side The side of the criteria that is missing (0 for offer, 1 for\n *             consideration).\n *\n */\nfunction _revertOrderCriteriaResolverOutOfRange(Side side) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderCriteriaResolverOutOfRange_error_selector)\n\n        // Store argument.\n        mstore(OrderCriteriaResolverOutOfRange_error_side_ptr, side)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderCriteriaResolverOutOfRange(uint8)\",\n        //     side\n        // ))\n        revert(\n            Error_selector_offset, OrderCriteriaResolverOutOfRange_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderIsCancelled\" error message.\n *\n * @param orderHash The hash of the order that has already been cancelled.\n */\nfunction _revertOrderIsCancelled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderIsCancelled_error_selector)\n\n        // Store argument.\n        mstore(OrderIsCancelled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderIsCancelled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderIsCancelled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with an \"OrderPartiallyFilled\" error message.\n *\n * @param orderHash The hash of the order that has already been partially\n *                  filled.\n */\nfunction _revertOrderPartiallyFilled(bytes32 orderHash) pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, OrderPartiallyFilled_error_selector)\n\n        // Store argument.\n        mstore(OrderPartiallyFilled_error_orderHash_ptr, orderHash)\n\n        // revert(abi.encodeWithSignature(\n        //     \"OrderPartiallyFilled(bytes32)\",\n        //     orderHash\n        // ))\n        revert(Error_selector_offset, OrderPartiallyFilled_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"PartialFillsNotEnabledForOrder\" error message.\n */\nfunction _revertPartialFillsNotEnabledForOrder() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, PartialFillsNotEnabledForOrder_error_selector)\n\n        // revert(abi.encodeWithSignature(\"PartialFillsNotEnabledForOrder()\"))\n        revert(\n            Error_selector_offset, PartialFillsNotEnabledForOrder_error_length\n        )\n    }\n}\n\n/**\n * @dev Reverts execution with an \"UnusedItemParameters\" error message.\n */\nfunction _revertUnusedItemParameters() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, UnusedItemParameters_error_selector)\n\n        // revert(abi.encodeWithSignature(\"UnusedItemParameters()\"))\n        revert(Error_selector_offset, UnusedItemParameters_error_length)\n    }\n}\n\n/**\n * @dev Reverts execution with a \"ConsiderationLengthNotEqualToTotalOriginal\"\n *      error message.\n */\nfunction _revertConsiderationLengthNotEqualToTotalOriginal() pure {\n    assembly {\n        // Store left-padded selector with push4 (reduces bytecode),\n        // mem[28:32] = selector\n        mstore(0, ConsiderationLengthNotEqualToTotalOriginal_error_selector)\n\n        // revert(abi.encodeWithSignature(\n        //     \"ConsiderationLengthNotEqualToTotalOriginal()\"\n        // ))\n        revert(\n            Error_selector_offset,\n            ConsiderationLengthNotEqualToTotalOriginal_error_length\n        )\n    }\n}\n"},"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"},"seaport-types/src/lib/TokenTransferrerConstants.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n/*\n * -------------------------- Disambiguation & Other Notes ---------------------\n *    - The term \"head\" is used as it is in the documentation for ABI encoding,\n *      but only in reference to dynamic types, i.e. it always refers to the\n *      offset or pointer to the body of a dynamic type. In calldata, the head\n *      is always an offset (relative to the parent object), while in memory,\n *      the head is always the pointer to the body. More information found here:\n *      https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#argument-encoding\n *        - Note that the length of an array is separate from and precedes the\n *          head of the array.\n *\n *    - The term \"body\" is used in place of the term \"head\" used in the ABI\n *      documentation. It refers to the start of the data for a dynamic type,\n *      e.g. the first word of a struct or the first word of the first element\n *      in an array.\n *\n *    - The term \"pointer\" is used to describe the absolute position of a value\n *      and never an offset relative to another value.\n *        - The suffix \"_ptr\" refers to a memory pointer.\n *        - The suffix \"_cdPtr\" refers to a calldata pointer.\n *\n *    - The term \"offset\" is used to describe the position of a value relative\n *      to some parent value. For example, OrderParameters_conduit_offset is the\n *      offset to the \"conduit\" value in the OrderParameters struct relative to\n *      the start of the body.\n *        - Note: Offsets are used to derive pointers.\n *\n *    - Some structs have pointers defined for all of their fields in this file.\n *      Lines which are commented out are fields that are not used in the\n *      codebase but have been left in for readability.\n */\n\nuint256 constant ThirtyOneBytes = 0x1f;\nuint256 constant OneWord = 0x20;\nuint256 constant TwoWords = 0x40;\nuint256 constant ThreeWords = 0x60;\n\nuint256 constant OneWordShift = 0x5;\nuint256 constant TwoWordsShift = 0x6;\n\nuint256 constant FreeMemoryPointerSlot = 0x40;\nuint256 constant ZeroSlot = 0x60;\nuint256 constant DefaultFreeMemoryPointer = 0x80;\n\nuint256 constant Slot0x80 = 0x80;\nuint256 constant Slot0xA0 = 0xa0;\nuint256 constant Slot0xC0 = 0xc0;\n\nuint256 constant Generic_error_selector_offset = 0x1c;\n\n// abi.encodeWithSignature(\"transferFrom(address,address,uint256)\")\nuint256 constant ERC20_transferFrom_signature = (\n    0x23b872dd00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC20_transferFrom_sig_ptr = 0x0;\nuint256 constant ERC20_transferFrom_from_ptr = 0x04;\nuint256 constant ERC20_transferFrom_to_ptr = 0x24;\nuint256 constant ERC20_transferFrom_amount_ptr = 0x44;\nuint256 constant ERC20_transferFrom_length = 0x64; // 4 + 32 * 3 == 100\n\n// abi.encodeWithSignature(\n//     \"safeTransferFrom(address,address,uint256,uint256,bytes)\"\n// )\nuint256 constant ERC1155_safeTransferFrom_signature = (\n    0xf242432a00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC1155_safeTransferFrom_sig_ptr = 0x0;\nuint256 constant ERC1155_safeTransferFrom_from_ptr = 0x04;\nuint256 constant ERC1155_safeTransferFrom_to_ptr = 0x24;\nuint256 constant ERC1155_safeTransferFrom_id_ptr = 0x44;\nuint256 constant ERC1155_safeTransferFrom_amount_ptr = 0x64;\nuint256 constant ERC1155_safeTransferFrom_data_offset_ptr = 0x84;\nuint256 constant ERC1155_safeTransferFrom_data_length_ptr = 0xa4;\nuint256 constant ERC1155_safeTransferFrom_length = 0xc4; // 4 + 32 * 6 == 196\nuint256 constant ERC1155_safeTransferFrom_data_length_offset = 0xa0;\n\n// abi.encodeWithSignature(\n//     \"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\"\n// )\nuint256 constant ERC1155_safeBatchTransferFrom_signature = (\n    0x2eb2c2d600000000000000000000000000000000000000000000000000000000\n);\n\n// bytes4 constant ERC1155_safeBatchTransferFrom_selector = bytes4(\n//     bytes32(ERC1155_safeBatchTransferFrom_signature)\n// );\n\nuint256 constant ERC721_transferFrom_signature = (\n    0x23b872dd00000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC721_transferFrom_sig_ptr = 0x0;\nuint256 constant ERC721_transferFrom_from_ptr = 0x04;\nuint256 constant ERC721_transferFrom_to_ptr = 0x24;\nuint256 constant ERC721_transferFrom_id_ptr = 0x44;\nuint256 constant ERC721_transferFrom_length = 0x64; // 4 + 32 * 3 == 100\n\n/*\n *  error NoContract(address account)\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x00: account\n * Revert buffer is memory[0x1c:0x40]\n */\nuint256 constant NoContract_error_selector = 0x5f15d672;\nuint256 constant NoContract_error_account_ptr = 0x20;\nuint256 constant NoContract_error_length = 0x24;\n\n/*\n *  error TokenTransferGenericFailure(\n *      address token,\n *      address from,\n *      address to,\n *      uint256 identifier,\n *      uint256 amount\n *  )\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x20: token\n *    - 0x40: from\n *    - 0x60: to\n *    - 0x80: identifier\n *    - 0xa0: amount\n * Revert buffer is memory[0x1c:0xc0]\n */\nuint256 constant TokenTransferGenericFailure_error_selector = 0xf486bc87;\nuint256 constant TokenTransferGenericFailure_error_token_ptr = 0x20;\nuint256 constant TokenTransferGenericFailure_error_from_ptr = 0x40;\nuint256 constant TokenTransferGenericFailure_error_to_ptr = 0x60;\nuint256 constant TokenTransferGenericFailure_error_identifier_ptr = 0x80;\nuint256 constant TokenTransferGenericFailure_err_identifier_ptr = 0x80;\nuint256 constant TokenTransferGenericFailure_error_amount_ptr = 0xa0;\nuint256 constant TokenTransferGenericFailure_error_length = 0xa4;\n\nuint256 constant ExtraGasBuffer = 0x20;\nuint256 constant CostPerWord = 0x3;\nuint256 constant MemoryExpansionCoefficientShift = 0x9;\n\n// Values are offset by 32 bytes in order to write the token to the beginning\n// in the event of a revert\nuint256 constant BatchTransfer1155Params_ptr = 0x24;\nuint256 constant BatchTransfer1155Params_ids_head_ptr = 0x64;\nuint256 constant BatchTransfer1155Params_amounts_head_ptr = 0x84;\nuint256 constant BatchTransfer1155Params_data_head_ptr = 0xa4;\nuint256 constant BatchTransfer1155Params_data_length_basePtr = 0xc4;\nuint256 constant BatchTransfer1155Params_calldata_baseSize = 0xc4;\n\nuint256 constant BatchTransfer1155Params_ids_length_ptr = 0xc4;\n\nuint256 constant BatchTransfer1155Params_ids_length_offset = 0xa0;\n// uint256 constant BatchTransfer1155Params_amounts_length_baseOffset = 0xc0;\n// uint256 constant BatchTransfer1155Params_data_length_baseOffset = 0xe0;\n\nuint256 constant ConduitBatch1155Transfer_usable_head_size = 0x80;\n\nuint256 constant ConduitBatch1155Transfer_from_offset = 0x20;\nuint256 constant ConduitBatch1155Transfer_ids_head_offset = 0x60;\n// uint256 constant ConduitBatch1155Transfer_amounts_head_offset = 0x80;\nuint256 constant ConduitBatch1155Transfer_ids_length_offset = 0xa0;\nuint256 constant ConduitBatch1155Transfer_amounts_length_baseOffset = 0xc0;\n// uint256 constant ConduitBatch1155Transfer_calldata_baseSize = 0xc0;\n\n// Note: abbreviated version of above constant to adhere to line length limit.\nuint256 constant ConduitBatchTransfer_amounts_head_offset = 0x80;\n\nuint256 constant Invalid1155BatchTransferEncoding_ptr = 0x00;\nuint256 constant Invalid1155BatchTransferEncoding_length = 0x04;\nuint256 constant Invalid1155BatchTransferEncoding_selector = (\n    0xeba2084c00000000000000000000000000000000000000000000000000000000\n);\n\nuint256 constant ERC1155BatchTransferGenericFailure_error_signature = (\n    0xafc445e200000000000000000000000000000000000000000000000000000000\n);\nuint256 constant ERC1155BatchTransferGenericFailure_token_ptr = 0x04;\nuint256 constant ERC1155BatchTransferGenericFailure_ids_offset = 0xc0;\n\n/*\n *  error BadReturnValueFromERC20OnTransfer(\n *      address token, address from, address to, uint256 amount\n *  )\n *    - Defined in TokenTransferrerErrors.sol\n *  Memory layout:\n *    - 0x00: Left-padded selector (data begins at 0x1c)\n *    - 0x00: token\n *    - 0x20: from\n *    - 0x40: to\n *    - 0x60: amount\n * Revert buffer is memory[0x1c:0xa0]\n */\nuint256 constant BadReturnValueFromERC20OnTransfer_error_selector = 0x98891923;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_token_ptr = 0x20;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_from_ptr = 0x40;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_to_ptr = 0x60;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_amount_ptr = 0x80;\nuint256 constant BadReturnValueFromERC20OnTransfer_error_length = 0x84;\n"}},"compilation":{"language":"Solidity","compiler":"solc","compilerVersion":"0.8.24+commit.e11b9ed9","compilerSettings":{"viaIR":true,"metadata":{"bytecodeHash":"none"},"libraries":{},"optimizer":{"runs":9999999,"enabled":true},"evmVersion":"cancun","remappings":[":seaport-types/=lib/seaport-types/"]},"name":"Seaport","fullyQualifiedName":"src/Seaport.sol:Seaport"},"runtimeBytecode":{"onchainBytecode":"0x60806040526004361015610022575b3615610018575f80fd5b610020611de5565b005b5f3560e01c80156100ec57806306fdde031461013757806346423aa7146101325780635b34b9661461012d5780637423eb3c1461012857806379df72bd1461012357806387201b411461011e5780638814773214610119578063a817440414610114578063a900866b1461010f578063b3a34c4c1461010a578063e7acab2414610105578063ed98a57414610100578063f07ec373146100fb578063f2d12b12146100f6578063f47b7740146100f1578063fb0f3ee1146100ec5763fd9f1e100361000e57610f46565b610191565b610ec2565b610ded565b610d89565b610cc6565b610c0a565b610b8b565b610b24565b610a72565b6108e5565b6107d6565b6105b2565b610493565b6103f0565b610372565b61032e565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9060208282011261018d576004359167ffffffffffffffff831161018d57826102409203011261018d5760040190565b5f80fd5b61019a3661013c565b5061012435600381169060021c60018111913415830361032857600382117f0203020301010000000000000000000000000000000000000000000000000000831a61020f8160a0840260240135877d010102030000000000000000000000000000000000000000000000000000881a87611e80565b9490928060051b6101c4013596610225816106b9565b61027557505060443560243517610268576102509461024391612584565b61024b612649565b6126c5565b610258612715565b60405160018152602090f35b0390f35b636ab37ce75f526004601cfd5b61024b925061025096916102bd9161028b611201565b93848361029882956106b9565b600281036102c257506102b8916101043560e4353360843560c4356122a2565b6123b1565b61245b565b6102cb816106b9565b600381036102eb57506102b8916101043560e4353360843560c4356121af565b806102f76004926106b9565b03610312576102b891606435604435608435336024356122a2565b6102b891606435604435608435336024356121af565b34611e70565b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57602080526707536561706f727460475260606020f35b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d576004355f526001602052608060405f20546040519060ff81161515825260ff8160081c16151560208301526effffffffffffffffffffffffffffff8160101c16604083015260881c6060820152f35b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5761042661275a565b335f525f602052602060405f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43014060801c018091556040518181527f721c20121297512b72821b97f5326877ea8ecf4bb9948fea5bfcb6453074d37f833392a2604051908152f35b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5763929eee1460018154147f00000000000000000000000000000000000000000000000000000000000000019081156105a9575b5061057f575f8080807f0000000000000000000000002c023f954ac2029e8941f30defc209ef5c994c5f600a5a04fa3d1561057a573d61053b610536826111c7565b611148565b9081525f60203d92013e5b15610550575f9055005b60046040517f70a4078f000000000000000000000000000000000000000000000000000000008152fd5b610546565b60046040517ff45b98b0000000000000000000000000000000000000000000000000000000008152fd5b9050155f6104f4565b3461018d577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60208136011261018d576004359067ffffffffffffffff821161018d5761016090823603011261018d5761062663ffffffff6020921661014461061d82600401615c33565b91013590611245565b604051908152f35b9181601f8401121561018d5782359167ffffffffffffffff831161018d576020808501948460051b01011161018d57565b73ffffffffffffffffffffffffffffffffffffffff81160361018d57565b60a4359061068a8261065f565b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600611156106c357565b61068c565b60809080516106d6816106b9565b83528160208201519173ffffffffffffffffffffffffffffffffffffffff80931660208601526040810151604086015260608101516060860152015116910152565b9081518082526020808093019301915f5b828110610737575050505090565b909192938260e0600192604088516107508382516106c8565b8085015173ffffffffffffffffffffffffffffffffffffffff1660a0840152015160c082015201950193929101610729565b909291604082019160408152845180935260608101926020809601905f5b8181106107c0575050506107bd9394506020818403910152610718565b90565b82511515865294870194918701916001016107a0565b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5767ffffffffffffffff60043581811161018d5761082190369060040161062e565b505060243581811161018d5761083b90369060040161062e565b505060443581811161018d5761085590369060040161062e565b505060643590811161018d5761086f90369060040161062e565b505061088861087c61067d565b60c4359060843561105c565b9061026460405192839283610782565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82011261018d576004359067ffffffffffffffff821161018d576108e19160040161062e565b9091565b3461018d576108f336610898565b5050600461090b63ffffffff600435166004016115e1565b9061091461275a565b8151905f92361515935b8381106109315760405160018152602090f35b61093b81836116ac565b519081519184608084015161094f816116c0565b610958816116c0565b14610a5757825173ffffffffffffffffffffffffffffffffffffffff169261097f81612dad565b610991815f52600160205260405f2090565b9461099d8a8784612e07565b506109b06109ac875460ff1690565b1590565b6109c4575b50505050600191505b0161091e565b60608301515161014084015103610a5257600195610a0c610a37928460207ff280791efe782edcf06ce15c8f4dff17601db3b88eb3805a0db7d77faf757f0498015191612ec8565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b610a46604051928392836117f1565b0390a15f8080806109b5565b612ebb565b50600191506109be565b9060206107bd928181520190610718565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5760043567ffffffffffffffff80821161018d57610abc368360040161062e565b505060243590811161018d5761026491610b1091610add368260040161062e565b5050610b08610af563ffffffff8094166004016118e9565b92610afe6111a4565b9216600401611948565b9033926119ce565b604051918291602083526020830190610718565b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5773ffffffffffffffffffffffffffffffffffffffff600435610b748161065f565b165f526002602052602060405f2054604051908152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60408136011261018d576004359067ffffffffffffffff821161018d57604090823603011261018d57610c00610bec63ffffffff60209316600401611aa3565b610bf46111a4565b90339160243591611bf5565b6040519015158152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60808136011261018d576004359067ffffffffffffffff9081831161018d5760a090833603011261018d5760243590811161018d5761026491610cb491610c75368260040161062e565b5050610ca460643592610c878461065f565b610c9a63ffffffff809216600401611d2f565b9216600401611426565b9133811502019160443591611bf5565b60405190151581529081906020820190565b60a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57600467ffffffffffffffff813581811161018d57610d103682850161062e565b50506024359082821161018d57610d293683860161062e565b505060443592831161018d57610d7a61088894610d483686830161062e565b5050610d5c63ffffffff80941682016118e9565b92610d7281610d696111a4565b961683016114b5565b9516016114b5565b60843593339360643593611514565b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d576020610626600435610dc98161065f565b73ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f205490565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5767ffffffffffffffff6004803582811161018d57610e373682840161062e565b50506024359083821161018d57610e503683850161062e565b505060443593841161018d5761026493610eaa610eb694610e733684830161062e565b5050610e99610ea260643595610e888761065f565b63ffffffff928380921685016113c7565b97168301611426565b931601611948565b913381150201926119ce565b60405191829182610a61565b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57610ef8613c1a565b60605f5260205273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000f9490004c11cef243f5400493c00ad63166040526303312e3660635260a05ff35b3461018d57610f5436610898565b90610f5d61275a565b5f915f5b818110610f7e5783610f795760405160018152602090f35b613cf0565b80610f8c6001928486611d8e565b94610f9686611dce565b907f6bacc01dbe442496068f7d234edd811f1a5f833243e0aec824f86ab861f3c90d610fef610fc760208a01611dce565b92610fd460808b01611dd8565b60048533148733141715911417179861014061061d82615c33565b91611031611005845f52600160205260405f2090565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016610100179055565b60405192835273ffffffffffffffffffffffffffffffffffffffff908116931691602090a301610f61565b906108e1929163ffffffff9161107883600435166004016113c7565b926110898160243516600401611426565b6110a961109c83604435166004016114b5565b92606435166004016114b5565b92338115020194611514565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040519060a0820182811067ffffffffffffffff82111761110257604052565b6110b5565b60405190610160820182811067ffffffffffffffff82111761110257604052565b604051906040820182811067ffffffffffffffff82111761110257604052565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761110257604052565b67ffffffffffffffff81116111025760051b60200190565b6040516020810181811067ffffffffffffffff821117611102576040525f815290565b67ffffffffffffffff811161110257601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b611209611128565b90602082526020828136910137565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b91909161014081018051917fa66999307ad1bb4fde44d13a5d710bd7718e0c87c1eef68a571629fbf5b93d02604051604083018051928351926020809501905f915b868684106113865750505050506040519160051b8220917f42d81c6929ffdc4eb27a0808e40e82516ad42296c166065de7f812492304ff6e9093606086019481865101905f915b8a83106113445750505050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660051b604051209401978851907ffa445660b7e21515a59617fcd68910b487aa5808b8abda3d78bc85df364b2c2f8a5282519383528451958552865261018089209852525252565b8380827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0600194510180519089815260e08120875252019201920191906112ce565b80827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0600194510180519088815260c0812087525201920192019190611287565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b84811061140457505050505050565b8061141a87848180958801013516860101611d2f565b828287010152016113f5565b9081359063ffffffff92600593641fffffffe08460051b16906040805191602094858585010183528184981684525f5b8581106114695750505050505050909150565b8083888093850101351683018551908360a091828401895287608093848484018737820135160101908d60018884351601901b8851928184018a52833782015282828801015201611456565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b8481106114f257505050505050565b8061150887848180958801013516860101612879565b828287010152016114e3565b96948093949296611528923615908a6128d4565b93909186519082519261154361153e8585612cee565b612d4b565b98865f5b8b8d8783106115ab5750505050505f5b8481106115735750505050508461156f9495966147a8565b9190565b806115a48b611590868f611589600197896116ac565b5190614665565b61159d88850180936116ac565b528c6116ac565b5001611557565b826115c76001956115cd936115c0848a6116ac565b519061461f565b926116ac565b526115d8818d6116ac565b50018790611547565b9081359163ffffffff641fffffffe08460051b1690604090815190602094858584010184528183981683525f5b85811061161e5750505050505050565b80838880938501013516830161165d838851928984016101a085018b5261164e81848b8186013516850101613046565b8452878a820135160101613078565b838201528282870101520161160e565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8051156116a75760200190565b61166d565b80518210156116a75760209160051b010190565b600511156106c357565b5160058110156106c35790565b9081518082526020808093019301915f5b8281106116f6575050505090565b909192938260a06001928751805161170d816106b9565b82528084015173ffffffffffffffffffffffffffffffffffffffff1684830152604080820151908301526060808201519083015260809081015190820152019501939291016116e8565b9081518082526020808093019301915f5b828110611776575050505090565b909192938260c06001928751805161178d816106b9565b82528084015173ffffffffffffffffffffffffffffffffffffffff9081168584015260408083015190840152606080830151908401526080808301519084015260a091820151169082015201950193929101611768565b9060058210156106c35752565b9081526040602082015261181e60408201835173ffffffffffffffffffffffffffffffffffffffff169052565b602082015173ffffffffffffffffffffffffffffffffffffffff1660608201526101806040830151611895611861610160928360808701526101a08601906116d7565b60608601517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08683030160a0870152611757565b936118a8608082015160c08601906117e4565b60a081015160e085015260c081015191610100928386015260e082015192610120938487015282015192610140938487015282015190850152015191015290565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b84811061192657505050505050565b8061193c87848180958801013516860101611aa3565b82828701015201611917565b9081359163ffffffff641fffffffe08460051b1690604090815190602094858584010184528183981683525f5b8581106119855750505050505050565b8083888093850101351683016119be838851928984018a526119af82898184013516830101612879565b8452878a820135160101612879565b8382015282828701015201611975565b939290816119e39186519036151590886128d4565b9190805160051b6040017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018051907f4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e76020936020835282a152845190611a4a82612d4b565b955f5b838110611a68575050505083611a649495966147a8565b5090565b80611a87818c611a7a600195876116ac565b5187815191015191614bed565b611a91828b6116ac565b52611a9c818a6116ac565b5001611a4d565b906040516102008101604052611ae9819360a08301808452611acf63ffffffff91828435168401613046565b600160208501526001604085015260208201351601613078565b6060820152608060405191602083016040525f83520152565b611b0a611128565b9060018252815f5b60209081811015611b9557602091611b286110e2565b90611b31611107565b5f81525f828201526060905f60408381840152838084015260809282848201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152865281858701528501528180850152830152828501015201611b12565b505050565b611ba2611128565b600181529060203681840137565b90611bbd6105368361118c565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611beb829461118c565b0190602036910137565b909192611cfd93825192608084015191611c0e836116c0565b611c17836116c0565b60048314611c248161315c565b36151590611c5d611c3583866131d2565b93919290929a611c43611b02565b88611c4d8261169a565b52611c578161169a565b506133d1565b611c698884848c61353b565b611c7a611c74611b9a565b976116c0565b611d0a578593611ca08694611ca8948a94611c9a8e611cb89c819c6136db565b8961383b565b505b88613944565b82611cb28361169a565b52613a36565b815173ffffffffffffffffffffffffffffffffffffffff165b602083015173ffffffffffffffffffffffffffffffffffffffff16906060604085015194015194613b3b565b611d05612715565b600190565b505084965091611ca8611d27611cb895939460808401518961361c565b978894611ca2565b9060405161020081016040526080611d898294604060208201602086013760a08401808552611d6863ffffffff91828435168401613046565b611d79816060840135168301613078565b6060860152838201351601613078565b910152565b91908110156116a75760051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea18136030182121561018d570190565b356107bd8161065f565b35600581101561018d5790565b7f000000000000000000000000000000000000000000000000000000000000000180611e51575b15611e1357565b63929eee14805480159182611e42575b5060031415901516611e3157565b63a61be9f05f52346020526024601cfd5b6002905c03611e31575f611e23565b600263929eee145c0315611e0c5763a61be9f05f52346020526024601cfd5b63a61be9f05f526020526024601cfd5b93929190611e8c6130a2565b611e94613cfd565b6101643561014435428211154282111761219c57505061020435610264351061218f57927f42d81c6929ffdc4eb27a0808e40e82516ad42296c166065de7f812492304ff6e6080528360a0526060602460c037604060646101203760e0608090812061016052600161026435016102043560051b6102a08101919091526102c081019586526024906102e00137610160938260a0528360c0525f60e0525f915f5b8261020435821015611f925790604060019261010060a060208560061b99818b610284018537858b61028401610120376102a48b0135179c019760e0608020895201978989528a60c0840152610284019101370195929195611f35565b509550969590916001610204350160051b610160206060525b8261026435871015611fea5790604060a060019301948686528760c08201526101008960061b610284019101376102a48760061b013517950194611fab565b5092509593505073ffffffffffffffffffffffffffffffffffffffff915011612182577fa66999307ad1bb4fde44d13a5d710bd7718e0c87c1eef68a571629fbf5b93d026080528060a052606060c460c03760206101046101203760c06080205f5260205f2060e0526103c0608435916120818373ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f2090565b547ffa445660b7e21515a59617fcd68910b487aa5808b8abda3d78bc85df364b2c2f6080526040608460a03760605161010052856101205260a0610144610140376101e090815261018060808181206102043560051b928301818152336101a08501526101c084019290925261012083850152600161020084015261022083019490945292949060609060c49061024001377f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f3160a06102643502938460a435940190a35f6060526102043560051b010160405261156f61216a61216383613d53565b9483613d9e565b93710100000000000000000000000000000100019055565b6339f3e3fd5f526004601cfd5b63466aa6165f526004601cfd5b6321ccfeb75f526020526040526044601cfd5b9590919293946121be86613e6f565b6121c88183613e83565b806121d857505061068a94613f63565b90606495969493929160208251145f1461228f5760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001888401525b02019360037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe48501526004840152602483015260448201520152565b5060c0868201600181510180915261222f565b919396959092946122b38183613e83565b806122d3575050600186036122cd5761068a949550614071565b85614061565b81519697966064969395939492919060200361238c5760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001888401525b02019360027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe48501526004840152602483015260448201520152565b5060c0868201600181510180915261232c565b919082039182116123ac57565b611218565b919082156124485760843592610104353360c43560e4355b612443578360051b6101e40335936102643560061b905f5b8281106123f6575050509561068a9596614133565b87876102848301358c85612422575b9184939161241c936102a46040970135908a614133565b016123e1565b989181612436604096959361241c9561239f565b9a91935091939450612405565b610268565b33926064356084356024356044356123c9565b604081510361258157602081015160c06064830151026044019060205f73ffffffffffffffffffffffffffffffffffffffff9360405194807f00000000000000000000000000000000f9490004c11cef243f5400493c00ad631674ff00000000000000000000000000000000000000001783528484527f023d904f2503c37127200ca07b976c3a53cc562623f67023115bf311f58050596040526055600b2016946040528180526040860182865af15f519015612568577fffffffff000000000000000000000000000000000000000000000000000000007f4ce34aa20000000000000000000000000000000000000000000000000000000091160361256357505060209052565b61543d565b82612571614f3d565b63d13d53d45f526020526024601cfd5b50565b60c43592916101043560e43560843583156126005761068a95966125a784613e6f565b604051957f4ce34aa200000000000000000000000000000000000000000000000000000000875260206004880152600160248801526044870152606486015260848501523360a485015260c484015260e4830152614272565b9195925092806126116002926106b9565b03612631576001850361262b5761068a9394503391614071565b84614061565b9084929161264261068a9596613e6f565b3391613f63565b346064355f6102643560061b5b80821061268d575050818111612688576126728160843561435b565b80821161267d575050565b61068a91033361435b565b6126b8565b9092836102840135938185116126b8576126b18560409303956102a483013561435b565b0190612656565b638ffff9805f526004601cfd5b919060a435908133141590600460018211911016166126e357505050565b61270f92601c83516317b1f9428552600163ffffffff82165263fb5014fc60605260801c930191614390565b5f606052565b7f00000000000000000000000000000000000000000000000000000000000000016127515763929eee1480541561274c5760019055565b5f905d565b5f63929eee145d565b7f0000000000000000000000000000000000000000000000000000000000000001806127b9575b1561278857565b63929eee1480549081156127ae575b506001106127a157565b637fa8a9875f526004601cfd5b5c6127a1575f612797565b63929eee145c1561278157637fa8a9875f526004601cfd5b90813563ffffffff811692604051938085526020641fffffffe0819460051b16860101928392602060a080940291018537602086015b8381106128175750505050604052565b848152938201938101612807565b90813563ffffffff811692604051938085526020641fffffffe0819460051b16860101928392602060c080940291018537602086015b83811061286b5750505050604052565b84815293820193810161285b565b908135916040926040519363ffffffff82168552602080641fffffffe08460051b16870101936020643fffffffc0869560061b1691018537602086015b8381106128c65750505050604052565b8481529382019381016128b6565b939492915f946128e26130ff565b5f357c4000000000000000000000000000000000000000000000000000000000169681519361291085611bb0565b9860205b6001870160051b8110612b5757507c400000000000000000000000000000000000000000000000000000000114612b5257612954908392969594936133d1565b5f946020945b6001850160051b8610612979575050505050501561297457565b614612565b909192939495868a01918251918215612b435788860151938215612ad057878d8b608060046129aa828b51016116ca565b6129b3816116c0565b14612ae75750916109ac91877fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ef9560051c01918a61447b565b612ad0576020850190612a556109ac612a1784516effffffffffffffffffffffffffffff1690565b60408901516effffffffffffffffffffffffffffff1690612a398d8b516145dc565b916effffffffffffffffffffffffffffff80911691168961383b565b612ab957505050907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612aa5925b01925184611cd1825173ffffffffffffffffffffffffffffffffffffffff1690565b6001602081975b019594939291905061295a565b602093955060019450905f80929b939b5252612aac565b6001935060208093955f80939c949c520152612aac565b915050612afc9295508651908701519061361c565b8093528215612b315750907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612aa592612a83565b97600192505f60208093950152612aac565b97602091935060019250612aac565b61446e565b8a81860151612b6688826131d2565b6effffffffffffffffffffffffffffff821660208501529093909291908415612ce1576effffffffffffffffffffffffffffff84166040840152850152805160a08101519160c082015191608001519e8f612bc0816116c0565b600110179e815160400151908151905f925b828410612c6b5750505050606090510151938451945f5b868110612c0157505050505050506020905b01612914565b80612c0e600192846116ac565b516080810160a0612c2182518b896143f9565b92612c4a60608201948c8651865181145f14612c5a5750508086525b8a8c36151592885161442b565b8094520190815190525201612be9565b612c64918c6143f9565b8652612c3d565b90919299612c798b836116ac565b519060048410825110179a608082018051612c95908b8d6143f9565b92606001908a8251948d835187145f1496612cc493600198612cd1575050508084525b8a8c361592865161442b565b8092525201929190612bd2565b612cda926143f9565b8452612cb8565b5050505050602090612bfb565b919082018092116123ac57565b604051906060820182811067ffffffffffffffff821117611102576040525f604083612d256110e2565b838152836020820152838382015283606082015283608082015281528260208201520152565b90612d586105368361118c565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0612d86829461118c565b01905f5b828110612d9657505050565b602090612da1612cfb565b82828501015201612d8a565b6060810151516101408201511161218f5780612e0173ffffffffffffffffffffffffffffffffffffffff6107bd93511673ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f205490565b90611245565b91905460ff8160081c16612e63576effffffffffffffffffffffffffffff8160101c169081612e3a575b50505050600190565b60881c1115612e4a578080612e31565b612e5357505f90565b6310fda3e15f526020526024601cfd5b50612e6d57505f90565b631a5155745f526020526024601cfd5b91905460ff8160081c16612e63576effffffffffffffffffffffffffffff915060101c16612eab5750600190565b63ee9e0e635f526020526024601cfd5b632165628a5f526004601cfd5b92919033841461304057612eda613c1a565b93612f1482867f19010000000000000000000000000000000000000000000000000000000000005f5260025260225260425f20905f602252565b908351926002601f601d860116106102e27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9d860110165f146130325760018085169081604103927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60059388010160051c93808952880160209384820151928560238560e81c94019460e31c169081528584519118526001925b8684106130135750505050509661300d9161068a9798612fd160405f209261570a565b5f525260405f20907f19010000000000000000000000000000000000000000000000000000000000005f5260025260225260425f20905f602252565b90614a07565b85859101938684821c841b1660405f2081528786519118520192612fae565b5061068a9495508190614a07565b50509050565b611d8960609161016081853763ffffffff6130688160408401351683016127d1565b6040860152838201351601612825565b9060206040519263ffffffff813563ffffffe0601f82011692848401908737168452830101604052565b7f00000000000000000000000000000000000000000000000000000000000000016130ee5763929eee14805480156130e1576001036127a15760029055565b50805c6127a1576001905d565b63929eee14805c6127a1576001905d565b7f000000000000000000000000000000000000000000000000000000000000000161314b5763929eee148054801561313e576001036127a15760039055565b50805c6127a1576002905d565b63929eee14805c6127a1576002905d565b7f00000000000000000000000000000000000000000000000000000000000000016131ab5763929eee14908154801561319d576001036127a1576002019055565b50815c6127a157600101905d565b63929eee1490815c6127a157600101905d565b90805b6131c9575090565b809106806131c1565b9190918051916131ef6109ac8560a086015160c087015190614d1d565b6133bc576effffffffffffffffffffffffffffff6020816020850151169482604086015116946080820160048151613226816116c0565b61322f816116c0565b146133a35787158789111761339e575191613249836116c0565b600180931615878910166133995761326081612dad565b986132816109ac6132798c5f52600160205260405f2090565b92838d612e07565b61338b5754918960ff841615613357575b5050508060881c918483159260101c1691156132b0575b5050505050565b86979614613343578187146133265786829102950295029385019484861185870302809103958386116132e4575b806132a9565b856132fe926132f8929894959798036131be565b826131be565b8015018091049404928311613315578080806132de565b601190634e487b715f52526024601cfd5b925050508291939201828082119103029003915f808080806132a9565b8103955093505f91508190508080806132a9565b606061337a613383945173ffffffffffffffffffffffffffffffffffffffff1690565b92015191612ec8565b5f8089613292565b505f97508796505050505050565b614d4b565b614d3e565b50505050509250600191021861339e5760019081908290565b5f9350839250829150565b600211156106c357565b81518151925f5b82811061346f575050505f5b8281106133f057505050565b806133fd600192846116ac565b5161343161341d60208301516effffffffffffffffffffffffffffff1690565b6effffffffffffffffffffffffffffff1690565b15613469576134639051604060808201519161344c836116c0565b61345b83606083015187614e36565b015183615d44565b016133e4565b50613463565b61347981836116ac565b518051868110156135285761348e90866116ac565b516020906134b061341d838301516effffffffffffffffffffffffffffff1690565b1561351d57519060409081830151918401519263bfb3f8ce918501516134d5816133c7565b6134de816133c7565b61350a575b5081518310156135025750916134fc9160019493614d74565b016133d8565b5f526004601cfd5b9050606091500151636088d7de5f6134e3565b5050506001906134fc565b6020820151613536816133c7565b614d58565b60a08082015160c0830151604084018051513615985f989597959492895b8381106135d7575050505060809660046080870151613577816116c0565b1016612b52576060948501805151981593905f5b8a811061359f575050505050505050505050565b808a8a8a8a6135cb8b8b8b8b6135b860019b8d516116ac565b51968701958651998801998a5190614e92565b9052015190520161358b565b82888d838551906135e7916116ac565b519d8e516135f4816106b9565b15179d60608101918a8a8d85519460800196875161361196614e92565b905252600101613559565b919091606081019182515161014083015103612ebb575f8061365c613655855173ffffffffffffffffffffffffffffffffffffffff1690565b9685614ed1565b9082885af19361368a8173ffffffffffffffffffffffffffffffffffffffff165f52600260205260405f2090565b9081549160018301905560601b1893156136c25750604001906136b08251825190615c7f565b9390916136bc57525290565b84614f86565b9150506136ce57505f90565b6136d6614f3d565b614f86565b91825190608082015160058110156106c357602083019261372073ffffffffffffffffffffffffffffffffffffffff9283865116331415906004600182119110161690565b61372d575b505050505050565b61381a601c91608061382c980151965f6040519889936301e4d72a85526020808601528860408601523360608601528051608086015260a081015161012086015261014060c08201518187015260e08201516101608701528060a08701526138016040830151936137d76137a761018096878b0190615b45565b80850160c08b01526137c2606087015188838d010190615bb9565b019184830160e08b015286838b010190615ba0565b0193610100928501838901528085890101946137f38689615c03565b016101648101980101604052565b828660401b8d60801b1717910152525160051b9061239f565b9463fb5014fc60605201925116614390565b5f6060525f8080808080613725565b61384d815f52600160205260405f2090565b935f938554948560881c90811561393a57506effffffffffffffffffffffffffffff809660101c1681831461392b578282910292029402019383851190808511818711176138f3575b505b6138b057505060881b9060101b176001179055600190565b92509250505f146138ee576040517f10fda3e10000000000000000000000000000000000000000000000000000000081526004810191909152602490fd5b505f90565b93946138ff86826131be565b80150180910495049380851190861117613919575f613896565b634e487b715f5260116020526024601cfd5b92955050920192828411613898565b9550509293613898565b92919092613950611201565b916040820190815151915f5b8381106139ed5750505050606080910190815151915f5b83811061399c575050505061398991925061245b565b47806139925750565b61068a903361435b565b6139a78183516116ac565b5190858883516139b6816106b9565b6139bf816106b9565b156139da575b906139d491600194339061516a565b01613973565b50504784830151116126885785886139c5565b80613a30876139ff60019486516116ac565b51866080820152613a24895173ffffffffffffffffffffffffffffffffffffffff1690565b6101208a01519161516a565b0161395c565b919091805192608084019182519260058410156106c357613a846020870194613a73865173ffffffffffffffffffffffffffffffffffffffff1690565b331415906004600182119110161690565b15613aaf575050613a9d9061010061270f950151615416565b9290915163fb5014fc5b606052614390565b60049195935051613abf816116c0565b613ac8816116c0565b03613af55761270f93613ae89183519360808560601b9301519086615392565b9290916393979285613aa7565b50505050565b9081518082526020808093019301915f5b828110613b1a575050505090565b909192938260a082613b2f60019489516106c8565b01950193929101613b0c565b9094939173ffffffffffffffffffffffffffffffffffffffff91604090604051956080926080880192885285602092166020890152608060408901528651809352602060a089019701935f915b848310613bd6575050505050508282859493613bd193867f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31989603606087015216971695613afb565b0390a3565b90919293949784836001928b518051613bee816106b9565b8252808401518c1684830152858101518683015260609081015190820152019901959493019190613b88565b467f000000000000000000000000000000000000000000000000000000000000000103613c65577ffce34bc6e1752c1117e5063116d25cad2fa2bdcf15ff2d2e275eece7dc31ba6490565b6040516080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f527f32b5c112df393a49218d7552f96b2eeb829dfb4272f4f24eef510a586b85feef6020527f95f740a33d720b7cd93c75d515ac95ca3bbaa2594cce46ea48e00974ea8fcd14604052466060523060805260a05f20916040525f60605260805290565b63fed398fc5f526004601cfd5b7401000000000000000000000000000000000000000060243560c4351760a43560843517171060186101243510166102643560061b61026001610244351461024061022435146020600435141616161561218257565b90815f52600160205260405f2091613d6e3615158483612e7d565b5060ff83541615613d7c5750565b61068a90613d95602463ffffffff610244351601613078565b90608435612ec8565b91905f9260a43591823314159060046001821191101616613dbd575050565b9092506102043560051b90613e5d82608001926301e4d72a8452602060a08201528260c08201523360e082015260843561010082015260606101446101a08301376101e06101408061012084015282015260a06102643502956102a08701610160830152868201935f6103608601526102c08801610180840152806103a06103808701965f8852015263fb5014fc606052609c6103048901930191614390565b5f60605261032482940160801b179052565b15613e7657565b6391b3e5145f526004601cfd5b90602082015103613e915750565b61068a9061245b565b9060649492939160208251145f14613f505760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001878401525b02019260017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48501527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe4840152600483015260248201525f60448201520152565b5060c08582016001815101809152613eef565b9293919091833b1561405057604051946080519260a0519460c051967ff242432a000000000000000000000000000000000000000000000000000000005f528160045282602452836044528460645260a06084525f60a4525f8060c48180855af115613fe057505050505060805260a05260c0526040525f606052565b883d614004575b5063f486bc875f5260205260405260605260805260a05260a4601cfd5b601f3d0160051c9060051c908060030291808211614037575b505060205a91011061402f5785613fe7565b3d5f803e3d5ffd5b8080600392028380020360091c9203020101868061401d565b83635f15d6725f526020526024601cfd5b6369f958275f526020526024601cfd5b929190833b1561405057604051937f23b872dd000000000000000000000000000000000000000000000000000000005f528160045282602452836044525f8060648180855af1156140c957505050506040525f606052565b843d6140ef575b5063f486bc875f52602052604052606052608052600160a05260a4601cfd5b601f3d0160051c9060051c90806003029180821161411a575b505060205a91011061402f57846140d0565b8080600392028380020360091c92030201018580614108565b9394909461414084613e6f565b61414a8183613e83565b80614264575050604051937f23b872dd000000000000000000000000000000000000000000000000000000005f5280600452816024528260445260205f60648180885af1803d15601f3d1160015f51141617163d15158116156141b7575b5050505050506040525f606052565b80863b1515166141a857908691156141da5785635f15d6725f526020526024601cfd5b908591156141fc575063988919235f526020526040526060526080526084601cfd5b3d614220575b5063f486bc875f526020526040526060525f60805260a05260a4601cfd5b601f3d0160051c9060051c90806003029180821161424b575b505060205a91011061402f5784614202565b8080600392028380020360091c92030201018580614239565b9061068a9592939491613e9a565b60205f61010473ffffffffffffffffffffffffffffffffffffffff9460405195807f00000000000000000000000000000000f9490004c11cef243f5400493c00ad631674ff00000000000000000000000000000000000000001784528585527f023d904f2503c37127200ca07b976c3a53cc562623f67023115bf311f58050596040526055600b20169560405282805282865af15f519015612568577fffffffff000000000000000000000000000000000000000000000000000000007f4ce34aa200000000000000000000000000000000000000000000000000000000911603612563575050565b61436482613e6f565b5f80808085855af115614375575050565b61437d614f3d565b63bc806b965f526020526040526044601cfd5b91602091935f91827fffffffff00000000000000000000000000000000000000000000000000000000825116958180525af1905f511490156143dd57156143d45750565b6080526024607cfd5b506143d4614f3d565b818102929181159184041417156123ac57565b919091828114614425578281830961441857614414916143e6565b0490565b63c63cf0895f526004601cfd5b50905090565b9392909384810361443d575050505090565b61445383614459930393420391828503906143e6565b946143e6565b83018093116123ac5781830304019015150290565b6312d3f5a35f526004601cfd5b9193929382519460808601519060058210156106c35760208701936144c473ffffffffffffffffffffffffffffffffffffffff9384875116331415906004600182119110161690565b6144d5575050505050505050600190565b6107bd976145c9836145d293601c956145b5608060409c0151958a8d519d8e6301e4d72a815260208082015201528c6060339101528c608082519101528c61012060a083015191015260a08d61014091829160c08501518382015260e085015161016082015201528d6040830151986145876145576101809b8c850190615b45565b80850160c085015261457260608701518d8387010190615bb9565b019184830160e08501528b8385010190615ba0565b01906101009282018382015289828201019485926145a5848a615c03565b019a6101648c019b830101604052565b8960401b9060801b1717910152525161239f565b60051b9061239f565b9401925116615450565b60808101519060058210156106c35773ffffffffffffffffffffffffffffffffffffffff60206001920151163314159111161790565b63d5da9a1b5f526004601cfd5b92919261462a612cfb565b938251156146545761068a9273ffffffffffffffffffffffffffffffffffffffff869216926155d1565b63375c24c15f525f6020526024601cfd5b92919092614671612cfb565b93805115614796575f92915f925f928091815160059060051b83015b8085106146be575050505050505080916060855101526146aa5750565b600103613919576391b3e5145f526004601cfd5b6020809501948551518751811015614739578190841b88010151908087510151916060928284835101519201511582518210151761478a575f918391871b0101519283019a8c8c518091019d8e9115911060011b17179b9a528c518d8a1560011461473e5750505060a090208718614739575b97969761468d565b6154c1565b83929a5090869160a0945182528b8401518c8301526040918285015183820152608080860151910152338c820152015220968401858118614780575b50614731565b855190525f61477a565b50505050979697614731565b63375c24c15f5260016020526024601cfd5b939190938051926147b884611bb0565b956147c1611201565b90600196600182510160051b6020928360205b8381106149a357505050505f5b878110614871575050506147f49061245b565b4780614861575b5061480d575b505050506107bd612715565b5f5b83811061481c5750614801565b8061483161482b8793896116ac565b51151590565b61483c575b0161480f565b61485c61484982856116ac565b518561485584826116ac565b5191613a36565b614836565b61486b903361435b565b5f6147fb565b61487b81876116ac565b518961489b61341d868401516effffffffffffffffffffffffffffff1690565b1561498f5791906148b56148af838e6116ac565b60019052565b5160408101518051905f5b82811061491f57505050606080910151908151915f5b8381106148e857505050505b016147e1565b9091929394506148f881836116ac565b5183810190815180614918575060a0015190528c949392919085016148d6565b83886156f4565b61492e818394959697936116ac565b5160806060820191825161494d575b0151905201908c949392916148c0565b608081018051908b90526149868d6149798b5173ffffffffffffffffffffffffffffffffffffffff1690565b6101208c0151908561516a565b8282015261493d565b9190505f61499d828d6116ac565b526148e2565b8083015180516060810151806149bf575b5050500184906147d4565b909193504710815115166126b857876149ff918460406149f68b8098015173ffffffffffffffffffffffffffffffffffffffff1690565b9101519161516a565b5f80806149b4565b909291925f80528451947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101805190876041035f9060018111958615614b84575b5050851485151516978815614a7d575b505050505050505015614a6857565b614a70614f3d565b634f7fb80d5f526004601cfd5b909192939495809798508452604082527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbc8401938451957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082019760205f60648b519c7f1626ba7e000000000000000000000000000000000000000000000000000000009e8f8c528d520189845afa9a8b614b28575b50505050505252525f80808080808080614a59565b5f5103614b355780614b13565b3b614a7057614b775760600190604164010100000083515f1a1a15911416614b645763815e1d645f526004601cfd5b631f003d0a5f52515f1a6020526024601cfd5b638baa579f5f526004601cfd5b909150604085019081519260608701515f1a90614bbb575b8652835260205f60808560015afa50838352898552525f515f80614a49565b50601b8360ff1c017f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84168352614b9c565b9192614bf7612cfb565b9380511583511517614d1057614c0b612cfb565b92614c178483876154ce565b8351926060840194855115614d055750614c53614c4b608086015173ffffffffffffffffffffffffffffffffffffffff1690565b8884896155d1565b865193604081015160408601511890602081015160208701511890518651181717614cf55750606084519301928351105f14614cc257509160206060614caf614cbc94614ca0839761169a565b519451905185519103976116ac565b51510151910151906116ac565b51015290565b60609150614cd5614cec9195939561169a565b5160206040614caf885188519003968451906116ac565b51015251905290565b63bced929d5f526020526024601cfd5b965050505050505090565b6398e9db6e5f526004601cfd5b428082111590831116939280614d36575b61219c575050565b508315614d2e565b635a052b325f526004601cfd5b63a11b63ff5f526004601cfd5b63133c37c65f526020526024601cfd5b614d71826106b9565b52565b90614d7e916116ac565b51805191614d8b836106b9565b6003831115614e29576040820180519093908015614dec57927ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe614de692614ddf6060968787015190608088015191615af3565b0190614d68565b01519052565b50608082015151614e24576060927ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe614de692614ddf565b615ae6565b6394eb6af65f526004601cfd5b815192915f5b848110614e4a575050505050565b614e5481836116ac565b518051614e60816106b9565b60036040809301511515600488141517911116614e805750600101614e3c565b8363a8930e9a5f52602052526044601cfd5b959192939490948587145f14614eaf575050506107bd93506143f9565b92919484614ec56107bd98614ecb9497866143f9565b936143f9565b9061442b565b9190608490614f38604051916398919765835260a0601c84019633602086015260806040860152614f246060614f0e604084015185890190615b45565b9283608001828901520151838388010190615b45565b018094608082016080820152010190615ba0565b010190565b3d614f4457565b601f3d0160051c60405160051c908060030291808211614f6d575b505060205a91011061402f57565b8080600392028380020360091c92030201015f80614f5f565b63939792855f526020526024601cfd5b92909260405193815190602092602060c087028801016040528587526020918660010160051b93848901928160010160051b019781810382821002820160010160051b9111975b81851061501a5750505b838310614ff5575050505050565b60a0859183858b01526080908181863e60608501518286015201920192019190614fe7565b9390949197869084838c0152608090818b873e60608087015190818489015288015111615047878961510a565b171799019360a08091019501910194909493929194614fdd565b9290604051938051908185119482808203911002820191602092602060e0820289010160405280885260209060010160051b928389019260010160051b01915b8382106150b057505050505050565b9091929380959782848b015260a090818a853e606083818c018487013e8481015190870151608080870151908901518015911417159111176150f2858861510a565b1717980195949360c0908101939190910191016150a1565b9081519160408101518015600385111661513a575b60208091604085015114948451149301519101511416161590565b5060408201517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9093019261511f565b9290918351615178816106b9565b615181816106b9565b615216575050506151c56151ac602083015173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff60408301519116176124435780606061520d608061068a94015173ffffffffffffffffffffffffffffffffffffffff1690565b9101519061435b565b90919260018151615226816106b9565b61522f816106b9565b036152a65760408101516124435761068a93615262602083015173ffffffffffffffffffffffffffffffffffffffff1690565b9073ffffffffffffffffffffffffffffffffffffffff606061529b608086015173ffffffffffffffffffffffffffffffffffffffff1690565b940151931691614133565b92600284516152b4816106b9565b6152bd816106b9565b0361532a57836152e7602061068a96015173ffffffffffffffffffffffffffffffffffffffff1690565b608082015173ffffffffffffffffffffffffffffffffffffffff169273ffffffffffffffffffffffffffffffffffffffff606060408501519401519416916122a2565b8361534f602061068a96015173ffffffffffffffffffffffffffffffffffffffff1690565b608082015173ffffffffffffffffffffffffffffffffffffffff169273ffffffffffffffffffffffffffffffffffffffff606060408501519401519416916121af565b9493919260c060a494615402614f38946040519663f4dd92ce8852601c88019a1860a088015260a060208801526153ec60606153d56040840151878b0190615b45565b928360a00160408b0152015185838a010190615bb9565b019160a083016060880152838388010190615ba0565b01809460a082016080820152010190615c03565b916125818360801c9263ffffffff601c818760401c16956317b1f942815201951690615c03565b631cf99b265f526020526040526044601cfd5b925f906020929593827fffffffff00000000000000000000000000000000000000000000000000000000825116968180525af1915f511491156154a95750156154995750600190565b63fb5014fc5f526020526024601cfd5b9050919091156154bc5750615499614f3d565b5f9150565b637fda72795f526004601cfd5b909291925f905f925f9180805160059060051b82015b8084106155005750505050505060608293945101526146aa5750565b6020979697809401938451518651811015614739578190841b8701015190808651015191606092828483510151920151158251821015176155c5575f918391871b010151928301998a519b8c81019c15908d1060011b17179a99528b518c89156001146155795750505060a090208618614739576154e4565b829950905f8493819360a0965184528186015182850152604093848701518582015260808088015191015201528d0152209583018481186155bb575b506154e4565b845190525f6155b5565b505050509695966154e4565b81519294935f93849384929091825b8160051b840181106156015750505050505060608293945101526146aa5750565b6020909796970190855182515110156147395781516020815160051b880101516020815192015160206040840151920151158251821015176156e9579060209160051b0101515f60608201998a519081158d8381011060011b17179b0199528b51871560011461569557506060902086189060408c0151610120820151189060208d01519051181717614739575b906155e0565b9160609397506040826101209351855260208101516020860152015160408401528560808401528c60208251910152015160408c01522093602084018281186156df575b5061568f565b825190525f6156d9565b50505096959661568f565b63a5f542085f526020526040526060526064601cfd5b600981106159a2576011811061585e57601581106157c057601781106157755760177f403be09941a31d05cfc2f896505811353d45d38743288b016630cce39435476a9114027f1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c1890565b60157fbb40bf8cea3a5a716e2b6eb08bbdac8ec159f82f380783db3c56904f15a43d049114027f3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d1890565b601381106158135760137f54b3212a178782f104e0d514b41a9a5c4ca9c980bf6597c3cecbf280917e202a9114027f5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e643500171890565b60117f2d7a3ed6dab270fdb8e054b2ad525f0ce2a8b89cc76c17f0965434740f673a559114027fc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d858771890565b600d811061590457600f81106158b957600f7fcc4886e37eedd9aacd6c1c2c9247197a621a71282e87a7cbc673f3736d9aa1419114027f1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde81890565b600d7f8df51df98847160517f5b1186b4bc3f418d98b8a7f17f1292f392d79d600d79e9114027f6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a8525901890565b600b811061595757600b7f32f4e7485d6485f9f6c255929b9905c62ba919758bbe231f231eaeecf33d810c9114027fbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f1890565b60097f6f0ec38c21f6f583ab7f3c5413c773ffd5344c34fde1d390958e438bf667448f9114027fd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da051890565b60058110615a4857600781106159fd5760077fb58d772fb09b426b9dece637f61ca9065f2b994f1464b51e9207f55f7c8f59489114027f7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc141890565b60057f25d02425402d882d211a7ab774c0ed6eca048c4d03d9af40132475744753b2a39114027f1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b551890565b60038110615a9b5760037ff3e8417a785f980bdaf134fa0274a6bf891eeb8195cd94b09d2aa651046e28bc9114027fa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af11890565b60017f832c58a5b611aadcfa6a082ac9d04bace53d8278387f10040347b7e98eb5b3029114027fbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde301890565b6309bde3395f526004601cfd5b9190915f5260209060205f20916020820191602081519160059260051b0101905b818410615b26575050505003615ae657565b8351808611821b9586529483189490945260405f209392820192615b14565b9081519081815260209283808083019301918460051b0101915b84838210615b72575050505060071b0190565b8160809251805185528281015183860152604080820151908601526060809101519085015201910190615b5f565b8051603f0163ffffffe016929161068a91849190615c23565b80519182815260208080808501948660051b01019201925b828110615be5575050505060a00260200190565b60a090818581835160045afa153d151761018d578201930192615bd1565b615c1f602092839283815180845260051b948593019101615c23565b0190565b829060045afa153d151761018d57565b604051906101608201604052615c71610140918281853763ffffffff615c608160408401351683016127d1565b604086015260608201351601612825565b806060840152519082015290565b90915f925f9260603d10915f905f925f905f938615615cdc575b8615615cab575b505050505050929190565b615cc4939495995060209850615cce9650880190614f96565b9590960190615061565b9092175f8080808080615ca0565b509450925060405f803e5f51926020948551943d878201113d8888011117968715615d08575b50615c99565b9450809650849192505f3e5f51908385813e835193808560a0028701013d10908360071b8801013d101761ffff8584171117955f80525f615d02565b815192915f5b848110615d58575050505050565b615d6281836116ac565b518051615d6e816106b9565b60036040809301511515600488141517911116615d8e5750600101615d4a565b8363d69293325f52602052526044601cfdfea164736f6c6343000818000a","recompiledBytecode":"0x60806040526004361015610022575b3615610018575f80fd5b610020611de5565b005b5f3560e01c80156100ec57806306fdde031461013757806346423aa7146101325780635b34b9661461012d5780637423eb3c1461012857806379df72bd1461012357806387201b411461011e5780638814773214610119578063a817440414610114578063a900866b1461010f578063b3a34c4c1461010a578063e7acab2414610105578063ed98a57414610100578063f07ec373146100fb578063f2d12b12146100f6578063f47b7740146100f1578063fb0f3ee1146100ec5763fd9f1e100361000e57610f46565b610191565b610ec2565b610ded565b610d89565b610cc6565b610c0a565b610b8b565b610b24565b610a72565b6108e5565b6107d6565b6105b2565b610493565b6103f0565b610372565b61032e565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9060208282011261018d576004359167ffffffffffffffff831161018d57826102409203011261018d5760040190565b5f80fd5b61019a3661013c565b5061012435600381169060021c60018111913415830361032857600382117f0203020301010000000000000000000000000000000000000000000000000000831a61020f8160a0840260240135877d010102030000000000000000000000000000000000000000000000000000881a87611e80565b9490928060051b6101c4013596610225816106b9565b61027557505060443560243517610268576102509461024391612584565b61024b612649565b6126c5565b610258612715565b60405160018152602090f35b0390f35b636ab37ce75f526004601cfd5b61024b925061025096916102bd9161028b611201565b93848361029882956106b9565b600281036102c257506102b8916101043560e4353360843560c4356122a2565b6123b1565b61245b565b6102cb816106b9565b600381036102eb57506102b8916101043560e4353360843560c4356121af565b806102f76004926106b9565b03610312576102b891606435604435608435336024356122a2565b6102b891606435604435608435336024356121af565b34611e70565b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57602080526707536561706f727460475260606020f35b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d576004355f526001602052608060405f20546040519060ff81161515825260ff8160081c16151560208301526effffffffffffffffffffffffffffff8160101c16604083015260881c6060820152f35b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5761042661275a565b335f525f602052602060405f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43014060801c018091556040518181527f721c20121297512b72821b97f5326877ea8ecf4bb9948fea5bfcb6453074d37f833392a2604051908152f35b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5763929eee1460018154147f00000000000000000000000000000000000000000000000000000000000000009081156105a9575b5061057f575f8080807f0000000000000000000000000000000000000000000000000000000000000000600a5a04fa3d1561057a573d61053b610536826111c7565b611148565b9081525f60203d92013e5b15610550575f9055005b60046040517f70a4078f000000000000000000000000000000000000000000000000000000008152fd5b610546565b60046040517ff45b98b0000000000000000000000000000000000000000000000000000000008152fd5b9050155f6104f4565b3461018d577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60208136011261018d576004359067ffffffffffffffff821161018d5761016090823603011261018d5761062663ffffffff6020921661014461061d82600401615c33565b91013590611245565b604051908152f35b9181601f8401121561018d5782359167ffffffffffffffff831161018d576020808501948460051b01011161018d57565b73ffffffffffffffffffffffffffffffffffffffff81160361018d57565b60a4359061068a8261065f565b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600611156106c357565b61068c565b60809080516106d6816106b9565b83528160208201519173ffffffffffffffffffffffffffffffffffffffff80931660208601526040810151604086015260608101516060860152015116910152565b9081518082526020808093019301915f5b828110610737575050505090565b909192938260e0600192604088516107508382516106c8565b8085015173ffffffffffffffffffffffffffffffffffffffff1660a0840152015160c082015201950193929101610729565b909291604082019160408152845180935260608101926020809601905f5b8181106107c0575050506107bd9394506020818403910152610718565b90565b82511515865294870194918701916001016107a0565b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5767ffffffffffffffff60043581811161018d5761082190369060040161062e565b505060243581811161018d5761083b90369060040161062e565b505060443581811161018d5761085590369060040161062e565b505060643590811161018d5761086f90369060040161062e565b505061088861087c61067d565b60c4359060843561105c565b9061026460405192839283610782565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82011261018d576004359067ffffffffffffffff821161018d576108e19160040161062e565b9091565b3461018d576108f336610898565b5050600461090b63ffffffff600435166004016115e1565b9061091461275a565b8151905f92361515935b8381106109315760405160018152602090f35b61093b81836116ac565b519081519184608084015161094f816116c0565b610958816116c0565b14610a5757825173ffffffffffffffffffffffffffffffffffffffff169261097f81612dad565b610991815f52600160205260405f2090565b9461099d8a8784612e07565b506109b06109ac875460ff1690565b1590565b6109c4575b50505050600191505b0161091e565b60608301515161014084015103610a5257600195610a0c610a37928460207ff280791efe782edcf06ce15c8f4dff17601db3b88eb3805a0db7d77faf757f0498015191612ec8565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b610a46604051928392836117f1565b0390a15f8080806109b5565b612ebb565b50600191506109be565b9060206107bd928181520190610718565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5760043567ffffffffffffffff80821161018d57610abc368360040161062e565b505060243590811161018d5761026491610b1091610add368260040161062e565b5050610b08610af563ffffffff8094166004016118e9565b92610afe6111a4565b9216600401611948565b9033926119ce565b604051918291602083526020830190610718565b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5773ffffffffffffffffffffffffffffffffffffffff600435610b748161065f565b165f526002602052602060405f2054604051908152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60408136011261018d576004359067ffffffffffffffff821161018d57604090823603011261018d57610c00610bec63ffffffff60209316600401611aa3565b610bf46111a4565b90339160243591611bf5565b6040519015158152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60808136011261018d576004359067ffffffffffffffff9081831161018d5760a090833603011261018d5760243590811161018d5761026491610cb491610c75368260040161062e565b5050610ca460643592610c878461065f565b610c9a63ffffffff809216600401611d2f565b9216600401611426565b9133811502019160443591611bf5565b60405190151581529081906020820190565b60a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57600467ffffffffffffffff813581811161018d57610d103682850161062e565b50506024359082821161018d57610d293683860161062e565b505060443592831161018d57610d7a61088894610d483686830161062e565b5050610d5c63ffffffff80941682016118e9565b92610d7281610d696111a4565b961683016114b5565b9516016114b5565b60843593339360643593611514565b3461018d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d576020610626600435610dc98161065f565b73ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f205490565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d5767ffffffffffffffff6004803582811161018d57610e373682840161062e565b50506024359083821161018d57610e503683850161062e565b505060443593841161018d5761026493610eaa610eb694610e733684830161062e565b5050610e99610ea260643595610e888761065f565b63ffffffff928380921685016113c7565b97168301611426565b931601611948565b913381150201926119ce565b60405191829182610a61565b3461018d575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018d57610ef8613c1a565b60605f5260205273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166040526303312e3660635260a05ff35b3461018d57610f5436610898565b90610f5d61275a565b5f915f5b818110610f7e5783610f795760405160018152602090f35b613cf0565b80610f8c6001928486611d8e565b94610f9686611dce565b907f6bacc01dbe442496068f7d234edd811f1a5f833243e0aec824f86ab861f3c90d610fef610fc760208a01611dce565b92610fd460808b01611dd8565b60048533148733141715911417179861014061061d82615c33565b91611031611005845f52600160205260405f2090565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016610100179055565b60405192835273ffffffffffffffffffffffffffffffffffffffff908116931691602090a301610f61565b906108e1929163ffffffff9161107883600435166004016113c7565b926110898160243516600401611426565b6110a961109c83604435166004016114b5565b92606435166004016114b5565b92338115020194611514565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040519060a0820182811067ffffffffffffffff82111761110257604052565b6110b5565b60405190610160820182811067ffffffffffffffff82111761110257604052565b604051906040820182811067ffffffffffffffff82111761110257604052565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761110257604052565b67ffffffffffffffff81116111025760051b60200190565b6040516020810181811067ffffffffffffffff821117611102576040525f815290565b67ffffffffffffffff811161110257601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b611209611128565b90602082526020828136910137565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b91909161014081018051917f0000000000000000000000000000000000000000000000000000000000000000604051604083018051928351926020809501905f915b868684106113865750505050506040519160051b8220917f00000000000000000000000000000000000000000000000000000000000000009093606086019481865101905f915b8a83106113445750505050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660051b604051209401978851907f00000000000000000000000000000000000000000000000000000000000000008a5282519383528451958552865261018089209852525252565b8380827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0600194510180519089815260e08120875252019201920191906112ce565b80827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0600194510180519088815260c0812087525201920192019190611287565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b84811061140457505050505050565b8061141a87848180958801013516860101611d2f565b828287010152016113f5565b9081359063ffffffff92600593641fffffffe08460051b16906040805191602094858585010183528184981684525f5b8581106114695750505050505050909150565b8083888093850101351683018551908360a091828401895287608093848484018737820135160101908d60018884351601901b8851928184018a52833782015282828801015201611456565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b8481106114f257505050505050565b8061150887848180958801013516860101612879565b828287010152016114e3565b96948093949296611528923615908a6128d4565b93909186519082519261154361153e8585612cee565b612d4b565b98865f5b8b8d8783106115ab5750505050505f5b8481106115735750505050508461156f9495966147a8565b9190565b806115a48b611590868f611589600197896116ac565b5190614665565b61159d88850180936116ac565b528c6116ac565b5001611557565b826115c76001956115cd936115c0848a6116ac565b519061461f565b926116ac565b526115d8818d6116ac565b50018790611547565b9081359163ffffffff641fffffffe08460051b1690604090815190602094858584010184528183981683525f5b85811061161e5750505050505050565b80838880938501013516830161165d838851928984016101a085018b5261164e81848b8186013516850101613046565b8452878a820135160101613078565b838201528282870101520161160e565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8051156116a75760200190565b61166d565b80518210156116a75760209160051b010190565b600511156106c357565b5160058110156106c35790565b9081518082526020808093019301915f5b8281106116f6575050505090565b909192938260a06001928751805161170d816106b9565b82528084015173ffffffffffffffffffffffffffffffffffffffff1684830152604080820151908301526060808201519083015260809081015190820152019501939291016116e8565b9081518082526020808093019301915f5b828110611776575050505090565b909192938260c06001928751805161178d816106b9565b82528084015173ffffffffffffffffffffffffffffffffffffffff9081168584015260408083015190840152606080830151908401526080808301519084015260a091820151169082015201950193929101611768565b9060058210156106c35752565b9081526040602082015261181e60408201835173ffffffffffffffffffffffffffffffffffffffff169052565b602082015173ffffffffffffffffffffffffffffffffffffffff1660608201526101806040830151611895611861610160928360808701526101a08601906116d7565b60608601517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08683030160a0870152611757565b936118a8608082015160c08601906117e4565b60a081015160e085015260c081015191610100928386015260e082015192610120938487015282015192610140938487015282015190850152015191015290565b9081359163ffffffff90641fffffffe08460051b1690604051906020936020848401016040528083971683525f5b84811061192657505050505050565b8061193c87848180958801013516860101611aa3565b82828701015201611917565b9081359163ffffffff641fffffffe08460051b1690604090815190602094858584010184528183981683525f5b8581106119855750505050505050565b8083888093850101351683016119be838851928984018a526119af82898184013516830101612879565b8452878a820135160101612879565b8382015282828701015201611975565b939290816119e39186519036151590886128d4565b9190805160051b6040017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018051907f4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e76020936020835282a152845190611a4a82612d4b565b955f5b838110611a68575050505083611a649495966147a8565b5090565b80611a87818c611a7a600195876116ac565b5187815191015191614bed565b611a91828b6116ac565b52611a9c818a6116ac565b5001611a4d565b906040516102008101604052611ae9819360a08301808452611acf63ffffffff91828435168401613046565b600160208501526001604085015260208201351601613078565b6060820152608060405191602083016040525f83520152565b611b0a611128565b9060018252815f5b60209081811015611b9557602091611b286110e2565b90611b31611107565b5f81525f828201526060905f60408381840152838084015260809282848201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152865281858701528501528180850152830152828501015201611b12565b505050565b611ba2611128565b600181529060203681840137565b90611bbd6105368361118c565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611beb829461118c565b0190602036910137565b909192611cfd93825192608084015191611c0e836116c0565b611c17836116c0565b60048314611c248161315c565b36151590611c5d611c3583866131d2565b93919290929a611c43611b02565b88611c4d8261169a565b52611c578161169a565b506133d1565b611c698884848c61353b565b611c7a611c74611b9a565b976116c0565b611d0a578593611ca08694611ca8948a94611c9a8e611cb89c819c6136db565b8961383b565b505b88613944565b82611cb28361169a565b52613a36565b815173ffffffffffffffffffffffffffffffffffffffff165b602083015173ffffffffffffffffffffffffffffffffffffffff16906060604085015194015194613b3b565b611d05612715565b600190565b505084965091611ca8611d27611cb895939460808401518961361c565b978894611ca2565b9060405161020081016040526080611d898294604060208201602086013760a08401808552611d6863ffffffff91828435168401613046565b611d79816060840135168301613078565b6060860152838201351601613078565b910152565b91908110156116a75760051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea18136030182121561018d570190565b356107bd8161065f565b35600581101561018d5790565b7f000000000000000000000000000000000000000000000000000000000000000080611e51575b15611e1357565b63929eee14805480159182611e42575b5060031415901516611e3157565b63a61be9f05f52346020526024601cfd5b6002905c03611e31575f611e23565b600263929eee145c0315611e0c5763a61be9f05f52346020526024601cfd5b63a61be9f05f526020526024601cfd5b93929190611e8c6130a2565b611e94613cfd565b6101643561014435428211154282111761219c57505061020435610264351061218f57927f00000000000000000000000000000000000000000000000000000000000000006080528360a0526060602460c037604060646101203760e0608090812061016052600161026435016102043560051b6102a08101919091526102c081019586526024906102e00137610160938260a0528360c0525f60e0525f915f5b8261020435821015611f925790604060019261010060a060208560061b99818b610284018537858b61028401610120376102a48b0135179c019760e0608020895201978989528a60c0840152610284019101370195929195611f35565b509550969590916001610204350160051b610160206060525b8261026435871015611fea5790604060a060019301948686528760c08201526101008960061b610284019101376102a48760061b013517950194611fab565b5092509593505073ffffffffffffffffffffffffffffffffffffffff915011612182577f00000000000000000000000000000000000000000000000000000000000000006080528060a052606060c460c03760206101046101203760c06080205f5260205f2060e0526103c0608435916120818373ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f2090565b547f00000000000000000000000000000000000000000000000000000000000000006080526040608460a03760605161010052856101205260a0610144610140376101e090815261018060808181206102043560051b928301818152336101a08501526101c084019290925261012083850152600161020084015261022083019490945292949060609060c49061024001377f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f3160a06102643502938460a435940190a35f6060526102043560051b010160405261156f61216a61216383613d53565b9483613d9e565b93710100000000000000000000000000000100019055565b6339f3e3fd5f526004601cfd5b63466aa6165f526004601cfd5b6321ccfeb75f526020526040526044601cfd5b9590919293946121be86613e6f565b6121c88183613e83565b806121d857505061068a94613f63565b90606495969493929160208251145f1461228f5760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001888401525b02019360037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe48501526004840152602483015260448201520152565b5060c0868201600181510180915261222f565b919396959092946122b38183613e83565b806122d3575050600186036122cd5761068a949550614071565b85614061565b81519697966064969395939492919060200361238c5760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001888401525b02019360027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe48501526004840152602483015260448201520152565b5060c0868201600181510180915261232c565b919082039182116123ac57565b611218565b919082156124485760843592610104353360c43560e4355b612443578360051b6101e40335936102643560061b905f5b8281106123f6575050509561068a9596614133565b87876102848301358c85612422575b9184939161241c936102a46040970135908a614133565b016123e1565b989181612436604096959361241c9561239f565b9a91935091939450612405565b610268565b33926064356084356024356044356123c9565b604081510361258157602081015160c06064830151026044019060205f73ffffffffffffffffffffffffffffffffffffffff9360405194807f00000000000000000000000000000000000000000000000000000000000000001674ff00000000000000000000000000000000000000001783528484527f00000000000000000000000000000000000000000000000000000000000000006040526055600b2016946040528180526040860182865af15f519015612568577fffffffff000000000000000000000000000000000000000000000000000000007f4ce34aa20000000000000000000000000000000000000000000000000000000091160361256357505060209052565b61543d565b82612571614f3d565b63d13d53d45f526020526024601cfd5b50565b60c43592916101043560e43560843583156126005761068a95966125a784613e6f565b604051957f4ce34aa200000000000000000000000000000000000000000000000000000000875260206004880152600160248801526044870152606486015260848501523360a485015260c484015260e4830152614272565b9195925092806126116002926106b9565b03612631576001850361262b5761068a9394503391614071565b84614061565b9084929161264261068a9596613e6f565b3391613f63565b346064355f6102643560061b5b80821061268d575050818111612688576126728160843561435b565b80821161267d575050565b61068a91033361435b565b6126b8565b9092836102840135938185116126b8576126b18560409303956102a483013561435b565b0190612656565b638ffff9805f526004601cfd5b919060a435908133141590600460018211911016166126e357505050565b61270f92601c83516317b1f9428552600163ffffffff82165263fb5014fc60605260801c930191614390565b5f606052565b7f00000000000000000000000000000000000000000000000000000000000000006127515763929eee1480541561274c5760019055565b5f905d565b5f63929eee145d565b7f0000000000000000000000000000000000000000000000000000000000000000806127b9575b1561278857565b63929eee1480549081156127ae575b506001106127a157565b637fa8a9875f526004601cfd5b5c6127a1575f612797565b63929eee145c1561278157637fa8a9875f526004601cfd5b90813563ffffffff811692604051938085526020641fffffffe0819460051b16860101928392602060a080940291018537602086015b8381106128175750505050604052565b848152938201938101612807565b90813563ffffffff811692604051938085526020641fffffffe0819460051b16860101928392602060c080940291018537602086015b83811061286b5750505050604052565b84815293820193810161285b565b908135916040926040519363ffffffff82168552602080641fffffffe08460051b16870101936020643fffffffc0869560061b1691018537602086015b8381106128c65750505050604052565b8481529382019381016128b6565b939492915f946128e26130ff565b5f357c4000000000000000000000000000000000000000000000000000000000169681519361291085611bb0565b9860205b6001870160051b8110612b5757507c400000000000000000000000000000000000000000000000000000000114612b5257612954908392969594936133d1565b5f946020945b6001850160051b8610612979575050505050501561297457565b614612565b909192939495868a01918251918215612b435788860151938215612ad057878d8b608060046129aa828b51016116ca565b6129b3816116c0565b14612ae75750916109ac91877fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ef9560051c01918a61447b565b612ad0576020850190612a556109ac612a1784516effffffffffffffffffffffffffffff1690565b60408901516effffffffffffffffffffffffffffff1690612a398d8b516145dc565b916effffffffffffffffffffffffffffff80911691168961383b565b612ab957505050907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612aa5925b01925184611cd1825173ffffffffffffffffffffffffffffffffffffffff1690565b6001602081975b019594939291905061295a565b602093955060019450905f80929b939b5252612aac565b6001935060208093955f80939c949c520152612aac565b915050612afc9295508651908701519061361c565b8093528215612b315750907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612aa592612a83565b97600192505f60208093950152612aac565b97602091935060019250612aac565b61446e565b8a81860151612b6688826131d2565b6effffffffffffffffffffffffffffff821660208501529093909291908415612ce1576effffffffffffffffffffffffffffff84166040840152850152805160a08101519160c082015191608001519e8f612bc0816116c0565b600110179e815160400151908151905f925b828410612c6b5750505050606090510151938451945f5b868110612c0157505050505050506020905b01612914565b80612c0e600192846116ac565b516080810160a0612c2182518b896143f9565b92612c4a60608201948c8651865181145f14612c5a5750508086525b8a8c36151592885161442b565b8094520190815190525201612be9565b612c64918c6143f9565b8652612c3d565b90919299612c798b836116ac565b519060048410825110179a608082018051612c95908b8d6143f9565b92606001908a8251948d835187145f1496612cc493600198612cd1575050508084525b8a8c361592865161442b565b8092525201929190612bd2565b612cda926143f9565b8452612cb8565b5050505050602090612bfb565b919082018092116123ac57565b604051906060820182811067ffffffffffffffff821117611102576040525f604083612d256110e2565b838152836020820152838382015283606082015283608082015281528260208201520152565b90612d586105368361118c565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0612d86829461118c565b01905f5b828110612d9657505050565b602090612da1612cfb565b82828501015201612d8a565b6060810151516101408201511161218f5780612e0173ffffffffffffffffffffffffffffffffffffffff6107bd93511673ffffffffffffffffffffffffffffffffffffffff165f525f60205260405f205490565b90611245565b91905460ff8160081c16612e63576effffffffffffffffffffffffffffff8160101c169081612e3a575b50505050600190565b60881c1115612e4a578080612e31565b612e5357505f90565b6310fda3e15f526020526024601cfd5b50612e6d57505f90565b631a5155745f526020526024601cfd5b91905460ff8160081c16612e63576effffffffffffffffffffffffffffff915060101c16612eab5750600190565b63ee9e0e635f526020526024601cfd5b632165628a5f526004601cfd5b92919033841461304057612eda613c1a565b93612f1482867f19010000000000000000000000000000000000000000000000000000000000005f5260025260225260425f20905f602252565b908351926002601f601d860116106102e27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9d860110165f146130325760018085169081604103927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60059388010160051c93808952880160209384820151928560238560e81c94019460e31c169081528584519118526001925b8684106130135750505050509661300d9161068a9798612fd160405f209261570a565b5f525260405f20907f19010000000000000000000000000000000000000000000000000000000000005f5260025260225260425f20905f602252565b90614a07565b85859101938684821c841b1660405f2081528786519118520192612fae565b5061068a9495508190614a07565b50509050565b611d8960609161016081853763ffffffff6130688160408401351683016127d1565b6040860152838201351601612825565b9060206040519263ffffffff813563ffffffe0601f82011692848401908737168452830101604052565b7f00000000000000000000000000000000000000000000000000000000000000006130ee5763929eee14805480156130e1576001036127a15760029055565b50805c6127a1576001905d565b63929eee14805c6127a1576001905d565b7f000000000000000000000000000000000000000000000000000000000000000061314b5763929eee148054801561313e576001036127a15760039055565b50805c6127a1576002905d565b63929eee14805c6127a1576002905d565b7f00000000000000000000000000000000000000000000000000000000000000006131ab5763929eee14908154801561319d576001036127a1576002019055565b50815c6127a157600101905d565b63929eee1490815c6127a157600101905d565b90805b6131c9575090565b809106806131c1565b9190918051916131ef6109ac8560a086015160c087015190614d1d565b6133bc576effffffffffffffffffffffffffffff6020816020850151169482604086015116946080820160048151613226816116c0565b61322f816116c0565b146133a35787158789111761339e575191613249836116c0565b600180931615878910166133995761326081612dad565b986132816109ac6132798c5f52600160205260405f2090565b92838d612e07565b61338b5754918960ff841615613357575b5050508060881c918483159260101c1691156132b0575b5050505050565b86979614613343578187146133265786829102950295029385019484861185870302809103958386116132e4575b806132a9565b856132fe926132f8929894959798036131be565b826131be565b8015018091049404928311613315578080806132de565b601190634e487b715f52526024601cfd5b925050508291939201828082119103029003915f808080806132a9565b8103955093505f91508190508080806132a9565b606061337a613383945173ffffffffffffffffffffffffffffffffffffffff1690565b92015191612ec8565b5f8089613292565b505f97508796505050505050565b614d4b565b614d3e565b50505050509250600191021861339e5760019081908290565b5f9350839250829150565b600211156106c357565b81518151925f5b82811061346f575050505f5b8281106133f057505050565b806133fd600192846116ac565b5161343161341d60208301516effffffffffffffffffffffffffffff1690565b6effffffffffffffffffffffffffffff1690565b15613469576134639051604060808201519161344c836116c0565b61345b83606083015187614e36565b015183615d44565b016133e4565b50613463565b61347981836116ac565b518051868110156135285761348e90866116ac565b516020906134b061341d838301516effffffffffffffffffffffffffffff1690565b1561351d57519060409081830151918401519263bfb3f8ce918501516134d5816133c7565b6134de816133c7565b61350a575b5081518310156135025750916134fc9160019493614d74565b016133d8565b5f526004601cfd5b9050606091500151636088d7de5f6134e3565b5050506001906134fc565b6020820151613536816133c7565b614d58565b60a08082015160c0830151604084018051513615985f989597959492895b8381106135d7575050505060809660046080870151613577816116c0565b1016612b52576060948501805151981593905f5b8a811061359f575050505050505050505050565b808a8a8a8a6135cb8b8b8b8b6135b860019b8d516116ac565b51968701958651998801998a5190614e92565b9052015190520161358b565b82888d838551906135e7916116ac565b519d8e516135f4816106b9565b15179d60608101918a8a8d85519460800196875161361196614e92565b905252600101613559565b919091606081019182515161014083015103612ebb575f8061365c613655855173ffffffffffffffffffffffffffffffffffffffff1690565b9685614ed1565b9082885af19361368a8173ffffffffffffffffffffffffffffffffffffffff165f52600260205260405f2090565b9081549160018301905560601b1893156136c25750604001906136b08251825190615c7f565b9390916136bc57525290565b84614f86565b9150506136ce57505f90565b6136d6614f3d565b614f86565b91825190608082015160058110156106c357602083019261372073ffffffffffffffffffffffffffffffffffffffff9283865116331415906004600182119110161690565b61372d575b505050505050565b61381a601c91608061382c980151965f6040519889936301e4d72a85526020808601528860408601523360608601528051608086015260a081015161012086015261014060c08201518187015260e08201516101608701528060a08701526138016040830151936137d76137a761018096878b0190615b45565b80850160c08b01526137c2606087015188838d010190615bb9565b019184830160e08b015286838b010190615ba0565b0193610100928501838901528085890101946137f38689615c03565b016101648101980101604052565b828660401b8d60801b1717910152525160051b9061239f565b9463fb5014fc60605201925116614390565b5f6060525f8080808080613725565b61384d815f52600160205260405f2090565b935f938554948560881c90811561393a57506effffffffffffffffffffffffffffff809660101c1681831461392b578282910292029402019383851190808511818711176138f3575b505b6138b057505060881b9060101b176001179055600190565b92509250505f146138ee576040517f10fda3e10000000000000000000000000000000000000000000000000000000081526004810191909152602490fd5b505f90565b93946138ff86826131be565b80150180910495049380851190861117613919575f613896565b634e487b715f5260116020526024601cfd5b92955050920192828411613898565b9550509293613898565b92919092613950611201565b916040820190815151915f5b8381106139ed5750505050606080910190815151915f5b83811061399c575050505061398991925061245b565b47806139925750565b61068a903361435b565b6139a78183516116ac565b5190858883516139b6816106b9565b6139bf816106b9565b156139da575b906139d491600194339061516a565b01613973565b50504784830151116126885785886139c5565b80613a30876139ff60019486516116ac565b51866080820152613a24895173ffffffffffffffffffffffffffffffffffffffff1690565b6101208a01519161516a565b0161395c565b919091805192608084019182519260058410156106c357613a846020870194613a73865173ffffffffffffffffffffffffffffffffffffffff1690565b331415906004600182119110161690565b15613aaf575050613a9d9061010061270f950151615416565b9290915163fb5014fc5b606052614390565b60049195935051613abf816116c0565b613ac8816116c0565b03613af55761270f93613ae89183519360808560601b9301519086615392565b9290916393979285613aa7565b50505050565b9081518082526020808093019301915f5b828110613b1a575050505090565b909192938260a082613b2f60019489516106c8565b01950193929101613b0c565b9094939173ffffffffffffffffffffffffffffffffffffffff91604090604051956080926080880192885285602092166020890152608060408901528651809352602060a089019701935f915b848310613bd6575050505050508282859493613bd193867f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31989603606087015216971695613afb565b0390a3565b90919293949784836001928b518051613bee816106b9565b8252808401518c1684830152858101518683015260609081015190820152019901959493019190613b88565b467f000000000000000000000000000000000000000000000000000000000000000003613c65577f000000000000000000000000000000000000000000000000000000000000000090565b6040516080517f00000000000000000000000000000000000000000000000000000000000000005f527f00000000000000000000000000000000000000000000000000000000000000006020527f0000000000000000000000000000000000000000000000000000000000000000604052466060523060805260a05f20916040525f60605260805290565b63fed398fc5f526004601cfd5b7401000000000000000000000000000000000000000060243560c4351760a43560843517171060186101243510166102643560061b61026001610244351461024061022435146020600435141616161561218257565b90815f52600160205260405f2091613d6e3615158483612e7d565b5060ff83541615613d7c5750565b61068a90613d95602463ffffffff610244351601613078565b90608435612ec8565b91905f9260a43591823314159060046001821191101616613dbd575050565b9092506102043560051b90613e5d82608001926301e4d72a8452602060a08201528260c08201523360e082015260843561010082015260606101446101a08301376101e06101408061012084015282015260a06102643502956102a08701610160830152868201935f6103608601526102c08801610180840152806103a06103808701965f8852015263fb5014fc606052609c6103048901930191614390565b5f60605261032482940160801b179052565b15613e7657565b6391b3e5145f526004601cfd5b90602082015103613e915750565b61068a9061245b565b9060649492939160208251145f14613f505760c0906001906040845260208401527f4ce34aa2000000000000000000000000000000000000000000000000000000006040840152602060448401526001878401525b02019260017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc48501527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe4840152600483015260248201525f60448201520152565b5060c08582016001815101809152613eef565b9293919091833b1561405057604051946080519260a0519460c051967ff242432a000000000000000000000000000000000000000000000000000000005f528160045282602452836044528460645260a06084525f60a4525f8060c48180855af115613fe057505050505060805260a05260c0526040525f606052565b883d614004575b5063f486bc875f5260205260405260605260805260a05260a4601cfd5b601f3d0160051c9060051c908060030291808211614037575b505060205a91011061402f5785613fe7565b3d5f803e3d5ffd5b8080600392028380020360091c9203020101868061401d565b83635f15d6725f526020526024601cfd5b6369f958275f526020526024601cfd5b929190833b1561405057604051937f23b872dd000000000000000000000000000000000000000000000000000000005f528160045282602452836044525f8060648180855af1156140c957505050506040525f606052565b843d6140ef575b5063f486bc875f52602052604052606052608052600160a05260a4601cfd5b601f3d0160051c9060051c90806003029180821161411a575b505060205a91011061402f57846140d0565b8080600392028380020360091c92030201018580614108565b9394909461414084613e6f565b61414a8183613e83565b80614264575050604051937f23b872dd000000000000000000000000000000000000000000000000000000005f5280600452816024528260445260205f60648180885af1803d15601f3d1160015f51141617163d15158116156141b7575b5050505050506040525f606052565b80863b1515166141a857908691156141da5785635f15d6725f526020526024601cfd5b908591156141fc575063988919235f526020526040526060526080526084601cfd5b3d614220575b5063f486bc875f526020526040526060525f60805260a05260a4601cfd5b601f3d0160051c9060051c90806003029180821161424b575b505060205a91011061402f5784614202565b8080600392028380020360091c92030201018580614239565b9061068a9592939491613e9a565b60205f61010473ffffffffffffffffffffffffffffffffffffffff9460405195807f00000000000000000000000000000000000000000000000000000000000000001674ff00000000000000000000000000000000000000001784528585527f00000000000000000000000000000000000000000000000000000000000000006040526055600b20169560405282805282865af15f519015612568577fffffffff000000000000000000000000000000000000000000000000000000007f4ce34aa200000000000000000000000000000000000000000000000000000000911603612563575050565b61436482613e6f565b5f80808085855af115614375575050565b61437d614f3d565b63bc806b965f526020526040526044601cfd5b91602091935f91827fffffffff00000000000000000000000000000000000000000000000000000000825116958180525af1905f511490156143dd57156143d45750565b6080526024607cfd5b506143d4614f3d565b818102929181159184041417156123ac57565b919091828114614425578281830961441857614414916143e6565b0490565b63c63cf0895f526004601cfd5b50905090565b9392909384810361443d575050505090565b61445383614459930393420391828503906143e6565b946143e6565b83018093116123ac5781830304019015150290565b6312d3f5a35f526004601cfd5b9193929382519460808601519060058210156106c35760208701936144c473ffffffffffffffffffffffffffffffffffffffff9384875116331415906004600182119110161690565b6144d5575050505050505050600190565b6107bd976145c9836145d293601c956145b5608060409c0151958a8d519d8e6301e4d72a815260208082015201528c6060339101528c608082519101528c61012060a083015191015260a08d61014091829160c08501518382015260e085015161016082015201528d6040830151986145876145576101809b8c850190615b45565b80850160c085015261457260608701518d8387010190615bb9565b019184830160e08501528b8385010190615ba0565b01906101009282018382015289828201019485926145a5848a615c03565b019a6101648c019b830101604052565b8960401b9060801b1717910152525161239f565b60051b9061239f565b9401925116615450565b60808101519060058210156106c35773ffffffffffffffffffffffffffffffffffffffff60206001920151163314159111161790565b63d5da9a1b5f526004601cfd5b92919261462a612cfb565b938251156146545761068a9273ffffffffffffffffffffffffffffffffffffffff869216926155d1565b63375c24c15f525f6020526024601cfd5b92919092614671612cfb565b93805115614796575f92915f925f928091815160059060051b83015b8085106146be575050505050505080916060855101526146aa5750565b600103613919576391b3e5145f526004601cfd5b6020809501948551518751811015614739578190841b88010151908087510151916060928284835101519201511582518210151761478a575f918391871b0101519283019a8c8c518091019d8e9115911060011b17179b9a528c518d8a1560011461473e5750505060a090208718614739575b97969761468d565b6154c1565b83929a5090869160a0945182528b8401518c8301526040918285015183820152608080860151910152338c820152015220968401858118614780575b50614731565b855190525f61477a565b50505050979697614731565b63375c24c15f5260016020526024601cfd5b939190938051926147b884611bb0565b956147c1611201565b90600196600182510160051b6020928360205b8381106149a357505050505f5b878110614871575050506147f49061245b565b4780614861575b5061480d575b505050506107bd612715565b5f5b83811061481c5750614801565b8061483161482b8793896116ac565b51151590565b61483c575b0161480f565b61485c61484982856116ac565b518561485584826116ac565b5191613a36565b614836565b61486b903361435b565b5f6147fb565b61487b81876116ac565b518961489b61341d868401516effffffffffffffffffffffffffffff1690565b1561498f5791906148b56148af838e6116ac565b60019052565b5160408101518051905f5b82811061491f57505050606080910151908151915f5b8381106148e857505050505b016147e1565b9091929394506148f881836116ac565b5183810190815180614918575060a0015190528c949392919085016148d6565b83886156f4565b61492e818394959697936116ac565b5160806060820191825161494d575b0151905201908c949392916148c0565b608081018051908b90526149868d6149798b5173ffffffffffffffffffffffffffffffffffffffff1690565b6101208c0151908561516a565b8282015261493d565b9190505f61499d828d6116ac565b526148e2565b8083015180516060810151806149bf575b5050500184906147d4565b909193504710815115166126b857876149ff918460406149f68b8098015173ffffffffffffffffffffffffffffffffffffffff1690565b9101519161516a565b5f80806149b4565b909291925f80528451947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101805190876041035f9060018111958615614b84575b5050851485151516978815614a7d575b505050505050505015614a6857565b614a70614f3d565b634f7fb80d5f526004601cfd5b909192939495809798508452604082527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbc8401938451957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082019760205f60648b519c7f1626ba7e000000000000000000000000000000000000000000000000000000009e8f8c528d520189845afa9a8b614b28575b50505050505252525f80808080808080614a59565b5f5103614b355780614b13565b3b614a7057614b775760600190604164010100000083515f1a1a15911416614b645763815e1d645f526004601cfd5b631f003d0a5f52515f1a6020526024601cfd5b638baa579f5f526004601cfd5b909150604085019081519260608701515f1a90614bbb575b8652835260205f60808560015afa50838352898552525f515f80614a49565b50601b8360ff1c017f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84168352614b9c565b9192614bf7612cfb565b9380511583511517614d1057614c0b612cfb565b92614c178483876154ce565b8351926060840194855115614d055750614c53614c4b608086015173ffffffffffffffffffffffffffffffffffffffff1690565b8884896155d1565b865193604081015160408601511890602081015160208701511890518651181717614cf55750606084519301928351105f14614cc257509160206060614caf614cbc94614ca0839761169a565b519451905185519103976116ac565b51510151910151906116ac565b51015290565b60609150614cd5614cec9195939561169a565b5160206040614caf885188519003968451906116ac565b51015251905290565b63bced929d5f526020526024601cfd5b965050505050505090565b6398e9db6e5f526004601cfd5b428082111590831116939280614d36575b61219c575050565b508315614d2e565b635a052b325f526004601cfd5b63a11b63ff5f526004601cfd5b63133c37c65f526020526024601cfd5b614d71826106b9565b52565b90614d7e916116ac565b51805191614d8b836106b9565b6003831115614e29576040820180519093908015614dec57927ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe614de692614ddf6060968787015190608088015191615af3565b0190614d68565b01519052565b50608082015151614e24576060927ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe614de692614ddf565b615ae6565b6394eb6af65f526004601cfd5b815192915f5b848110614e4a575050505050565b614e5481836116ac565b518051614e60816106b9565b60036040809301511515600488141517911116614e805750600101614e3c565b8363a8930e9a5f52602052526044601cfd5b959192939490948587145f14614eaf575050506107bd93506143f9565b92919484614ec56107bd98614ecb9497866143f9565b936143f9565b9061442b565b9190608490614f38604051916398919765835260a0601c84019633602086015260806040860152614f246060614f0e604084015185890190615b45565b9283608001828901520151838388010190615b45565b018094608082016080820152010190615ba0565b010190565b3d614f4457565b601f3d0160051c60405160051c908060030291808211614f6d575b505060205a91011061402f57565b8080600392028380020360091c92030201015f80614f5f565b63939792855f526020526024601cfd5b92909260405193815190602092602060c087028801016040528587526020918660010160051b93848901928160010160051b019781810382821002820160010160051b9111975b81851061501a5750505b838310614ff5575050505050565b60a0859183858b01526080908181863e60608501518286015201920192019190614fe7565b9390949197869084838c0152608090818b873e60608087015190818489015288015111615047878961510a565b171799019360a08091019501910194909493929194614fdd565b9290604051938051908185119482808203911002820191602092602060e0820289010160405280885260209060010160051b928389019260010160051b01915b8382106150b057505050505050565b9091929380959782848b015260a090818a853e606083818c018487013e8481015190870151608080870151908901518015911417159111176150f2858861510a565b1717980195949360c0908101939190910191016150a1565b9081519160408101518015600385111661513a575b60208091604085015114948451149301519101511416161590565b5060408201517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9093019261511f565b9290918351615178816106b9565b615181816106b9565b615216575050506151c56151ac602083015173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff60408301519116176124435780606061520d608061068a94015173ffffffffffffffffffffffffffffffffffffffff1690565b9101519061435b565b90919260018151615226816106b9565b61522f816106b9565b036152a65760408101516124435761068a93615262602083015173ffffffffffffffffffffffffffffffffffffffff1690565b9073ffffffffffffffffffffffffffffffffffffffff606061529b608086015173ffffffffffffffffffffffffffffffffffffffff1690565b940151931691614133565b92600284516152b4816106b9565b6152bd816106b9565b0361532a57836152e7602061068a96015173ffffffffffffffffffffffffffffffffffffffff1690565b608082015173ffffffffffffffffffffffffffffffffffffffff169273ffffffffffffffffffffffffffffffffffffffff606060408501519401519416916122a2565b8361534f602061068a96015173ffffffffffffffffffffffffffffffffffffffff1690565b608082015173ffffffffffffffffffffffffffffffffffffffff169273ffffffffffffffffffffffffffffffffffffffff606060408501519401519416916121af565b9493919260c060a494615402614f38946040519663f4dd92ce8852601c88019a1860a088015260a060208801526153ec60606153d56040840151878b0190615b45565b928360a00160408b0152015185838a010190615bb9565b019160a083016060880152838388010190615ba0565b01809460a082016080820152010190615c03565b916125818360801c9263ffffffff601c818760401c16956317b1f942815201951690615c03565b631cf99b265f526020526040526044601cfd5b925f906020929593827fffffffff00000000000000000000000000000000000000000000000000000000825116968180525af1915f511491156154a95750156154995750600190565b63fb5014fc5f526020526024601cfd5b9050919091156154bc5750615499614f3d565b5f9150565b637fda72795f526004601cfd5b909291925f905f925f9180805160059060051b82015b8084106155005750505050505060608293945101526146aa5750565b6020979697809401938451518651811015614739578190841b8701015190808651015191606092828483510151920151158251821015176155c5575f918391871b010151928301998a519b8c81019c15908d1060011b17179a99528b518c89156001146155795750505060a090208618614739576154e4565b829950905f8493819360a0965184528186015182850152604093848701518582015260808088015191015201528d0152209583018481186155bb575b506154e4565b845190525f6155b5565b505050509695966154e4565b81519294935f93849384929091825b8160051b840181106156015750505050505060608293945101526146aa5750565b6020909796970190855182515110156147395781516020815160051b880101516020815192015160206040840151920151158251821015176156e9579060209160051b0101515f60608201998a519081158d8381011060011b17179b0199528b51871560011461569557506060902086189060408c0151610120820151189060208d01519051181717614739575b906155e0565b9160609397506040826101209351855260208101516020860152015160408401528560808401528c60208251910152015160408c01522093602084018281186156df575b5061568f565b825190525f6156d9565b50505096959661568f565b63a5f542085f526020526040526060526064601cfd5b600981106159a2576011811061585e57601581106157c057601781106157755760177f403be09941a31d05cfc2f896505811353d45d38743288b016630cce39435476a9114027f1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c1890565b60157fbb40bf8cea3a5a716e2b6eb08bbdac8ec159f82f380783db3c56904f15a43d049114027f3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d1890565b601381106158135760137f54b3212a178782f104e0d514b41a9a5c4ca9c980bf6597c3cecbf280917e202a9114027f5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e643500171890565b60117f2d7a3ed6dab270fdb8e054b2ad525f0ce2a8b89cc76c17f0965434740f673a559114027fc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d858771890565b600d811061590457600f81106158b957600f7fcc4886e37eedd9aacd6c1c2c9247197a621a71282e87a7cbc673f3736d9aa1419114027f1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde81890565b600d7f8df51df98847160517f5b1186b4bc3f418d98b8a7f17f1292f392d79d600d79e9114027f6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a8525901890565b600b811061595757600b7f32f4e7485d6485f9f6c255929b9905c62ba919758bbe231f231eaeecf33d810c9114027fbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f1890565b60097f6f0ec38c21f6f583ab7f3c5413c773ffd5344c34fde1d390958e438bf667448f9114027fd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da051890565b60058110615a4857600781106159fd5760077fb58d772fb09b426b9dece637f61ca9065f2b994f1464b51e9207f55f7c8f59489114027f7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc141890565b60057f25d02425402d882d211a7ab774c0ed6eca048c4d03d9af40132475744753b2a39114027f1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b551890565b60038110615a9b5760037ff3e8417a785f980bdaf134fa0274a6bf891eeb8195cd94b09d2aa651046e28bc9114027fa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af11890565b60017f832c58a5b611aadcfa6a082ac9d04bace53d8278387f10040347b7e98eb5b3029114027fbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde301890565b6309bde3395f526004601cfd5b9190915f5260209060205f20916020820191602081519160059260051b0101905b818410615b26575050505003615ae657565b8351808611821b9586529483189490945260405f209392820192615b14565b9081519081815260209283808083019301918460051b0101915b84838210615b72575050505060071b0190565b8160809251805185528281015183860152604080820151908601526060809101519085015201910190615b5f565b8051603f0163ffffffe016929161068a91849190615c23565b80519182815260208080808501948660051b01019201925b828110615be5575050505060a00260200190565b60a090818581835160045afa153d151761018d578201930192615bd1565b615c1f602092839283815180845260051b948593019101615c23565b0190565b829060045afa153d151761018d57565b604051906101608201604052615c71610140918281853763ffffffff615c608160408401351683016127d1565b604086015260608201351601612825565b806060840152519082015290565b90915f925f9260603d10915f905f925f905f938615615cdc575b8615615cab575b505050505050929190565b615cc4939495995060209850615cce9650880190614f96565b9590960190615061565b9092175f8080808080615ca0565b509450925060405f803e5f51926020948551943d878201113d8888011117968715615d08575b50615c99565b9450809650849192505f3e5f51908385813e835193808560a0028701013d10908360071b8801013d101761ffff8584171117955f80525f615d02565b815192915f5b848110615d58575050505050565b615d6281836116ac565b518051615d6e816106b9565b60036040809301511515600488141517911116615d8e5750600101615d4a565b8363d69293325f52602052526044601cfdfea164736f6c6343000818000a","sourceMap":"3731:1283:20:-:0;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;2721:155:24;;:::i;:::-;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;3731:1283:20;;;;;;:::i;:::-;;6549:553:23;;;;;;;;;;;7309:254;;;;;7727:93;;6549:553;8288:1122;;;;;9536:233;8288:1122;;;;;;;;;;;9536:233;;:::i;:::-;9962:321;;;;;;;;;3731:1283:20;;;;:::i;:::-;10344:47:23;;10607:661;;;;8288:1122;10607:661;;;;16060:15;11411:10;;;;:::i;:::-;;;:::i;:::-;16060:15;:::i;:::-;;;:::i;:::-;3731:1283:20;;6549:553:23;3731:1283:20;;;;;;;;;10607:661:23;;-1:-1:-1;10607:661:23;3731:1283:20;10607:661:23;;10340:5536;15853:11;11980:30;;16060:15;11980:30;;15717:11;11980:30;;;:::i;:::-;3731:1283:20;;;;;;;:::i;:::-;6549:553:23;12110:44;;6549:553;;24767:61:2;12899:11:23;24767:61:2;17144:5:14;24767:61:2;17090:4:14;24767:61:2;12559:10:23;16932:4:14;9857:61:2;17032:4:14;9857:61:2;12899:11:23;:::i;:::-;15717;:::i;:::-;15853;:::i;12106:3433::-;3731:1283:20;;;:::i;:::-;6549:553:23;12953:45;;6549:553;;24767:61:2;13744:11:23;24767:61:2;17144:5:14;24767:61:2;17090:4:14;24767:61:2;13404:10:23;16932:4:14;9857:61:2;17032:4:14;9857:61:2;13744:11:23;:::i;12949:2590::-;3731:1283:20;;;;;:::i;:::-;13798:44:23;3731:1283:20;;14611:11:23;24767:61:2;16882:4:14;24767:61:2;16820:4:14;24767:61:2;16932:4:14;9857:61:2;14123:10:23;8288:1122;9857:61:2;14611:11:23;:::i;13794:1745::-;15495:11;24767:61:2;16882:4:14;24767:61:2;16820:4:14;24767:61:2;16932:4:14;9857:61:2;15007:10:23;8288:1122;9857:61:2;15495:11:23;:::i;7727:93::-;7309:254;7795:9;:::i;3731:1283:20:-;;;;;;;;;;;4490:127;;;;;;;;;3731:1283;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;35133:12:36;3731:1283:20;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1391:18:28;;:::i;:::-;1666:811;3731:1283:20;1666:811:28;3731:1283:20;1666:811:28;;;;3731:1283:20;1666:811:28;;;;;;;;;;;;;;3731:1283:20;;;;2545:42:28;1666:811;;2545:42;;1666:811;3731:1283:20;;;;;;;;;;;;;;;;3639:154:37;;;;;3876:21;:43;;;;;3731:1283:20;3872:105:37;;;3731:1283:20;4070:18:37;;;;18516:2;18504:9;3731:1283:20;18469:55:37;3731:1283:20;;;;;23783:4:14;;;;:::i;:::-;;:::i;:::-;;;;3731:1283:20;;;;;;;4058:31:37;4054:89;;3731:1283:20;4190:87:37;;3731:1283:20;4054:89:37;3731:1283:20;;;4112:20:37;;;;3731:1283:20;;;3872:105:37;3731:1283:20;;;3942:24:37;;;;3876:43;3901:18;;;3876:43;;;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36422:266:24;803:10:2;3731:1283:20;3237:40:2;;3757:65;36452:113:24;3757:65:2;3731:1283:20;3757:65:2;36452:113:24;:::i;:::-;3757:65:2;;24767:61;36422:266:24;;:::i;:::-;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;:::o;:::-;;;;;;;:::i;:::-;:::o;:::-;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;:::o;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;24026:1973:24;3731:1283:20;;:::i;:::-;;;;;;24026:1973:24;:::i;:::-;3731:1283:20;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;:::i;:::-;;;;;803:10:2;3731:1283:20;24767:61:2;3237:40;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;31036:14:36;;;:::i;:::-;3731:1283:20;;31574:13:36;-1:-1:-1;3731:1283:20;;6450:19:33;;31569:2191:36;31589:15;;;;;;3731:1283:20;;6549:553:23;3731:1283:20;;;;;31606:3:36;31689:9;;;;:::i;:::-;;31808:16;;;31888:25;;;;;3731:1283:20;;;;:::i;:::-;;;;:::i;:::-;31888:47:36;31884:102;;3731:1283:20;;;;32206:96:36;;;;:::i;:::-;32410:23;;3731:1283:20;;32410:12:36;3731:1283:20;;;;;;;32410:23:36;32528:255;;;;;;:::i;:::-;;32872:24;3731:1283:20;;;;;;;;32872:24:36;;3731:1283:20;32872:24:36;32868:878;;31606:3;;;;;3731:1283:20;31606:3:36;;31574:13;3731:1283:20;31574:13:36;;32868:878;33092:29;;;;3731:1283:20;33156:47:36;;;3731:1283:20;33092:111:36;33063:263;;3731:1283:20;33439:15:36;;33549:30;33439:15;;;33685:42;33439:15;;;;;:::i;:::-;32410:12;3731:1283:20;;;;;;;;33549:30:36;33685:42;3731:1283:20;;33685:42:36;;;;;:::i;:::-;;;;32868:878;;;;;;33063:263;;:::i;31884:102::-;31959:8;3731:1283:20;31959:8:36;;;;3731:1283:20;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;28265:437:24;3731:1283:20;;;;;;;:::i;:::-;803:10:2;;3731:1283:20;;803:10:2;3237:40;;;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;28439:25:24;;;:::i;:::-;2806:59:2;;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;28678:10:24;;28265:437;;:::i;:::-;3731:1283:20;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;-1:-1:-1;3731:1283:20;39813:15:24;3731:1283:20;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8801:294:24;3731:1283:20;803:10:2;3731:1283:20;3237:40:2;;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;8968:25:24;;:::i;:::-;9075:10;;3731:1283:20;;;8801:294:24;;:::i;:::-;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12487:459:24;3731:1283:20;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;803:10:2;3237:40;;;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;2806:59:2;;3731:1283:20;3757:65:2;3731:1283:20;:::i;:::-;3779:180:33;;;;;;3731:1283:20;;;12487:459:24;;:::i;:::-;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;17375:979:24;3731:1283:20;;;;;;;:::i;:::-;803:10:2;;3731:1283:20;803:10:2;3237:40;;;3757:65;;3731:1283:20;:::i;:::-;17591:25:24;3731:1283:20;17591:25:24;;;:::i;:::-;2806:59:2;;3757:65;;3731:1283:20;:::i;:::-;2806:59:2;;3757:65;3731:1283:20;:::i;:::-;;;18296:10:24;;3731:1283:20;;;17375:979:24;;:::i;3731:1283:20:-;;;;;;;;;;;;;;;;;;:::i;:::-;;;3010:9:28;3731:1283:20;3010:9:28;3731:1283:20;;;3010:9:28;3731:1283:20;;38472:203:24;;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;32885:670:24;3731:1283:20;;;;;;;:::i;:::-;;;;;;;;;;;:::i;:::-;803:10:2;3237:40;;;;;3757:65;;3731:1283:20;:::i;:::-;2806:59:2;;3757:65;;3731:1283:20;:::i;:::-;2806:59:2;;3757:65;3731:1283:20;:::i;:::-;3779:180:33;;;;;;32885:670:24;;:::i;:::-;3731:1283:20;;;;;;;:::i;:::-;;;;;;;;;;;13082:18:32;;:::i;:::-;13329:393;3731:1283:20;13329:393:32;;;3731:1283:20;13225:19:32;3731:1283:20;13329:393:32;;;;;;3731:1283:20;13329:393:32;3731:1283:20;;;;;;;:::i;:::-;27494:14:36;;;:::i;:::-;-1:-1:-1;28094:13:36;-1:-1:-1;28109:15:36;;;;;;29929:88;;;3731:1283:20;;6549:553:23;3731:1283:20;;;;;29929:88:36;;:::i;28094:13::-;28218:9;;29460:12;28218:9;;;;:::i;:::-;28264:13;;;;:::i;:::-;28310:10;29755:40;29119:233;28310:10;;;;;:::i;:::-;28360:15;;;;;;:::i;:::-;3731:1283:20;28394:687:36;;;;;;;;;;;;29157:142;29321:13;29157:142;;;:::i;29119:233::-;29460:23;29622:30;29460:23;;3731:1283:20;;32410:12:36;3731:1283:20;;;;;;;29460:23:36;3731:1283:20;;;;;;;;;29622:30:36;3731:1283:20;;;;;;;;;;;;;;29755:40:36;3731:1283:20;28094:13:36;;24026:1973:24;;24845:1147;24026:1973;;803:10:2;24767:61;3731:1283:20;24767:61:2;579:4;24767:61;3237:40;579:4;3757:65;3731:1283:20;:::i;:::-;24767:61:2;3731:1283:20;24767:61:2;3757:65;24767:61;2806:59;579:4;3757:65;3731:1283:20;:::i;:::-;;;24767:61:2;3757:65;24767:61;2806:59;579:4;3757:65;3731:1283:20;:::i;:::-;24767:61:2;3757:65;24767:61;2806:59;579:4;3757:65;3731:1283:20;:::i;:::-;3779:180:33;;;;;;24845:1147:24;;:::i;3731:1283:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;:::i;:::-;;;;;;;;;;;;;;;;;;:::o;:::-;23783:4:14;3731:1283:20;;23783:4:14;3731:1283:20;;;;;;;;;;;23783:4:14;3731:1283:20;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;:::o;23783:4:14:-;;;;;;3731:1283:20;;;;23783:4:14;;;:::o;:::-;;;:::i;:::-;;4482;23783;;4482;23783;;;;;;:::o;3731:1283:20:-;;;;;;;;;;2183:7419:32;;;;2473:47;;;3731:1283:20;;3049:20:32;;3160:1711;;;;;;;;;;;;;;;;-1:-1:-1;3160:1711:32;;;;;;;;;;;;;;;;;;;;5087:28;;5206:1860;;;;;;;;;;;-1:-1:-1;5206:1860:32;;;;;;;;;;;;3160:1711;5206:1860;3160:1711;5206:1860;3160:1711;5206:1860;;7274:2322;;;;;7167:15;;7274:2322;;;;;;;;;;;;;;;;;;;;;;2183:7419::o;5206:1860::-;;;;3160:1711;;5206:1860;;;;;;;;;;;;;;;;;;;;;;;;3160:1711;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27601:1325:26;;24767:61:2;;803:10;;7623:3:14;;;;;;1218:118:2;;;4482:4:14;;1218:118:2;4482:4:14;1218:118:2;;;;;;28110:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;28565:19:26;;;;;;27601:1325;;;;;;:::o;28586:17::-;3757:65:2;28827:50:26;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;;28827:50:26;:::i;:::-;8327:63:2;;;;;3731:1283:20;7444:4:14;28545:18:26;;20356:1334;;24767:61:2;;803:10;;7623:3:14;;;;;;;;1218:118:2;;;;4482:4:14;;1218:118:2;;;;;;;;20868:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;21323:19:26;;;;;;20356:1334;;;;;;;;;;:::o;21344:17::-;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;1218:118;;6816:4:14;;;1218:118:2;;;;;;7042:4:14;;3757:65:2;;;;;4054:61;;3757:65;;24767:61;2806:59;3757:65;;24767:61;;18420:1:26;24767:61:2;;;9418:40;7444:4:14;7623:3;;1218:118:2;;;;;;;;4054:61;;8327:63;;3731:1283:20;8327:63:2;;;;;3731:1283:20;7444:4:14;21303:18:26;;25738:1350;;24767:61:2;;803:10;;7623:3:14;;;;;;1218:118:2;;;4482:4:14;;1218:118:2;4482:4:14;1218:118:2;;;;;;26260:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;26715:19:26;;;;;;25738:1350;;;;;;:::o;26736:17::-;3757:65:2;26981:58:26;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;;26981:58:26;:::i;:::-;8327:63:2;;;;;3731:1283:20;7444:4:14;26695:18:26;;6643:1571:34;;;;;;;;7610:209;6643:1571;7067:8:33;:20;7610:209:34;;;:::i;:::-;3731:1283:20;;;;;;;;34890:55:34;34861:94;34890:55;;;;:::i;:::-;34861:94;:::i;:::-;35126:13;;-1:-1:-1;35141:26:34;;;;;;;;35657:13;;;;;-1:-1:-1;35672:34:34;;;;;;36251:174;;;;;;;;;;;:::i;:::-;7909:298;6643:1571;:::o;35708:3::-;36025:28;35867:287;36025:28;35908:246;36025:28;;;3731:1283:20;36025:28:34;;;:::i;:::-;;35908:246;;:::i;:::-;35867:287;7444:4:14;;;35867:287:34;;;:::i;:::-;;;;:::i;:::-;;3731:1283:20;35657:13:34;;35169:3;35453:20;35328:235;3731:1283:20;35453:20:34;35328:235;35453:20;;;;;:::i;:::-;;35328:235;;:::i;:::-;;;:::i;:::-;;;;;;:::i;:::-;;3731:1283:20;35126:13:34;;;;22112:1301:26;;24767:61:2;;803:10;;7623:3:14;;;;;1218:118:2;;;;;4482:4:14;;1218:118:2;;;;;;;;22613:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;23068:19:26;;;;;;22112:1301;;;;;;;:::o;23089:17::-;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;11656:54:26;1218:118:2;;;;;;;;;;;;10671:4:26;3757:65:2;;;;;;24767:61;3237:40;3757:65;;;10671:4:26;:::i;:::-;3731:1283:20;;3757:65:2;;;;24767:61;2806:59;3757:65;;11656:54:26;:::i;:::-;8327:63:2;;;3731:1283:20;8327:63:2;;;;;3731:1283:20;7444:4:14;23048:18:26;;3731:1283:20;;;;;;;;;;;;;;;;;;;:::o;:::-;;:::i;:::-;;;;;;;;;;;;;;;:::o;:::-;;-1:-1:-1;3731:1283:20;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;16184:1349:26:-;;24767:61:2;;803:10;;7623:3:14;;;;;;1218:118:2;;;4482:4:14;;1218:118:2;4482:4:14;1218:118:2;;;;;;16701:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;17156:19:26;;;;;;16184:1349;;;;;;:::o;17177:17::-;3757:65:2;17427:57:26;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;;17427:57:26;:::i;:::-;8327:63:2;;;;;3731:1283:20;7444:4:14;17136:18:26;;30614:1319;;24767:61:2;;803:10;;7623:3:14;;;;;1218:118:2;;;;;4482:4:14;;1218:118:2;;;;;;;;31121:41:26;;9418:40:2;;3731:1283:20;;-1:-1:-1;31576:19:26;;;;;;30614:1319;;;;;;;:::o;31597:17::-;3757:65:2;;;;;;;;24767:61;2806:59;3757:65;;29973:120:26;1218:118:2;;;;;;;;;29682:42:26;3757:65:2;;;;;24767:61;3237:40;3757:65;;;29682:42:26;:::i;:::-;3731:1283:20;;3757:65:2;;;;24767:61;2806:59;3757:65;;29973:120:26;:::i;:::-;8327:63:2;;;3731:1283:20;8327:63:2;;;;;3731:1283:20;7444:4:14;31556:18:26;;52128:1343:34;;;;;52833:214;52128:1343;3731:1283:20;;6450:8:33;;:19;;52833:214:34;;;:::i;:::-;48688:872;;;;;;;;;;;;;;;;;;;;;;;3731:1283:20;;55346:34:34;;;;:::i;:::-;55545:13;-1:-1:-1;55560:21:34;;;;;;56167:174;;;;;;;;;;:::i;:::-;;52128:1343;:::o;55583:3::-;55697:15;55880:200;55697:15;;;3731:1283:20;55697:15:34;;;:::i;:::-;;55955:27;;;56004:35;;;55880:200;;:::i;:::-;55864:216;;;;:::i;:::-;;;;;;:::i;:::-;;3731:1283:20;55545:13:34;;14275:1402:26;;1218:118:2;;27760:6:14;1218:118:2;;;;15346:54:26;14478:57;8327:63:2;6816:4:14;8327:63:2;;3731:1283:20;;;14901:14:26;803:10:2;24767:61;;;;3237:40;3757:65;;14901:14:26;:::i;:::-;15053:1;4482:4:14;8327:63:2;;3731:1283:20;15053:1:26;1218:118:2;8327:63;;3731:1283:20;4482:4:14;3757:65:2;;24767:61;2806:59;3757:65;15346:54:26;:::i;:::-;6311:4:14;8327:63:2;;3731:1283:20;7042:4:14;1218:118:2;;;4482:4:14;1218:118:2;;;;-1:-1:-1;3731:1283:20;;8327:63:2;3731:1283:20;14275:1402:26:o;3731:1283:20:-;;;:::i;:::-;;4405:1:35;3731:1283:20;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;-1:-1:-1;3731:1283:20;;-1:-1:-1;3731:1283:20;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;:::i;:::-;4405:1:35;3731:1283:20;;;;23783:4:14;3731:1283:20;;;23783:4:14;3731:1283:20:o;:::-;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;23783:4:14;3731:1283:20;23783:4:14;3731:1283:20;;23783:4:14;3731:1283:20:o;3352:3346:35:-;;;;6557:29;3352:3346;3693:24;;3749:25;;;;3731:1283:20;;;;;:::i;:::-;;;;:::i;:::-;3989:18:35;3976:31;;;;;:::i;:::-;6450:8:33;:19;;4218:53:35;4659:17;4218:53;;;;:::i;:::-;4102:169;;;;;4385:22;;;:::i;:::-;4496:33;;;;:::i;:::-;;;;;:::i;:::-;;4659:17;:::i;:::-;4879:9;;;;;;:::i;:::-;3731:1283:20;5097:16:35;;:::i;:::-;3731:1283:20;;:::i;:::-;5320:31:35;;5367:163;;5545:63;5367:163;;5965:9;5367:163;;;;;6266:9;5367:163;;;;:::i;:::-;5545:63;;:::i;:::-;;5316:587;5965:9;;:::i;:::-;6044:26;;;;:::i;:::-;3731:1283:20;6266:9:35;:::i;:::-;3731:1283:20;;;;;6465:20:35;;;3731:1283:20;;;6522:21:35;6557:29;6522:21;;;;6557:29;;;;;:::i;:::-;;;:::i;:::-;4405:1;3352:3346;:::o;5316:587::-;5832:23;;;;;;5965:9;5763:129;6266:9;5832:23;;;3749:25;5832:23;;;5763:129;;:::i;:::-;5316:587;;;;;12020:1571:26;;1218:118:2;;27760:6:14;1218:118:2;;;;7042:4:14;13512:62:26;12216:57;3757:65:2;1218:118;4482:4:14;3757:65:2;;4482:4:14;8327:63:2;;4054:61;6816:4:14;8327:63:2;;3731:1283:20;;;12971:14:26;803:10:2;24767:61;;;;3237:40;3757:65;;12971:14:26;:::i;:::-;13213:62;3757:65:2;6311:4:14;3757:65:2;;24767:61;2806:59;3757:65;;13213:62:26;:::i;:::-;6311:4:14;8327:63:2;;3731:1283:20;3757:65:2;;;24767:61;2806:59;3757:65;13512:62:26;:::i;:::-;8327:63:2;;3731:1283:20;12020:1571:26:o;3731:1283:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;:::i;:::-;;;;;;;;;:::o;13609:3631:37:-;13781:21;13892:3342;;;13609:3631;13892:3342;;;13609:3631::o;13892:3342::-;;;;;;;;;;;;;;;;;;;;13609:3631::o;13892:3342::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10388:458:17;10446:398;;;;;;;;17812:29275:23;;;;;18221:5;;:::i;:::-;;;:::i;:::-;18820:1850;;;;;;;;;;;;;;;;;;;;;;;21803:28;;21968:14001;;;;;;;;;;;;;;;;;;;;;18820:1850;;21968:14001;18820:1850;;21968:14001;;;;;;;;;;;;;;;;;;;;;;;;;;;;18221:5;21968:14001;;18221:5;21968:14001;18221:5;21968:14001;;18820:1850;;21968:14001;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18820:1850;;21968:14001;;;;;;;;;18820:1850;;21968:14001;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36482:20;21968:14001;36598:1884;;21968:14001;36598:1884;21968:14001;36598:1884;21968:14001;36598:1884;21968:14001;36598:1884;21968:14001;36598:1884;21968:14001;;36598:1884;18221:5;36598:1884;21968:14001;18221:5;36598:1884;21968:14001;36598:1884;41368:5180;39547:90;;3010:18:28;;;3731:1283:20;;18221:5:23;3731:1283:20;18221:5:23;3731:1283:20;;;18221:5:23;3731:1283:20;;;3010:18:28;3731:1283:20;39875:15:23;21968:14001;39905:1443;21968:14001;39547:90;21968:14001;39905:1443;21968:14001;39905:1443;21968:14001;39905:1443;;21968:14001;39905:1443;21968:14001;18820:1850;39905:1443;;;;;;;21968:14001;39905:1443;;;18820:1850;;21968:14001;;41368:5180;;;;;;;;;;;;;;;;;;21968:14001;41368:5180;;;;21968:14001;41368:5180;;;;;;;;;;;39905:1443;;;21968:14001;;36598:1884;;41368:5180;;;;21968:14001;18820:1850;;41368:5180;;;;;;;;;18221:5;21968:14001;41368:5180;18820:1850;;21968:14001;;41368:5180;;21968:14001;41368:5180;46980:11;46781:96;46643:30;;;:::i;:::-;46781:96;;;:::i;:::-;46980:11;5113:235:36;4960:394;5113:235;4960:394;21968:14001:23;;18221:5;21968:14001;;;;18820:1850;;18221:5;18820:1850;;;;;;18221:5;18820:1850;;;;;;;;11582:1028:30;;;;;;;11889:6;;;:::i;:::-;12020:10;;;;:::i;:::-;12093:24;;;12251:6;;;;;:::i;12089:515::-;20478:16;21695:671;20478:16;;;;;;4482:4:14;3731:1283:20;;20652:41:30;20648:1009;4482:4:14;;;21695:671:30;20709:12;20720:1;20800:498;;;;4482:4:14;20800:498:30;;;20753:33;20800:498;;;;4482:4:14;20800:498:30;;;;20720:1;20800:498;;;;20648:1009;21695:671;;;12439:23;21695:671;;;;;;;;;;;;;;;;;;;;;;11582:1028::o;20648:1009::-;21394:253;21695:671;21394:253;;;;;;;;;;20648:1009;;9517:1098;;;;;;;;9859:10;;;;:::i;:::-;9932:24;;;10046:11;;10056:1;10046:11;;10042:92;;10253:10;;;;;:::i;10042:92::-;10112:6;;:::i;9928:681::-;3731:1283:20;;20478:16:30;;;21695:671;;20478:16;;;;;;;4482:4:14;20652:41:30;4482:4:14;;21695:671:30;20709:12;20720:1;20800:498;;;;4482:4:14;20800:498:30;;;20753:33;20800:498;;;;4482:4:14;20800:498:30;;;;20720:1;20800:498;;;;20648:1009;21695:671;;;10445:22;21695:671;;;;;;;;;;;;;;;;;;;;;;9517:1098::o;20648:1009::-;21394:253;21695:671;21394:253;;;;;;;;;;20648:1009;;3731:1283:20;;;;;;;;;;:::o;:::-;;:::i;56879:4306:23:-;;;57521:1183;;;;57716:355;;;;;;;;;;57521:1183;58772:83;;59037:299;;;;;;59478:205;;;;;59820:13;-1:-1:-1;59835:37:23;;;;;;61166:11;;;;;;;;:::i;59820:13::-;59890:495;;;;;;;;60474:85;;59820:13;59890:495;;;;60825:11;59890:495;;4563:4:14;59890:495:23;;;60825:11;;;:::i;:::-;7444:4:14;59820:13:23;;60474:85;60509:35;;;;4563:4:14;60509:35:23;;;60825:11;60509:35;;:::i;:::-;60474:85;;;;;;;;;;58772:83;;:::i;57521:1183::-;58265:425;;;;;;;;;;57521:1183;;14183:437:30;4563:4:14;3731:1283:20;;14308:38:30;14304:75;;19077:139;;;;15616:502;;;;;;;;3731:1283:20;19077:139:30;-1:-1:-1;3731:1283:20;10663:1318:32;4563:4:14;10663:1318:32;10416:19;;;3731:1283:20;10663:1318:32;;;;;;;10561:27;4563:4:14;10663:1318:32;;;;;;4563:4:14;10663:1318:32;17455:506:30;;;4563:4:14;15616:502:30;;17455:506;;;;-1:-1:-1;17455:506:30;18008:8;;18004:254;;3731:1283:20;18346:33:30;3731:1283:20;;18336:43:30;18332:116;;16359:73;;19077:139;16359:73;;14183:437::o;18332:116::-;18429:7;:::i;18004:254::-;;;;:::i;:::-;7546:467:17;-1:-1:-1;7546:467:17;19077:139:30;7546:467:17;;;;14304:75:30;14362:7;:::o;48113:4372:23:-;48484:280;;;48113:4372;48484:280;;;;;;48849:24;;;;51523:22;48961:6;;;;;:::i;:::-;49171:2188;;;;;;;;;;;;;;;;;;;;;;;;48484:280;49171:2188;;;;;;;;48484:280;49171:2188;;;48484:280;49171:2188;;;51523:22;:::i;48845:3634::-;3731:1283:20;;;;;;;51683:15:23;3731:1283:20;;:::i;:::-;51671:27:23;51683:15;;51806:1;51796:11;;51792:100;;52037:10;52025;;;;52037;;:::i;51792:100::-;51866:6;;:::i;51667:802::-;52163:6;;;;;52430;52163;;;:::i;:::-;52366:10;52430:6;;:::i;52971:3127::-;53137:9;53421:335;;-1:-1:-1;53421:335:23;;;;54069:37;;;;;;55439:30;;;;;55435:102;;55623:6;53421:335;;;55623:6;:::i;:::-;55723:30;;;55719:373;;52971:3127;;:::o;55719:373::-;56019:30;3731:1283:20;;55986:10:23;56019:30;:::i;55435:102::-;;:::i;54124:29::-;54186:543;;;;;;54822:49;;;;54818:137;;55305:25;3731:1283:20;4563:4:14;3731:1283:20;;54186:543:23;;;;;55305:25;:::i;:::-;7444:4:14;54038:13:23;;;54818:137;6239:374:17;-1:-1:-1;6239:374:17;;;;4647:2082:41;;;16979:4:14;9857:61:2;14863:374:41;;;;;;;;;;;;;;4986:1737;;4647:2082;;;:::o;4986:1737::-;6621:4;73987:53:2;26388:4:14;73987:53:2;;26327:10:14;3731:1283:20;;14863:374:41;803:10:2;5785:56:41;;3731:1283:20;5741:10:16;708:4:2;3731:1283:20;5711:3:41;16979:4:14;8327:63:2;;6621:4:41;;:::i;:::-;-1:-1:-1;708:4:2;3731:1283:20;4647:2082:41:o;9200:1610:37:-;9360:21;9471:1333;;;;;;;;;;;9200:1610::o;9471:1333::-;;;;9200:1610::o;9471:1333::-;;;;9200:1610::o;10958:2472::-;11121:21;11232:2192;;;10958:2472;11232:2192;;;10958:2472::o;11232:2192::-;;;;;;;;;;;;-1:-1:-1;11232:2192:37;;10958:2472::o;11232:2192::-;;;;;;;;;;;;;;;;;;;;;;;;;;4088:2038:26;;4212:1908;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4088:2038::o;4212:1908::-;;;;;;;;;;;;6617:2065;;6749:1927;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6617:2065::o;6749:1927::-;;;;;;;;;;;;23947:1237;;24087:1091;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23947:1237::o;24087:1091::-;;;;;;;;;;;;10272:19676:34;;;;;3731:1283:20;10690:4:34;;;:::i;:::-;3731:1283:20;11337:894:34;;;3731:1283:20;;;12492:26:34;;;;:::i;:::-;12992:19;4482:4:14;13033:24:34;10690:4;7444::14;;7623:3;;13033:24:34;;;;23576:87;25012:60:14;23576:87:34;23555:187;;23867:17;;;;;;;;;:::i;:::-;3731:1283:20;24514:19:34;4482:4:14;24509:5266:34;24535:24;10690:4;7444::14;;7623:3;;24535:24:34;;;;29843:19;;;;;;;29839:93;;10272:19676::o;29839:93::-;;:::i;24561:12::-;24663:88;;;;;;;;;;;;24842:23;;;24838:78;;8327:63:2;;;59321:53;25324:21:34;;;25320:443;;15082:34;;;;15468:571;25864:34;:24;;;:34;;:::i;:::-;3731:1283:20;;;:::i;:::-;25864:56:34;15468:571;;16979:4:14;;26040:289:34;16979:4:14;;25011:62;26039:290:34;16979:4:14;7623:3;16979:4;3731:1283:20;26040:289:34;;;:::i;26039:290::-;26010:809;;4482:4:14;27029:23:34;;25011:62:14;26946:375:34;26947:374;25011:62:14;;;3731:1283:20;;;;25011:62:14;14216:25:34;27082;;25011:62:14;3731:1283:20;;27192:24:34;27137:158;27192:24;;;27137:158;:::i;:::-;3731:1283:20;;;;;;;26947:374:34;;:::i;26946:375::-;26917:892;;25860:3025;;;;25011:62:14;29596:29:34;25860:3025;;25011:62:14;29248:24:34;;3731:1283:20;;;;;;;;29596:29:34;10690:4;4482::14;29735:25:34;24561:12;24514:19;7444:4:14;24514:19:34;;;;;;;;;26917:892;4482:4:14;27449:95:34;;;10690:4;27449:95;;;3731:1283:20;27449:95:34;;;;;;3731:1283:20;27778:8:34;;26010:809;10690:4;26459:95;;4482:4:14;26459:95:34;;;3731:1283:20;26459:95:34;;;;;;26658:23;3731:1283:20;26788:8:34;;25860:3025;28140:24;;;28096:180;28140:24;;;;;28190:23;;;;28096:180;;:::i;:::-;28378:95;;;28577:23;;28573:294;;25860:3025;;25011:62:14;29596:29:34;25860:3025;;;28573:294;28706:23;10690:4;28706:23;;3731:1283:20;4482:4:14;28706:23:34;;;;3731:1283:20;28836:8:34;;24838:78;24889:8;4482:4:14;24889:8:34;;;10690:4;24889:8;;;;23555:187;;:::i;13079:12::-;8327:63:2;;;;59321:53;13684:46:34;;;;:::i;:::-;3731:1283:20;;;4482:4:14;13823:23:34;;3731:1283:20;;;;;;;13973:14:34;;13969:153;;3731:1283:20;;;14216:25:34;;;3731:1283:20;;14355:95:34;;14564:24;;:34;;;3731:1283:20;14709:32:34;;;;3731:1283:20;15082:34:34;;;3731:1283:20;;;;;;:::i;:::-;10690:4:34;-1:-1:-1;15468:571:34;16190:24;;;14216:25;16190:30;;3731:1283:20;;;16449:13:34;3731:1283:20;16444:2364:34;16464:19;;;;;;18979:24;;;;17525:21;18979:24;;:38;;3731:1283:20;;;19296:13:34;3731:1283:20;19311:27:34;;;;;;13079:12;;;;;;;4482:4:14;13079:12:34;12992:19;7444:4:14;12992:19:34;;19340:3;19506:16;;10690:4;19506:16;;;:::i;:::-;;15082:34;19793:27;;14564:34;19671:175;3731:1283:20;;19671:175:34;;;:::i;:::-;19987:29;20787:308;17525:21;19987:29;;3731:1283:20;;;;;;19987:88:34;;19954:682;20048:27;;;3731:1283:20;;;;;19954:682:34;7067:8:33;;;:20;6450:19;3731:1283:20;;;20787:308:34;:::i;:::-;3731:1283:20;;;21746:1347:34;;;;;;;3731:1283:20;19296:13:34;;19954:682;20416:193;;;;:::i;:::-;3731:1283:20;;19954:682:34;;16485:3;16597:8;;;;;;;;:::i;:::-;;15468:571;;;;16851:270;;;;17368:19;15082:34;17368:19;;3731:1283:20;;17246:167:34;;;;;:::i;:::-;17525:21;;;3731:1283:20;;;;;;;;17525:44:34;;17521:571;17550:19;;18221:279;17550:19;10690:4;17550:19;;;3731:1283:20;;;;;;17521:571:34;7067:8:33;;;:20;3731:1283:20;;;18221:279:34;:::i;:::-;3731:1283:20;;;;;16449:13:34;;;;;17521:571;17880:185;;;:::i;:::-;3731:1283:20;;17521:571:34;;13969:153;14091:8;;;;;4482:4:14;14091:8:34;;;3731:1283:20;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;-1:-1:-1;3731:1283:20;;;;;;;;;:::o;:::-;;;;;:::i;:::-;;;;;;;;;;2518:648:22;2826:29;;;;3731:1283:20;2876:47:22;;;3731:1283:20;-1:-1:-1;4014:136:22;;3731:1283:20;3109:36:22;3731:1283:20;3042:117:22;3731:1283:20;;;;;3010:9:28;3731:1283:20;3010:9:28;3731:1283:20;;;3010:9:28;3731:1283:20;;38472:203:24;;3109:36:22;3042:117;;:::i;9670:1596:40:-;;;3731:1283:20;;;;;;9934:301:40;;3731:1283:20;;;;;10434:25:40;;10430:754;;9670:1596;11247:12;;;;11255:4;9670:1596;:::o;10430:754::-;3731:1283:20;;-1:-1:-1;10823:47:40;10819:355;;10430:754;;;;10819:355;10967:98;;11147:12;10555:619;11147:12;:::o;10967:98::-;15909:465:17;;;;;;;;9934:301:40;10050:88;;;10212:12;-1:-1:-1;10212:12:40;:::o;10050:88::-;17403:457:17;-1:-1:-1;17403:457:17;;;;;;9670:1596:40;;;3731:1283:20;;;;;;9934:301:40;;3731:1283:20;;;;;;10430:754:40;;11247:12;3379::36;9670:1596:40;:::o;10430:754::-;18116:473:17;;;;;;;;19673:518;19745:444;;;;;;3142:1637:40;;;;3368:73;;;3520:52;;3656:18;;:::i;:::-;3791:81;;;;14228:843:32;;;;;;;;;;;;;;14021:1056;3791:81:40;3731:1283:20;;;4104:14:40;5310:568;;;;;;;;;;;;;4128:396;5310:568;;;6709:1807;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4345:47;6709:1807;4753:9;6709:1807;;11449:6984:25;6709:1807:40;-1:-1:-1;6709:1807:40;11449:6984:25;;:::i;:::-;-1:-1:-1;8738:142:40;;6709:1807;-1:-1:-1;8738:142:40;4345:47;14228:843:32;;;;;;;;;;;;;;14021:1056;4345:47:40;4128:396;4753:9;:::i;6709:1807::-;;;;;;;;;;;;;;-1:-1:-1;6709:1807:40;;;;;;;;;;;;;4128:396;4490:23;4753:9;4490:23;;;;4128:396;4753:9;:::i;3520:52::-;3555:7;;;;:::o;9036:921:26:-;9829:111;6311:4:14;9036:921:26;27600:6:14;4054:61:2;;;803:10;9509:65:26;3757::2;4563:4:14;3757:65:2;;24767:61;2806:59;3757:65;;9509::26;:::i;:::-;4563:4:14;8327:63:2;;3731:1283:20;3757:65:2;;;24767:61;2806:59;3757:65;9829:111:26;:::i;2371:1301::-;;2495:1171;;;;;;;;;;;;;;;;;;;;;;;;;;;2371:1301::o;4747:4355:37:-;4928:21;5041:4055;;;;;;;;;;;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;4747:4355::o;:::-;4928:21;5041:4055;;;;;;;;;10690:4:34;5041:4055:37;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;4747:4355::o;:::-;4928:21;5041:4055;;;;;;;;;;;;;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;;4747:4355::o;5041:4055::-;;;;;;;;;;;4747:4355::o;10344:5582:36:-;;;;;;;;:::o;:::-;;;;;;;6309:9623;;;;6624:24;;6787:25;6757:143;6758:142;6787:25;;;;3731:1283:20;6830:23:36;;;3731:1283:20;6758:142:36;;:::i;6757:143::-;6740:302;;7181:317;;;;;;;;;;;;;;;7696:25;;;;7725:18;3731:1283:20;;;;;:::i;:::-;;;;:::i;:::-;7696:47:36;7692:894;;8669:101;;;;;;8855:66;;3731:1283:20;;;;;:::i;:::-;36330:212:36;;;;;;;;;9012:309;;9424:58;;;:::i;:::-;9594:23;9760:67;9761:66;9594:23;;3731:1283:20;;32410:12:36;3731:1283:20;;;;;;;9594:23:36;9761:66;;;;:::i;9760:67::-;9686:282;;3731:1283:20;;;;;;10063:24:36;10059:194;;6309:9623;10344:5582;;;;;;;;;;;;;;;;;;;6309:9623;;;;;:::o;10344:5582::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10344:5582:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10344:5582:36;-1:-1:-1;10344:5582:36;;-1:-1:-1;10344:5582:36;;-1:-1:-1;10344:5582:36;;;;;10059:194;10205:23;3731:1283:20;10205:23:36;3731:1283:20;;;;;;;10205:23:36;;;;;:::i;:::-;10059:194;;;;;9686:282;-1:-1:-1;;;;;;;;;;;;9933:24:36:o;9012:309::-;;:::i;8855:66::-;;:::i;7692:894::-;7837:376;;;;;;;;;;;8306:74;;7837:376;8541:34;;;;;:::o;6740:302::-;-1:-1:-1;;;;;;;;;7006:25:36:o;3731:1283:20:-;;-1:-1:-1;3731:1283:20;;;:::o;2378:6151:29:-;3731:1283:20;;;;2985:13:29;2997:1;3000:26;;;;;;7414:13;;;2997:1;7429:23;;;;;;2378:6151;;;:::o;7454:3::-;7562:17;;3731:1283:20;7562:17:29;;;:::i;:::-;;7674:28;25011:62:14;3852:23:29;7674;;25011:62:14;3731:1283:20;;;;25011:62:14;3731:1283:20;;;;7674:28:29;;7670:83;;8442:38;7892:24;;4453:21;7975:25;;;3731:1283:20;;;;;:::i;:::-;8180:46:29;8098:29;;;;;8180:46;;:::i;:::-;8368:21;;8442:38;;:::i;:::-;3731:1283:20;7414:13:29;;7670:83;7726:8;;;3028:3;3167:20;;;;:::i;:::-;;3731:1283:20;;3434:33:29;;;;3430:187;;3731:26;;;;:::i;:::-;;3852:23;;:28;25011:62:14;3852:23:29;;;25011:62:14;3731:1283:20;;;;3852:28:29;;3848:83;;4070:24;4453:21;;;;;;;4601:22;;;3731:1283:20;4727:118:29;4218:10:16;4945:21:29;;;3731:1283:20;;;;:::i;:::-;;;;:::i;:::-;4941:1082:29;;3028:3;3731:1283:20;;;6117:30:29;;;6113:948;;7275:16;;;;3731:1283:20;7275:16:29;;;:::i;:::-;3731:1283:20;2985:13:29;;6113:948;2997:1;6175:864;;;;4941:1082;7444:4:14;;6311;7444;;;3731:1283:20;4697:10:16;4941:1082:29;;;3848:83;3904:8;;;3731:1283:20;3904:8:29;;;3430:187;3852:23;3555:21;;3731:1283:20;;;;:::i;:::-;3555:21:29;:::i;7250:7201:35:-;7536:25;;;;3731:1283:20;7589:23:35;;;3731:1283:20;8915:21:35;;;;;3731:1283:20;7067:8:33;:20;;-1:-1:-1;;7536:25:35;;;7250:7201;3731:1283:20;-1:-1:-1;9249:19:35;;;;;;10085;;;;;11141:25;11232:411;10085:19;11141:25;;3731:1283:20;;;;:::i;:::-;11232:411:35;;11660:105;;10038:21;12729:46;;;;;3731:1283:20;;6450:19:33;;10038:21:35;-1:-1:-1;12976:27:35;;;;;;7250:7201;;;;;;;;;;;:::o;13005:3::-;13147:29;;;;;13314:300;13147:29;;;;:32;3731:1283:20;13147:29:35;;;:32;:::i;:::-;;13350:29;;;3731:1283:20;;;13401:27:35;;;3731:1283:20;;;13314:300:35;;:::i;:::-;13712:709;;;;;;3731:1283:20;12961:13:35;;9270:3;9366:21;;;;;;:24;;;;:::i;:::-;;3731:1283:20;;;;;;:::i;:::-;9652:111:35;;10038:21;;;;3731:1283:20;;;;;;10085:19:35;;;3731:1283:20;;;9998:317:35;;;:::i;:::-;10417:507;;;3731:1283:20;;9234:13:35;;23674:3149:36;;;;23999:29;;;;;;3731:1283:20;24051:47:36;;;3731:1283:20;23999:99:36;23982:203;;-1:-1:-1;3731:1283:20;24328:92:36;3731:1283:20;;;;;;;;24328:92:36;;;:::i;:::-;24434:94;;;;;25022:24;;;3731:1283:20;;;;25022:15:36;3731:1283:20;;;;;;;25022:24:36;3731:1283:20;;;;;;;;;23999:29:36;25085:284;;25482:8;;25478:239;;26264:21;;;;26183:163;26264:21;;26303:29;;26183:163;;:::i;:::-;26429:16;;;26425:85;;26593:29;26710:45;23674:3149;:::o;26425:85::-;26489:9;;:::i;25478:239::-;25510:157;;;;;25685:17;-1:-1:-1;25685:17:36;:::o;25510:157::-;;;:::i;:::-;25638:9;:::i;9587:1287:41:-;;9899:24;;10059:20;;;;3731:1283:20;;;;;;;10081:15:41;;;3731:1283:20;10029:68:41;3731:1283:20;;;;;;14863:374:41;;;;;;;;;;;;14653:590;;10029:68;10012:856;;9587:1287;;;;;;;:::o;10012:856::-;19717:57:27;26388:4:14;10316:23:41;10059:20;10779:4;10316:23;;;3731:1283:20;-1:-1:-1;645:4:2;3731:1283:20;;;;26550:10:14;3731:1283:20;;10081:15:41;8327:63:2;;;3731:1283:20;8327:63:2;645:4;8327:63;;3731:1283:20;15689:10:27;8327:63:2;;;3731:1283:20;73987:53:2;;10059:20:41;8327:63:2;;3731:1283:20;6816:4:14;8327:63:2;;73987:53;8327:63;;;3731:1283:20;8327:63:2;6486:4:14;8327:63:2;;73987:53;8327:63;;;3731:1283:20;27206:4:14;8327:63:2;;73987:53;8327:63;;;3731:1283:20;8327:63:2;6816:4:14;8327:63:2;;3731:1283:20;19186:16:27;645:4:2;8327:63;;59321:53;8327:63;18134:114:27;16938:96;8327:63:2;;;;;16938:96:27;;:::i;:::-;7444:4:14;;;6486;8327:63:2;;3731:1283:20;17651:122:27;8327:63:2;;;59321:53;8327:63;;;;;17651:122:27;;:::i;:::-;7444:4:14;;;;;27206;8327:63:2;;3731:1283:20;8327:63:2;;;;;18134:114:27;;:::i;:::-;7444:4:14;6596:5;;7444:4;;;8327:63:2;;;3731:1283:20;8327:63:2;;;;;18705:121:27;;;;;:::i;:::-;7444:4:14;;;;8327:63:2;;;645:4;3731:1283:20;1636:90:2;19186:16:27;7623:3:14;;645:4:2;7623:3:14;;10059:20:41;7623:3:14;19393:61:27;:123;19369:20;;3731:1283:20;;;;7623:3:14;19717:57:27;;:::i;:::-;3731:1283:20;5741:10:16;8327:63:2;3731:1283:20;8327:63:2;3731:1283:20;;;10779:4:41;:::i;:::-;-1:-1:-1;8327:63:2;3731:1283:20;10012:856:41;;;;;;;;16872:5851:36;17149:23;;3731:1283:20;;32410:12:36;3731:1283:20;;;;;;;17149:23:36;17248;-1:-1:-1;17363:4466:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21839:179;;22028:667;;17363:4466;22028:667;;17363:4466;22028:667;;17149:12;22028:667;;;17149:12;16872:5851;:::o;21839:179::-;21867:141;;;;;;;;;3731:1283:20;;21913:29:36;;;;;;3731:1283:20;;;;;;21913:29:36;21867:141;21981:12;-1:-1:-1;21981:12:36;:::o;17363:4466::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;17363:4466:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;15113:5675:35;;;;;15650:30;;:::i;:::-;16983:21;;;;;;;3731:1283:20;17160:13:35;-1:-1:-1;17175:19:35;;;;;;19011:46;;;;;;;;;;;3731:1283:20;19243:13:35;-1:-1:-1;19258:27:35;;;;;;20434:11;;;;;;;;;:::i;:::-;20520:68;20670:23;20666:116;;15113:5675;:::o;20666:116::-;20752:18;20201:10;;20752:18;:::i;19287:3::-;19429:32;:29;;;:32;:::i;:::-;;3731:1283:20;;;;;;;;:::i;:::-;;;;:::i;:::-;19502:45:35;19498:507;;19287:3;20201:10;3731:1283:20;20201:10:35;3731:1283:20;20201:10:35;;3731:1283:20;;:::i;:::-;;19243:13:35;;19498:507;19646:92;;;19845:29;;;3731:1283:20;19845:50:35;19841:146;;19498:507;;;;17196:3;17292:21;3731:1283:20;17292:21:35;:24;3731:1283:20;17292:21:35;;;:24;:::i;:::-;;17410:236;;;;;3731:1283:20;;;;;;;;17862:26:35;;;3731:1283:20;;;:::i;:::-;;17160:13:35;;11521:2690:41;;;;11986:24;;12149:20;;;;3731:1283:20;;;;;;;;;;12119:68:41;12171:15;;;3731:1283:20;;;;;;;;;14863:374:41;;;;;;;;;;;;14653:590;;12119:68;12171:15;;;8327:63:2;;12289:222:41;8327:63:2;6596:5:14;14134:4:41;8327:63:2;;73987:53;12289:222:41;:::i;:::-;12270:241;;59987:53:2;;5741:10:16;12102:1717:41;708:4:2;3731:1283:20;14134:4:41;:::i;12102:1717::-;12929:18;3731:1283:20;;;;;;;;:::i;:::-;;;;:::i;:::-;12905:42:41;12929:18;;14134:4;59987:53:2;13453:189:41;59987:53:2;;;13197:167:41;12149:20;13197:167;;;13544:23;;;13453:189;;;:::i;:::-;13434:208;;13720:51;6178:10:16;12102:1717:41;;12901:918;13802:7;;;;:::o;3731:1283:20:-;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;21432:855:35;;;;;3731:1283:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3731:1283:20;;;;;;;;;;;;;;;;;;;;;22120:160:35;3731:1283:20;;;;;;;;;;;;:::i;:::-;22120:160:35;;;21432:855::o;3731:1283:20:-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12305:201:32;12394:13;12411:9;12394:26;12411:9;;12439:17;12305:201;:::o;12394:105::-;4433:1229:25;;;;4233:24;-1:-1:-1;4433:1229:25;4286:10;4433:1229;;4328:13;4433:1229;;12394:13:32;4433:1229:25;;;;;;-1:-1:-1;4433:1229:25;;;;-1:-1:-1;4433:1229:25;;;;12305:201:32;:::o;8116:356:17:-;8163:307;;;;;;5265:4044:22;5522:3606;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9220:13;9216:87;;5265:4044::o;2939:1785:36:-;;3731:1283:20;-1:-1:-1;3731:1283:20;3379:12:36;3731:1283:20;;;-1:-1:-1;3731:1283:20;6450:8:33;3471:232:36;6450:8:33;:19;;3471:232:36;;;:::i;:::-;;3731:1283:20;;;;3823:24:36;3819:889;;2939:1785;:::o;3819:889::-;3965:710;24767:61:2;3731:1283:20;16754:4:14;803:10:2;17796:5:14;24767:61:2;9418:40;7444:4:14;3731:1283:20;:::i;:::-;3210:82:36;;;3965:710;:::i;1955:1964:41:-;;;3731:1283:20;9857:61:2;16979:4:14;9857:61:2;14863:374:41;;;;;;;;;;;;;;2304:1609;;1955:1964;;:::o;2304:1609::-;24767:61:2;;;17674:5:14;24767:61:2;7623:3:14;;7444:4;3242::41;7444::14;3731:1283:20;7444:4:14;3731:1283:20;26550:10:14;3731:1283:20;;8327:63:2;;;;3731:1283:20;8327:63:2;;;;3731:1283:20;14863:374:41;8327:63:2;;;3731:1283:20;16932:4:14;9857:61:2;8327:63;;;3731:1283:20;8327:63:2;17322:5:14;8327:63:2;;;4054:61;7444:4:14;6710:5;8327:63:2;;;;3731:1283:20;8327:63:2;;3731:1283:20;8327:63:2;17932:5:14;24767:61:2;5501:4:14;7444;;;;8327:63:2;;;3731:1283:20;8327:63:2;;;;3731:1283:20;8327:63:2;;;3731:1283:20;7444:4:14;;;8327:63:2;;;3731:1283:20;8327:63:2;;;;;3731:1283:20;;;;8327:63:2;3731:1283:20;5741:10:16;8327:63:2;3731:1283:20;8327:63:2;7444:4:14;;;8327:63:2;;3242:4:41;;:::i;:::-;3731:1283:20;8327:63:2;3731:1283:20;7444:4:14;3419:48:41;7444:4:14;;3731:1283:20;7623:3:14;3814:56:41;3731:1283:20;;1955:1964:41:o;4322:435:22:-;4392:359;;;4322:435::o;4392:359::-;;;;;;;13361:458:30;;19077:139;;;;13723:35;13719:94;;13361:458;:::o;13719:94::-;13790:11;;;:::i;20218:2154::-;;21695:671;20218:2154;;;;4482:4:14;3731:1283:20;;20652:41:30;20648:1009;4482:4:14;;;21695:671:30;20709:12;8347:21;20800:498;;;;4482:4:14;20800:498:30;;;20753:33;20800:498;;;;4482:4:14;20800:498:30;;;;8347:21;20800:498;;;;20648:1009;21695:671;;;8347:21;21695:671;;;;;;;;;;;;;;;;8050:1;21695:671;;;;;;20218:2154::o;20648:1009::-;21394:253;21695:671;21394:253;;;8347:21;21394:253;;;;;;20648:1009;;21506:6120:39;;;;;;21757:5863;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21506:6120::o;21757:5863::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9527:565:17;9598:492;;;;;;;;15445:5413:39;;;;15670:5182;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15445:5413::o;15670:5182::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7547:969:30;;;;;7824:6;;;:::i;:::-;7955:10;;;;:::i;:::-;8028:24;;;4499:10336:39;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;;;8024:486:30;4499:10336:39;;;;;;;;8050:1:30;4499:10336:39;;7547:969:30:o;4499:10336:39:-;;;;;;;;;;;;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;;;;;;;;;8050:1:30;4499:10336:39;;;;;;;8050:1:30;4499:10336:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8024:486:30;8479:6;;;;;;;;:::i;17108:1346::-;10663:1318:32;-1:-1:-1;48484:280:23;3731:1283:20;10663:1318:32;;;10416:19;;;3731:1283:20;10663:1318:32;;;;;;;10561:27;10663:1318;;;;;;;;;17455:506:30;;;;;;;-1:-1:-1;17455:506:30;18008:8;;18004:254;;3731:1283:20;18346:33:30;3731:1283:20;;18336:43:30;18332:116;;17108:1346;;:::o;5060:1551::-;5245:6;;;:::i;:::-;-1:-1:-1;5367:154:30;;;;;;;5567:8;5563:1042;;5060:1551;;:::o;5563:1042::-;;;:::i;:::-;5779:816;-1:-1:-1;5779:816:30;;;;;;;;15927:1936:41;;16133:527;15927:1936;;-1:-1:-1;15927:1936:41;16133:527;;;;;;;;;;;;-1:-1:-1;16133:527:41;;16724:8;;16720:601;;17398:11;17394:463;;15927:1936;:::o;17394:463::-;17477:370;;;;;16720:601;;;;:::i;3731:1283:20:-;;;;;;;;;;;;;;;;:::o;4813:1329:21:-;;;;5048:24;;;5044:67;;5248:531;;;;;;5897:17;;;:::i;:::-;6002:134;4813:1329;:::o;5248:531::-;;;;;;;5044:67;5088:12;;;;:::o;1737:2268::-;;;;;2032:24;;;2028:1877;;3982:16;;;;1737:2268;:::o;2028:1877::-;2863:23;3731:1283:20;2907:19:21;3731:1283:20;;2569:15:21;;3731:1283:20;;;;;2863:23:21;;:::i;:::-;2907:19;;:::i;:::-;3731:1283:20;;;;;;;3024:801:21;;;;;;;;;3881:13;:::o;10952:376:17:-;11004:322;;;;;;7645:1300:41;;;;;8009:24;;8172:20;;;;3731:1283:20;;;;;;;;8194:15:41;;;3731:1283:20;8142:68:41;3731:1283:20;;;;;;14863:374:41;;;;;;;;;;;;14653:590;;8142:68;8125:792;;8927:11;;;;;;;;8934:4;7645:1300;:::o;8125:792::-;8641:265;8428:23;19726:31:27;8428:23:41;19717:57:27;8428:23:41;26388:4:14;8428:23:41;19186:16:27;8172:20:41;645:4:2;8428:23:41;;;3731:1283:20;;;;;;26550:10:14;3731:1283:20;;8194:15:41;8327:63:2;;;3731:1283:20;8327:63:2;3731:1283:20;15689:10:27;8327:63:2;15689:10:27;8327:63:2;;3731:1283:20;73987:53:2;8172:20:41;73987:53:2;;8327:63;;3731:1283:20;8327:63:2;;6816:4:14;8327:63:2;;73987:53;8327:63;;3731:1283:20;6816:4:14;8327:63:2;;;;;6486:4:14;8327:63:2;;73987:53;8327:63;;;3731:1283:20;27206:4:14;8327:63:2;;73987:53;8327:63;;;3731:1283:20;8327:63:2;3731:1283:20;8327:63:2;645:4;8327:63;;59321:53;8327:63;18134:114:27;16938:96;8327:63:2;;;;;16938:96:27;;:::i;:::-;7444:4:14;;;6486;8327:63:2;;3731:1283:20;17651:122:27;8327:63:2;;;59321:53;8327:63;;;;;17651:122:27;;:::i;:::-;7444:4:14;;;;;27206;8327:63:2;;3731:1283:20;8327:63:2;;;;;18134:114:27;;:::i;:::-;7444:4:14;6596:5;;7444:4;;;8327:63:2;;;3731:1283:20;8327:63:2;;;;;18705:121:27;;;;;;;:::i;:::-;7444:4:14;;;;;8327:63:2;;;;645:4;3731:1283:20;1636:90:2;19186:16:27;7623:3:14;645:4:2;7623:3:14;;8172:20:41;7623:3:14;19393:61:27;:123;19369:20;;3731:1283:20;;;19726:31:27;:::i;:::-;3731:1283:20;7623:3:14;19717:57:27;;:::i;:::-;8327:63:2;;3731:1283:20;;;8641:265:41;:::i;57353:456:34:-;57550:25;;;3731:1283:20;;;;;;;;;57600:20:34;57630:173;57600:20;;3731:1283:20;;57630:173:34;;;;;;;57353:456;:::o;15297:392:17:-;15353:334;;;;;;9911:1580:31;;;;3731:1283:20;;:::i;:::-;;;;10462:33:31;10458:125;;10954:18;3731:1283:20;;;;;10954:18:31;;:::i;10458:125::-;13625:570:17;-1:-1:-1;13625:570:17;-1:-1:-1;13625:570:17;;;;;9911:1580:31;;;;;3731:1283:20;;:::i;:::-;;;;10462:33:31;10458:125;;-1:-1:-1;24428:10226:31;;-1:-1:-1;24428:10226:31;-1:-1:-1;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9911:1580;:::o;24428:10226::-;;;;;;-1:-1:-1;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11391:10;24428:10226;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10458:125;13625:570:17;3731:1283:20;13625:570:17;35985:18:34;13625:570:17;;;;;37761:10553:34;;;;;3731:1283:20;;38283:23:34;;;;:::i;:::-;38694:30;;;:::i;:::-;38966:1;;3731:1283:20;38966:1:34;3731:1283:20;;7444:4:14;7623:3;;4482:4;39065:19:34;;4482:4:14;39086:24:34;;;;;;41616:13;;;;-1:-1:-1;41631:15:34;;;;;;46739:11;;;;;;:::i;:::-;46870:77;47029:32;47025:180;;41611:5022;47441:704;;;41611:5022;47441:704;;;;;;:::i;:::-;-1:-1:-1;47550:15:34;;;;;;47441:704;;;47535:13;47659:18;;;;;;;:::i;:::-;3731:1283:20;;;;;47659:18:34;47655:313;;47535:13;3731:1283:20;47535:13:34;;47655:313;47913:14;47833:17;;;;:::i;:::-;;47913:14;;;;;:::i;:::-;3731:1283:20;47913:14:34;;:::i;:::-;47655:313;;47025:180;47153:27;47124:10;;47153:27;:::i;:::-;47025:180;;;41648:3;41759:17;;;;:::i;:::-;;41873:23;:28;25011:62:14;41873:23:34;;;25011:62:14;3731:1283:20;;;;41873:28:34;;41869:279;;42214:25;;;;;;;:::i;:::-;38966:1;3731:1283:20;;;42214:25:34;42344:24;42481:16;;;;3731:1283:20;;42725:13:34;-1:-1:-1;42740:19:34;;;;;;39579:11;;;;44981:24;;;;3731:1283:20;;;45269:13:34;-1:-1:-1;45284:27:34;;;;;;41648:3;;;;41616:13;3731:1283:20;41616:13:34;;45313:3;45419:16;;;;;;;;;;:::i;:::-;;45586:29;;;3731:1283:20;;;45717:16:34;45713:124;;-1:-1:-1;45938:641:34;;;;;;;45269:13;;;;3731:1283:20;;45269:13:34;;45713:124;45798:11;;;:::i;42761:3::-;42885:8;;;;;;;;;:::i;:::-;;44735:19;39579:11;43128:21;;3731:1283:20;;;43124:1491:34;;42761:3;44735:19;3731:1283:20;;;;42725:13:34;;;;;;;;43124:1491;64750:420:26;;;;;;;;;3731:1283:20;;;;;;;;;;44017:21:34;;;3731:1283:20;;;;:::i;:::-;44220:369:34;;;;43124:1491;;41869:279;42073:26;;;-1:-1:-1;42073:26:34;;;;:::i;:::-;3731:1283:20;42121:8:34;;39112:12;8327:63:2;;;59321:53;39530:14:34;;39579:11;;;3731:1283:20;39962:11:34;39958:1476;;39112:12;;;;7444:4:14;39065:19:34;;;;39958:1476;40072:1065;;;;;-1:-1:-1;40072:1065:34;;;;;;41293:17;41382:11;41293:17;;41336:20;3731:1283:20;41293:17:34;;;;3731:1283:20;;;;;;41336:20:34;;3731:1283:20;41382:11:34;;:::i;:::-;39958:1476;;;;;2209:12808:38;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;2209:12808;-1:-1:-1;;2602:11810:38;;;;;;;;;;;2209:12808;14459:8;;;;;;;;;14455:556;;2209:12808::o;14455:556::-;;;:::i;:::-;14676:325;-1:-1:-1;14676:325:38;;;;2602:11810;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;-1:-1:-1;2602:11810:38;;-1:-1:-1;2602:11810:38;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;-1:-1:-1;2602:11810:38;;;;;;;;;;;;;;;;;;;3094:5613:31;;;3731:1283:20;;:::i;:::-;3465:738:31;;;;;;;;;;3731:1283:20;;:::i;:::-;4566:10:31;;;;;;:::i;:::-;4707:27;;4830:24;;;;3731:1283:20;;;4830:29:31;4826:89;;5120:27;;3731:1283:20;5120:27:31;;;3731:1283:20;;;;;;5120:27:31;;;;:::i;:::-;5204:14;;5459:1398;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3731:1283:20;4830:24:31;3731:1283:20;;6967:20:31;;3731:1283:20;;;-1:-1:-1;6936:1607:31;6967:20;;;7147:26;;5459:1398;4830:24;7455:42;:136;7147:26;;;;;:::i;:::-;;3731:1283:20;;;;;;;;;7455:42:31;:::i;:::-;;:74;:109;;7565:25;;3731:1283:20;7455:136:31;;:::i;:::-;;:169;3731:1283:20;3094:5613:31;:::o;6936:1607::-;4830:24;7859:18;;;8147:128;7859:18;;;;;:::i;:::-;;5459:1398;;8147:42;3731:1283:20;;;;;;;;;8147:42:31;;:::i;:128::-;;:161;3731:1283:20;;;;3094:5613:31;:::o;5459:1398::-;;-1:-1:-1;5459:1398:31;;;;;;4826:89;4875:29;;;;;;;;;:::o;3465:738::-;;;;;;;1897:570:40;2124:153;;;;;;;;;;1897:570;;2371:25;;1897:570;2367:94;;1897:570;;:::o;2371:25::-;2390:6;;;2371:25;;3791:332:17;3832:289;;;;;;18682:430;18742:368;;;;;;16590:594;16660:522;;;;;;;;3731:1283:20;;;;:::i;:::-;;:::o;12343:1675:29:-;;12608:21;12343:1675;12608:21;:::i;:::-;;3731:1283:20;;;;;;:::i;:::-;14711:64:29;;;12830:30;12826:95;;12962:30;;;3731:1283:20;;12962:30:29;;3731:1283:20;13087:34:29;;;;13240:27;13718:128;13855:32;13240:27;13323:30;13984:27;13240;;;;3731:1283:20;13323:30:29;;;;;;;:::i;:::-;13718:128;13855:32;;:::i;:::-;13984:27;3731:1283:20;;;12343:1675:29:o;13083:476::-;13388:30;;;;;3731:1283:20;13384:175:29;;13984:27;13083:476;13718:128;13855:32;13083:476;;;13384:175;;:::i;12826:95::-;5728:331:17;-1:-1:-1;5728:331:17;;;;9220:1947:29;3731:1283:20;;;9220:1947:29;9601:1;9604:14;;;;;;9220:1947;;;;;:::o;9620:3::-;9671:8;;;;:::i;:::-;;3731:1283:20;;;;;:::i;:::-;9948:1203:29;9908:25;;;;3731:1283:20;9948:1203:29;;;;;;;;;;;;9620:3;3731:1283:20;;9589:13:29;;9948:1203;;3701:10:16;9601:1:29;9948:1203;;;;;;;6937:866:21;;;;;;;;7282:24;;;7278:519;7282:24;;;7376:47;;;;;;;:::i;7278:519::-;7581:49;;;;;7543:243;7581:49;7648:47;7581:49;;;;:::i;:::-;7648:47;;:::i;:::-;7543:243;;:::i;5010:2995:27:-;;;7444:4:14;5010:2995:27;7652:86;645:4:2;3731:1283:20;;25343:10:14;3731:1283:20;;8327:63:2;26388:4:14;8327:63:2;;5784:10:27;;8327:63:2;;;3731:1283:20;7042:4:14;645::2;8327:63;;3731:1283:20;7104:104:27;8327:63:2;6382:96:27;645:4:2;8327:63;;59321:53;8327:63;;;6382:96:27;;:::i;:::-;7444:4:14;;7042;7444;8327:63:2;;;3731:1283:20;8327:63:2;59321:53;8327:63;;;;;7104:104:27;;:::i;:::-;7444:4:14;;;7042;7444;;7042;8327:63:2;;3731:1283:20;8327:63:2;;7652:86:27;;:::i;:::-;7444:4:14;;5010:2995:27;:::o;904:2311:33:-;972:2237;;;904:2311::o;972:2237::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;904:2311::o;972:2237::-;;;;;;;;;;;;;;;;;;;;;11933:543:17;12000:474;;;;;;;;34932:19160:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;34932:19160:26;;;;;;;;;;;3023:1806:30;;;;3731:1283:20;;;;;:::i;:::-;;;;:::i;:::-;3254:32:30;;3394:10;;;3386:19;3731:1283:20;3394:10:30;;;3731:1283:20;;;;;;;;;;3386:19:30;3731:1283:20;3408:15:30;;;3731:1283:20;;;3386:37:30;3381:112;;3589:14;3605:11;3731:1283:20;3589:14:30;3605:11;3589:14;;3731:1283:20;;;;;;3605:11:30;;3731:1283:20;3605:11:30;;:::i;3250:1573::-;3731:1283:20;;;3655:14:30;3731:1283:20;;;;;:::i;:::-;;;;:::i;:::-;3638:31:30;3655:14;;3743:15;;;3731:1283:20;3739:88:30;;3912:196;3944:10;3731:1283:20;3944:10:30;;;3731:1283:20;;;;;;3994:14:30;3731:1283:20;4026:11:30;3731:1283:20;3994:14:30;;;3731:1283:20;;;;;;4026:11:30;;3731:1283:20;;;3912:196:30;;:::i;3634:1189::-;3731:1283:20;4146:15:30;3731:1283:20;;;;;:::i;:::-;;;;:::i;:::-;4129:32:30;4146:15;;4281:10;3731:1283:20;4281:10:30;4248:230;4281:10;;3731:1283:20;;;;;;4331:14:30;;;3731:1283:20;;;4363:15:30;3731:1283:20;4396:11:30;4363:15;;;3731:1283:20;4396:11:30;;3731:1283:20;;;4248:230:30;;:::i;4125:698::-;4615:10;3731:1283:20;4615:10:30;4581:231;4615:10;;3731:1283:20;;;;;;4665:14:30;;;3731:1283:20;;;4697:15:30;3731:1283:20;4730:11:30;4697:15;;;3731:1283:20;4730:11:30;;3731:1283:20;;;4581:231:30;;:::i;9239:3520:27:-;;;;;8327:63:2;7444:4:14;9239:3520:27;11942:100;12378:110;9239:3520;645:4:2;3731:1283:20;;25819:10:14;3731:1283:20;;26388:4:14;8327:63:2;;10217:35:27;;8327:63:2;;;3731:1283:20;8327:63:2;;;;3731:1283:20;11498:122:27;6311:4:14;10810:96:27;645:4:2;8327:63;;59321:53;8327:63;;;10810:96:27;;:::i;:::-;7444:4:14;;8327:63:2;7444:4:14;645::2;8327:63;;3731:1283:20;8327:63:2;59321:53;8327:63;;;;;11498:122:27;;:::i;:::-;7444:4:14;;8327:63:2;7444:4:14;;6311;8327:63:2;;3731:1283:20;8327:63:2;;;;;11942:100:27;;:::i;:::-;7444:4:14;;;8327:63:2;7444:4:14;;7042;8327:63:2;;3731:1283:20;8327:63:2;;12378:110:27;;:::i;21008:827::-;;21719:109;16979:4:14;21203:3:27;16979:4:14;803:10:2;;26388:4:14;16979;;21233:2:27;16979:4:14;21224:33:27;3731:1283:20;26327:10:14;3731:1283:20;;8327:63:2;21341:25:27;;21719:109;;:::i;8752:624:17:-;8831:543;;;;;;;;;;18737:2294:41;;-1:-1:-1;18737:2294:41;19027:527;18737:2294;;;19027:527;;;;;;;;;;;;-1:-1:-1;19027:527:41;;19634:8;;19630:759;;20466:11;;20462:541;;21013:11;21020:4;18737:2294;:::o;20462:541::-;5741:10:16;-1:-1:-1;20545:448:41;19027:527;20545:448;;;;19630:759;19662:16;;;;;;19658:67;;;;;:::i;:::-;-1:-1:-1;;;19698:12:41:o;24428:10226:31:-;;;;;;;24072:10588;;;;;3731:1283:20;24428:10226:31;3731:1283:20;24428:10226:31;3731:1283:20;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24072:10588;:::o;24428:10226::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3731:1283:20;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3731:1283:20;24428:10226:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12187:10415;12436:10160;;12187:10415;;;-1:-1:-1;;;;;;12187:10415:31;;;12436:10160;;;;;;;;;;;;;;;;;;;;;;;;;12187:10415;:::o;12436:10160::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12436:10160:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4687:878:17;4821:742;;;;;;;;;;;;11449:6984:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;:::o;11416:336:17:-;11458:292;;;;;;15115:2050:29;;;;-1:-1:-1;15421:1603:29;;;;-1:-1:-1;15421:1603:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;17099:60;;15115:2050::o;15421:1603::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;15421:1603:29;;;;;;;;30081:2106:27;;30227:1954;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30081:2106;:::o;30227:1954::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3864:535;73987:53:2;;7702:4:14;7444;7744:10;4228:56:27;;3864:535;4377:4;;4228:56;;3864:535;4377:4;:::i;32962:1402::-;73987:53:2;;3731:1283:20;;;;8049:64:2;;;;;;7623:3:14;;;;7444:4;;8049:64:2;;34025:263:27;7161:46:2;;;;;;5501:4:14;;;;6816;5501;8049:64:2;7444:4:14;32962:1402:27;:::o;34025:263::-;6816:4:14;3731:1283:20;;;;;;6710:330:2;;;;;;;;;8049:64;;8327:63;;34025:263:27;;;28529:797;29170:15;8049:64:2;28529:797:27;;;73987:53:2;;;3731:1283:20;;;7623:3:14;;8049:64:2;;;;;;29170:15:27;:::i;:::-;7444:4:14;28529:797:27;:::o;6590:456:2:-;;;6710:330;;;;;;;;;6590:456::o;3731:1283:20:-;1218:118:2;;;27600:6:14;1218:118:2;;;;33290:103:26;6710:5:14;4054:61:2;;;;;803:10;33014:65:26;3757::2;1218:118;3757:65;;24767:61;2806:59;3757:65;;33014::26;:::i;:::-;1218:118:2;8327:63;;3731:1283:20;6311:4:14;3757:65:2;;24767:61;2806:59;3757:65;33290:103:26;:::i;:::-;8327:63:2;6311:4:14;8327:63:2;;3731:1283:20;73987:53:2;8327:63;;;3731:1283:20;;:::o;:::-;;;-1:-1:-1;34880:27:26;-1:-1:-1;34932:19160:26;;;;;-1:-1:-1;34932:19160:26;-1:-1:-1;34932:19160:26;-1:-1:-1;34932:19160:26;-1:-1:-1;34932:19160:26;;;;;3731:1283:20;34932:19160:26;;;;3731:1283:20;;;;;;;;;;:::o;34932:19160:26:-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;34932:19160:26;;-1:-1:-1;34932:19160:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;34932:19160:26;-1:-1:-1;34932:19160:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;34932:19160:26;;;;;3731:1283:20;;;;;9601:1:29;9604:14;;;;;;3731:1283:20;;;;;:::o;9620:3:29:-;9671:8;;;;:::i;:::-;;3731:1283:20;;;;;:::i;:::-;9948:1203:29;9908:25;;;;3731:1283:20;9948:1203:29;;;;;;;;;;;;9620:3;3731:1283:20;;9589:13:29;;9948:1203;;3081:10:16;9601:1:29;9948:1203;;;;;;","linkReferences":{},"cborAuxdata":{"1":{"value":"0xa164736f6c6343000818000a","offset":23969}},"immutableReferences":{"9013":[{"start":15504,"length":32}],"9015":[{"start":15540,"length":32}],"9017":[{"start":15469,"length":32}],"9019":[{"start":4690,"length":32},{"start":8207,"length":32}],"9021":[{"start":4768,"length":32},{"start":7866,"length":32}],"9023":[{"start":4875,"length":32},{"start":8324,"length":32}],"9025":[{"start":15389,"length":32}],"9027":[{"start":15427,"length":32}],"9030":[{"start":3862,"length":32},{"start":9365,"length":32},{"start":17045,"length":32}],"9032":[{"start":9427,"length":32},{"start":17107,"length":32}],"16072":[{"start":1229,"length":32},{"start":7655,"length":32},{"start":10007,"length":32},{"start":10076,"length":32},{"start":12452,"length":32},{"start":12545,"length":32},{"start":12638,"length":32}],"16074":[{"start":1279,"length":32}]},"transformations":[{"id":"9013","type":"replace","offset":15504,"reason":"immutable"},{"id":"9015","type":"replace","offset":15540,"reason":"immutable"},{"id":"9017","type":"replace","offset":15469,"reason":"immutable"},{"id":"9019","type":"replace","offset":4690,"reason":"immutable"},{"id":"9019","type":"replace","offset":8207,"reason":"immutable"},{"id":"9021","type":"replace","offset":4768,"reason":"immutable"},{"id":"9021","type":"replace","offset":7866,"reason":"immutable"},{"id":"9023","type":"replace","offset":4875,"reason":"immutable"},{"id":"9023","type":"replace","offset":8324,"reason":"immutable"},{"id":"9025","type":"replace","offset":15389,"reason":"immutable"},{"id":"9027","type":"replace","offset":15427,"reason":"immutable"},{"id":"9030","type":"replace","offset":3862,"reason":"immutable"},{"id":"9030","type":"replace","offset":9365,"reason":"immutable"},{"id":"9030","type":"replace","offset":17045,"reason":"immutable"},{"id":"9032","type":"replace","offset":9427,"reason":"immutable"},{"id":"9032","type":"replace","offset":17107,"reason":"immutable"},{"id":"16072","type":"replace","offset":1229,"reason":"immutable"},{"id":"16072","type":"replace","offset":7655,"reason":"immutable"},{"id":"16072","type":"replace","offset":10007,"reason":"immutable"},{"id":"16072","type":"replace","offset":10076,"reason":"immutable"},{"id":"16072","type":"replace","offset":12452,"reason":"immutable"},{"id":"16072","type":"replace","offset":12545,"reason":"immutable"},{"id":"16072","type":"replace","offset":12638,"reason":"immutable"},{"id":"16074","type":"replace","offset":1279,"reason":"immutable"}],"transformationValues":{"immutables":{"9013":"0x32b5c112df393a49218d7552f96b2eeb829dfb4272f4f24eef510a586b85feef","9015":"0x95f740a33d720b7cd93c75d515ac95ca3bbaa2594cce46ea48e00974ea8fcd14","9017":"0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f","9019":"0xa66999307ad1bb4fde44d13a5d710bd7718e0c87c1eef68a571629fbf5b93d02","9021":"0x42d81c6929ffdc4eb27a0808e40e82516ad42296c166065de7f812492304ff6e","9023":"0xfa445660b7e21515a59617fcd68910b487aa5808b8abda3d78bc85df364b2c2f","9025":"0x0000000000000000000000000000000000000000000000000000000000000001","9027":"0xfce34bc6e1752c1117e5063116d25cad2fa2bdcf15ff2d2e275eece7dc31ba64","9030":"0x00000000000000000000000000000000f9490004c11cef243f5400493c00ad63","9032":"0x023d904f2503c37127200ca07b976c3a53cc562623f67023115bf311f5805059","16072":"0x0000000000000000000000000000000000000000000000000000000000000001","16074":"0x0000000000000000000000002c023f954ac2029e8941f30defc209ef5c994c5f"}}},"proxyResolution":{"isProxy":false,"proxyType":null,"implementations":[]},"deployment":{"transactionHash":"0x926e958d5919f0089f47a353b0a8a211bd858abb20348261d41672d77fa7c6a0","blockNumber":"19442152","transactionIndex":"284","deployer":"0x939C8d89EBC11fA45e576215E2353673AD0bA18A"},"matchId":"2146195","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2024-08-08T14:41:23Z","match":"match","chainId":"1","address":"0x0000000000000068F116a894984e2DB1123eB395"}