creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
      },
      "@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error AddressInsufficientBalance(address account);\n\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedInnerCall();\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert AddressInsufficientBalance(address(this));\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert FailedInnerCall();\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {FailedInnerCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert AddressInsufficientBalance(address(this));\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n     * unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {FailedInnerCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert FailedInnerCall();\n        }\n    }\n}\n"
      },
      "contracts/accountAbstraction/compliance/libraries/TokensRepository.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    Status,\n    TokenIsNotSupported,\n    TokenIsSuspended,\n    TokenLevelInsufficient,\n    TokenPermission\n} from \"contracts/interfaces/accountAbstraction/compliance/IWhitelistingController.sol\";\n\nlibrary TokensRepository {\n    struct Token {\n        Status status;\n        TokenPermission perm;\n    }\n\n    struct Storage {\n        mapping(address source => Token) tokens;\n    }\n\n    bytes32 private constant STORAGE_SLOT = keccak256(\"Supported Tokens repository slot V1\");\n\n    error CannotRecognizeTokenPermission(TokenPermission);\n    /// @dev We can suspend token, but it's permission will never fall\n    /// to None. None reserved for undefined case just because it would\n    /// be strange to return TradeOnly permission for undefined tokens.\n    error CannotSetPermissionToNone(address);\n\n    function updateTokenSupport(\n        address token,\n        bool supported,\n        TokenPermission perm\n    ) internal returns (bool storageModified) {\n        bool s = updateTokenStatus(token, supported);\n        bool p = updateTokenPerm(token, perm);\n        storageModified = s || p;\n    }\n\n    function enforceTokenSupported(address token) internal view {\n        Status status = getTokenStatus(token);\n        if (status != Status.Supported) {\n            if (status == Status.Suspended) revert TokenIsSuspended(token);\n            else revert TokenIsNotSupported(token);\n        }\n    }\n\n    function enforceTokenSupportedOrSuspended(address token) internal view {\n        Status status = getTokenStatus(token);\n        if (status == Status.Undefined) revert TokenIsNotSupported(token);\n    }\n\n    function enforceTokenHasPermission(address token, TokenPermission required) internal view {\n        TokenPermission current = getTokenPerm(token);\n        if (current == required) return;\n        // if not matched then we check levels\n        if (getPermLevel(current) > getPermLevel(required)) return;\n        // at this point we know that niether permissions matched\n        // nor the current one is higher than required, so\n        // it's either current is lower than the required (bad)\n        // or equal to it which is only possible for level 2\n        // which is not compatible (Collateral != Leverage)\n        revert TokenLevelInsufficient(token, required, current);\n    }\n\n    function getTokenStatus(address token) internal view returns (Status) {\n        return _storage()[token].status;\n    }\n\n    function getTokenPerm(address token) internal view returns (TokenPermission) {\n        return _storage()[token].perm;\n    }\n\n    function updateTokenStatus(\n        address token,\n        bool supported\n    ) private returns (bool storageModified) {\n        Status current = getTokenStatus(token);\n        if (supported && current != Status.Supported) {\n            _storage()[token].status = Status.Supported;\n            storageModified = true;\n        } else if (!supported && current == Status.Supported) {\n            _storage()[token].status = Status.Suspended;\n            storageModified = true;\n        }\n    }\n\n    function updateTokenPerm(\n        address token,\n        TokenPermission perm\n    ) private returns (bool storageModified) {\n        if (perm == TokenPermission.None) revert CannotSetPermissionToNone(token);\n\n        if (getTokenPerm(token) != perm) {\n            _storage()[token].perm = perm;\n            storageModified = true;\n        }\n    }\n\n    function _storage() private view returns (mapping(address => Token) storage) {\n        bytes32 storageSlot = STORAGE_SLOT;\n        Storage storage state;\n        assembly {\n            state.slot := storageSlot\n        }\n        return state.tokens;\n    }\n\n    function getPermLevel(TokenPermission perm) private pure returns (uint256) {\n        if (perm == TokenPermission.None) return 0;\n        if (perm == TokenPermission.TradeOnly) return 1;\n        if (perm == TokenPermission.Collateral) return 2;\n        if (perm == TokenPermission.Leverage) return 2;\n        if (perm == TokenPermission.FullAccess) return 3;\n        revert CannotRecognizeTokenPermission(perm);\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/libraries/Path.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nlibrary Path {\n    using Path for bytes;\n\n    uint256 internal constant ADDRESS_LEN = 20;\n    uint256 internal constant POOL_ID_LEN = 4;\n    uint256 internal constant NEXT_OFFSET = ADDRESS_LEN + POOL_ID_LEN;\n\n    error InvalidPathLength(uint256);\n\n    function extractTokenIn(bytes calldata _path) internal pure returns (address tokenIn_) {\n        _path.ensureValid();\n        tokenIn_ = _path.extractTokenInUnsafe();\n    }\n\n    function extractTokenInUnsafe(bytes calldata _path) internal pure returns (address tokenIn_) {\n        tokenIn_ = address(bytes20(_path[0:ADDRESS_LEN]));\n    }\n\n    function extractTokenOut(bytes calldata _path) internal pure returns (address tokenOut_) {\n        _path.ensureValid();\n        tokenOut_ = _path.extractTokenOutUnsafe();\n    }\n\n    function extractTokenOutUnsafe(bytes calldata _path) internal pure returns (address tokenOut_) {\n        uint256 len = _path.length;\n        tokenOut_ = address(bytes20(_path[len - ADDRESS_LEN:len]));\n    }\n\n    /* solhint-disable var-name-mixedcase */\n    function extractPool(\n        bytes calldata _path,\n        uint256 _poolNumber\n    ) internal pure returns (address tokenIn__, address tokenOut_, uint32 poolId_____) {\n        /* solhint-enable var-name-mixedcase */\n        _path.ensureValid();\n        uint256 ptr = _poolNumber * NEXT_OFFSET;\n\n        tokenIn__ = address(bytes20(_path[ptr:(ptr = ptr + ADDRESS_LEN)]));\n        poolId_____ = uint32(bytes4(_path[ptr:(ptr = ptr + POOL_ID_LEN)]));\n        tokenOut_ = address(bytes20(_path[ptr:(ptr = ptr + ADDRESS_LEN)]));\n    }\n\n    function getNumberOfPools(bytes calldata _path) internal pure returns (uint256) {\n        _path.ensureValid();\n        return (_path.length - ADDRESS_LEN) / NEXT_OFFSET;\n    }\n\n    function ensureValid(bytes calldata _path) internal pure {\n        if (!isValid(_path)) revert InvalidPathLength(_path.length);\n    }\n\n    function isValid(bytes calldata _path) private pure returns (bool) {\n        if (_path.length < ADDRESS_LEN) return false;\n        return (_path.length - ADDRESS_LEN) % NEXT_OFFSET == 0;\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorClipper.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IClipperRouter\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IClipperRouter.sol\";\n\nabstract contract OneInchV5ConstructorClipper {\n    function constructClipperSwap(\n        address clipperExchange,\n        address srcToken,\n        address dstToken,\n        uint256 inputAmount,\n        uint256 outputAmount,\n        uint256 goodUntil,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(\n                IClipperRouter.clipperSwap,\n                (clipperExchange, srcToken, dstToken, inputAmount, outputAmount, goodUntil, r, vs)\n            );\n    }\n\n    function constructClipperSwapTo(\n        address clipperExchange,\n        address payable recipient,\n        address srcToken,\n        address dstToken,\n        uint256 inputAmount,\n        uint256 outputAmount,\n        uint256 goodUntil,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(\n                IClipperRouter.clipperSwapTo,\n                (\n                    clipperExchange,\n                    recipient,\n                    srcToken,\n                    dstToken,\n                    inputAmount,\n                    outputAmount,\n                    goodUntil,\n                    r,\n                    vs\n                )\n            );\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorGeneric.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IGenericRouter\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IGenericRouter.sol\";\n\nabstract contract OneInchV5ConstructorGeneric {\n    function constructSwap(\n        address caller,\n        IGenericRouter.SwapDescription memory desc,\n        bytes memory permit,\n        bytes memory data\n    ) internal pure returns (bytes memory) {\n        return abi.encodeCall(IGenericRouter.swap, (caller, desc, permit, data));\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorOrderMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IOrderLib,\n    IOrderMixin\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderMixin.sol\";\n\nabstract contract OneInchV5ConstructorOrderMixin {\n    function constructFillOrder(\n        IOrderLib.Order memory order,\n        bytes memory signature,\n        bytes memory interaction,\n        uint256 makingAmount,\n        uint256 takingAmount,\n        uint256 skipPermitAndThresholdAmount\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(\n                IOrderMixin.fillOrder,\n                (\n                    order,\n                    signature,\n                    interaction,\n                    makingAmount,\n                    takingAmount,\n                    skipPermitAndThresholdAmount\n                )\n            );\n    }\n\n    function constructFillOrderTo(\n        IOrderLib.Order memory order,\n        bytes memory signature,\n        bytes memory interaction,\n        uint256 makingAmount,\n        uint256 takingAmount,\n        uint256 skipPermitAndThresholdAmount,\n        address target\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(\n                IOrderMixin.fillOrderTo,\n                (\n                    order,\n                    signature,\n                    interaction,\n                    makingAmount,\n                    takingAmount,\n                    skipPermitAndThresholdAmount,\n                    target\n                )\n            );\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorOrderRFQMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IOrderRFQLib,\n    IOrderRFQMixin\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderRFQMixin.sol\";\n\nabstract contract OneInchV5ConstructorOrderRFQMixin {\n    function constructFillOrderRFQ(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes memory signature,\n        uint256 flagsAndAmount\n    ) internal pure returns (bytes memory) {\n        return abi.encodeCall(IOrderRFQMixin.fillOrderRFQ, (order, signature, flagsAndAmount));\n    }\n\n    function constructFillOrderRFQCompact(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes32 r,\n        bytes32 vs,\n        uint256 flagsAndAmount\n    ) internal pure returns (bytes memory) {\n        return abi.encodeCall(IOrderRFQMixin.fillOrderRFQCompact, (order, r, vs, flagsAndAmount));\n    }\n\n    function constructFillOrderRFQTo(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes memory signature,\n        uint256 flagsAndAmount,\n        address target\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(\n                IOrderRFQMixin.fillOrderRFQTo,\n                (order, signature, flagsAndAmount, target)\n            );\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorUniswapV3.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IUniswapV3Router\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IUniswapV3Router.sol\";\n\nabstract contract OneInchV5ConstructorUniswapV3 {\n    function constructUniswapV3Swap(\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] memory pools\n    ) internal pure returns (bytes memory) {\n        return abi.encodeCall(IUniswapV3Router.uniswapV3Swap, (amount, minReturn, pools));\n    }\n\n    function constructUniswapV3SwapTo(\n        address payable recipient,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] memory pools\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodeCall(IUniswapV3Router.uniswapV3SwapTo, (recipient, amount, minReturn, pools));\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/actions/OneInchV5ConstructorUnoswap.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IUnoswapRouter\n} from \"contracts/interfaces/accountAbstraction/compliance/oneinchV5/IUnoswapRouter.sol\";\n\nabstract contract OneInchV5ConstructorUnoswap {\n    function constructUnoswap(\n        address srcToken,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] memory pools\n    ) internal pure returns (bytes memory data_) {\n        return abi.encodeCall(IUnoswapRouter.unoswap, (srcToken, amount, minReturn, pools));\n    }\n\n    function constructUnoswapTo(\n        address payable recipient,\n        address srcToken,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] memory pools\n    ) internal pure returns (bytes memory data_) {\n        return\n            abi.encodeCall(\n                IUnoswapRouter.unoswapTo,\n                (recipient, srcToken, amount, minReturn, pools)\n            );\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5Hub.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {IClipperRouter, OneInchV5HubClipper} from \"./OneInchV5HubClipper.sol\";\nimport {IGenericRouter, OneInchV5HubGeneric} from \"./OneInchV5HubGeneric.sol\";\nimport {IOrderMixin, OneInchV5HubOrderMixin} from \"./OneInchV5HubOrderMixin.sol\";\nimport {IOrderRFQMixin, OneInchV5HubOrderRFQMixin} from \"./OneInchV5HubOrderRFQMixin.sol\";\nimport {IUniswapV3Router, OneInchV5HubUniswapV3} from \"./OneInchV5HubUniswapV3.sol\";\nimport {IUnoswapRouter, OneInchV5HubUnoswap} from \"./OneInchV5HubUnoswap.sol\";\n\nstruct SwitchResult {\n    address tokenIn;\n    address tokenOut;\n    bytes data;\n}\n\n/* solhint-disable ordering */\nabstract contract OneInchV5Hub is\n    OneInchV5HubClipper,\n    OneInchV5HubGeneric,\n    OneInchV5HubOrderMixin,\n    OneInchV5HubOrderRFQMixin,\n    OneInchV5HubUniswapV3,\n    OneInchV5HubUnoswap\n{\n    error UnsupportedOneInchRouterV5Function(bytes4 selector);\n\n    function switchBySelector(\n        bytes calldata extraData,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal view returns (SwitchResult memory result) {\n        bytes4 selector = bytes4(extraData[:4]);\n        bytes calldata payload = extraData[4:];\n        if (selector == IGenericRouter.swap.selector) {\n            result = swap(payload, amountIn, minAmountOut, recipient);\n        } else if (selector == IUnoswapRouter.unoswap.selector) {\n            result = unoswap(payload, amountIn, minAmountOut);\n        } else if (selector == IUnoswapRouter.unoswapTo.selector) {\n            result = unoswapTo(payload, amountIn, minAmountOut, recipient);\n        } else if (selector == IUniswapV3Router.uniswapV3Swap.selector) {\n            result = uniswapV3Swap(payload, amountIn, minAmountOut);\n        } else if (selector == IUniswapV3Router.uniswapV3SwapTo.selector) {\n            result = uniswapV3SwapTo(payload, amountIn, minAmountOut, recipient);\n        } else if (selector == IClipperRouter.clipperSwap.selector) {\n            result = clipperSwap(payload, amountIn, minAmountOut);\n        } else if (selector == IClipperRouter.clipperSwapTo.selector) {\n            result = clipperSwapTo(payload, amountIn, minAmountOut, recipient);\n        } else if (selector == IOrderMixin.fillOrder.selector) {\n            result = fillOrder(payload, amountIn, minAmountOut);\n        } else if (selector == IOrderMixin.fillOrderTo.selector) {\n            result = fillOrderTo(payload, amountIn, minAmountOut, recipient);\n        } else if (selector == IOrderRFQMixin.fillOrderRFQ.selector) {\n            result = fillOrderRFQ(payload, amountIn);\n        } else if (selector == IOrderRFQMixin.fillOrderRFQTo.selector) {\n            result = fillOrderRFQTo(payload, amountIn, recipient);\n        } else if (selector == IOrderRFQMixin.fillOrderRFQCompact.selector) {\n            result = fillOrderRFQCompact(payload, amountIn);\n        } else {\n            revert UnsupportedOneInchRouterV5Function(selector);\n        }\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubClipper.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IClipperRouter,\n    OneInchV5ConstructorClipper\n} from \"../actions/OneInchV5ConstructorClipper.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubClipper is OneInchV5ConstructorClipper {\n    function clipperSwap(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (\n            address clipperExchange,\n            address srcToken,\n            address dstToken,\n            ,\n            ,\n            uint256 goodUntil,\n            bytes32 r,\n            bytes32 vs\n        ) = abi.decode(\n                payload,\n                (address, address, address, uint256, uint256, uint256, bytes32, bytes32)\n            );\n        result.tokenIn = srcToken;\n        result.tokenOut = dstToken;\n        result.data = constructClipperSwap(\n            clipperExchange,\n            srcToken,\n            dstToken,\n            amountIn,\n            minAmountOut,\n            goodUntil,\n            r,\n            vs\n        );\n    }\n\n    function clipperSwapTo(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (\n            address clipperExchange,\n            ,\n            address srcToken,\n            address dstToken,\n            ,\n            ,\n            uint256 goodUntil,\n            bytes32 r,\n            bytes32 vs\n        ) = abi.decode(\n                payload,\n                (address, address, address, address, uint256, uint256, uint256, bytes32, bytes32)\n            );\n        result.tokenIn = srcToken;\n        result.tokenOut = dstToken;\n        result.data = constructClipperSwapTo(\n            clipperExchange,\n            recipient,\n            srcToken,\n            dstToken,\n            amountIn,\n            minAmountOut,\n            goodUntil,\n            r,\n            vs\n        );\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubGeneric.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IGenericRouter,\n    OneInchV5ConstructorGeneric\n} from \"../actions/OneInchV5ConstructorGeneric.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubGeneric is OneInchV5ConstructorGeneric {\n    function swap(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (\n            address executor,\n            IGenericRouter.SwapDescription memory desc,\n            bytes memory permit,\n            bytes memory data\n        ) = abi.decode(payload, (address, IGenericRouter.SwapDescription, bytes, bytes));\n        desc.amount = amountIn;\n        desc.minReturnAmount = minAmountOut;\n        desc.dstReceiver = recipient;\n        result.tokenIn = desc.srcToken;\n        result.tokenOut = desc.dstToken;\n        result.data = constructSwap(executor, desc, permit, data);\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubOrderMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IOrderLib,\n    IOrderMixin,\n    OneInchV5ConstructorOrderMixin\n} from \"../actions/OneInchV5ConstructorOrderMixin.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubOrderMixin is OneInchV5ConstructorOrderMixin {\n    function fillOrder(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (\n            IOrderLib.Order memory order,\n            bytes memory signature,\n            bytes memory interaction,\n            ,\n            ,\n            uint256 skipPermitAndThresholdAmount\n        ) = abi.decode(payload, (IOrderLib.Order, bytes, bytes, uint256, uint256, uint256));\n        result.tokenIn = order.makerAsset;\n        result.tokenOut = order.takerAsset;\n        result.data = constructFillOrder(\n            order,\n            signature,\n            interaction,\n            minAmountOut,\n            amountIn,\n            skipPermitAndThresholdAmount\n        );\n    }\n\n    function fillOrderTo(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (\n            IOrderLib.Order memory order,\n            bytes memory signature,\n            bytes memory interaction,\n            ,\n            ,\n            uint256 skipPermitAndThresholdAmount,\n\n        ) = abi.decode(\n                payload,\n                (IOrderLib.Order, bytes, bytes, uint256, uint256, uint256, address)\n            );\n        result.tokenIn = order.makerAsset;\n        result.tokenOut = order.takerAsset;\n        result.data = constructFillOrderTo(\n            order,\n            signature,\n            interaction,\n            minAmountOut,\n            amountIn,\n            skipPermitAndThresholdAmount,\n            recipient\n        );\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubOrderRFQMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IOrderRFQLib,\n    IOrderRFQMixin,\n    OneInchV5ConstructorOrderRFQMixin\n} from \"../actions/OneInchV5ConstructorOrderRFQMixin.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubOrderRFQMixin is OneInchV5ConstructorOrderRFQMixin {\n    uint256 internal constant _MAKER_AMOUNT_FLAG =\n        0x8000000000000000000000000000000000000000000000000000000000000000;\n    uint256 internal constant _AMOUNT_MASK =\n        0x0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n    error MakerAmoutFlagIsSet();\n\n    function _getFlagsAndAmount(\n        uint256 flagsWithOldAmount,\n        uint256 amount\n    ) internal pure returns (uint256) {\n        if (flagsWithOldAmount & _MAKER_AMOUNT_FLAG != 0) revert MakerAmoutFlagIsSet();\n        return (flagsWithOldAmount & ~_AMOUNT_MASK) | amount;\n    }\n\n    function fillOrderRFQ(\n        bytes calldata payload,\n        uint256 amountIn\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (IOrderRFQLib.OrderRFQ memory order, bytes memory signature, uint256 flagsAndAmount) = abi\n            .decode(payload, (IOrderRFQLib.OrderRFQ, bytes, uint256));\n        result.tokenIn = order.makerAsset;\n        result.tokenOut = order.takerAsset;\n        flagsAndAmount = _getFlagsAndAmount(flagsAndAmount, amountIn);\n        result.data = constructFillOrderRFQ(order, signature, flagsAndAmount);\n    }\n\n    function fillOrderRFQCompact(\n        bytes calldata payload,\n        uint256 amountIn\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (IOrderRFQLib.OrderRFQ memory order, bytes32 r, bytes32 vs, uint256 flagsAndAmount) = abi\n            .decode(payload, (IOrderRFQLib.OrderRFQ, bytes32, bytes32, uint256));\n        result.tokenIn = order.makerAsset;\n        result.tokenOut = order.takerAsset;\n        flagsAndAmount = _getFlagsAndAmount(flagsAndAmount, amountIn);\n        result.data = constructFillOrderRFQCompact(order, r, vs, flagsAndAmount);\n    }\n\n    function fillOrderRFQTo(\n        bytes calldata payload,\n        uint256 amountIn,\n        address payable recipient\n    ) internal pure virtual returns (SwitchResult memory result) {\n        (IOrderRFQLib.OrderRFQ memory order, bytes memory signature, uint256 flagsAndAmount, ) = abi\n            .decode(payload, (IOrderRFQLib.OrderRFQ, bytes, uint256, address));\n        result.tokenIn = order.makerAsset;\n        result.tokenOut = order.takerAsset;\n        flagsAndAmount = _getFlagsAndAmount(flagsAndAmount, amountIn);\n        result.data = constructFillOrderRFQTo(order, signature, flagsAndAmount, recipient);\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubUniswapV3.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IUniswapV3Router,\n    OneInchV5ConstructorUniswapV3\n} from \"../actions/OneInchV5ConstructorUniswapV3.sol\";\nimport {UniswapTokens} from \"../libraries/UniswapTokens.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubUniswapV3 is OneInchV5ConstructorUniswapV3 {\n    using UniswapTokens for uint256;\n\n    function uniswapV3Swap(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut\n    ) internal view virtual returns (SwitchResult memory result) {\n        (, , uint256[] memory pools) = abi.decode(payload, (uint256, uint256, uint256[]));\n        result.tokenIn = pools[0].getUniswapSrcToken();\n        result.tokenOut = pools[pools.length - 1].getUniswapDstToken();\n        result.data = constructUniswapV3Swap(amountIn, minAmountOut, pools);\n    }\n\n    function uniswapV3SwapTo(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal view virtual returns (SwitchResult memory result) {\n        (, , , uint256[] memory pools) = abi.decode(\n            payload,\n            (address, uint256, uint256, uint256[])\n        );\n        result.tokenIn = pools[0].getUniswapSrcToken();\n        result.tokenOut = pools[pools.length - 1].getUniswapDstToken();\n        result.data = constructUniswapV3SwapTo(recipient, amountIn, minAmountOut, pools);\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5HubUnoswap.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IUnoswapRouter,\n    OneInchV5ConstructorUnoswap\n} from \"../actions/OneInchV5ConstructorUnoswap.sol\";\nimport {UniswapTokens} from \"../libraries/UniswapTokens.sol\";\nimport {SwitchResult} from \"./OneInchV5Hub.sol\";\n\n/* solhint-disable ordering */\nabstract contract OneInchV5HubUnoswap is OneInchV5ConstructorUnoswap {\n    using UniswapTokens for uint256;\n\n    function unoswap(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut\n    ) internal view virtual returns (SwitchResult memory result) {\n        (address srcToken, , , uint256[] memory pools) = abi.decode(\n            payload,\n            (address, uint256, uint256, uint256[])\n        );\n        result.tokenIn = srcToken;\n        result.tokenOut = pools[pools.length - 1].getUniswapDstToken();\n        result.data = constructUnoswap(srcToken, amountIn, minAmountOut, pools);\n    }\n\n    function unoswapTo(\n        bytes calldata payload,\n        uint256 amountIn,\n        uint256 minAmountOut,\n        address payable recipient\n    ) internal view virtual returns (SwitchResult memory result) {\n        (, address srcToken, , , uint256[] memory pools) = abi.decode(\n            payload,\n            (address, address, uint256, uint256, uint256[])\n        );\n        result.tokenIn = srcToken;\n        result.tokenOut = pools[pools.length - 1].getUniswapDstToken();\n        result.data = constructUnoswapTo(recipient, srcToken, amountIn, minAmountOut, pools);\n    }\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5ImmutableState.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ncontract OneInchV5ImmutableState {\n    address internal constant SWAP_ROUTER = 0x1111111254EEB25477B68fb85Ed929f73A960582;\n    address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/libraries/UniswapTokens.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IUniswapV3Pool\n} from \"contracts/interfaces/accountAbstraction/compliance/uniswapV3/index.sol\";\n\nlibrary UniswapTokens {\n    uint256 private constant REVERSE_MASK =\n        0x8000000000000000000000000000000000000000000000000000000000000000;\n\n    function getUniswapDstToken(uint256 poolUint) internal view returns (address) {\n        IUniswapV3Pool pool = IUniswapV3Pool(address(uint160(poolUint)));\n        return poolUint & REVERSE_MASK == 0 ? pool.token1() : pool.token0();\n    }\n\n    function getUniswapSrcToken(uint256 poolUint) internal view returns (address) {\n        IUniswapV3Pool pool = IUniswapV3Pool(address(uint160(poolUint)));\n        return poolUint & REVERSE_MASK == 0 ? pool.token0() : pool.token1();\n    }\n}\n"
      },
      "contracts/accountAbstraction/interpreter/oneinchV5/OneInchV5Evaluator.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IExchangeEvaluator\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/index.sol\";\n\nimport {\n    TokensRepository\n} from \"contracts/accountAbstraction/compliance/libraries/TokensRepository.sol\";\nimport {\n    OneInchV5ImmutableState\n} from \"contracts/accountAbstraction/interpreter/oneinchV5/base/OneInchV5ImmutableState.sol\";\nimport {Address} from \"contracts/libraries/Address.sol\";\nimport {Command} from \"contracts/libraries/CommandLibrary.sol\";\n\nimport {Path} from \"../libraries/Path.sol\";\nimport {OneInchV5Hub, SwitchResult} from \"./base/OneInchV5Hub.sol\";\n\ncontract OneInchV5Evaluator is IExchangeEvaluator, OneInchV5Hub, OneInchV5ImmutableState {\n    using Address for address;\n    using TokensRepository for address;\n    using Path for bytes;\n\n    function evaluate(\n        address,\n        ExchangeRequest calldata _request\n    ) external view override returns (Command[] memory cmds_) {\n        SwitchResult memory result = switchBySelector(\n            _request.extraData,\n            _request.amountIn,\n            _request.minAmountOut,\n            payable(_request.recipient)\n        );\n\n        result.tokenOut.enforceTokenSupported();\n\n        if (result.tokenIn.isEth()) {\n            // 1inch API & ROUTER might use address(0) for ETH\n            ETH_ADDRESS.enforceTokenSupportedOrSuspended();\n            cmds_ = Command({target: SWAP_ROUTER, value: _request.amountIn, payload: result.data})\n                .asArray();\n        } else {\n            result.tokenIn.enforceTokenSupportedOrSuspended();\n            cmds_ = Command({target: SWAP_ROUTER, value: 0, payload: result.data})\n                .populateWithApprove(result.tokenIn, _request.amountIn);\n        }\n    }\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/Asset.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {AssetLibrary} from \"contracts/libraries/AssetLibrary.sol\";\n\n/**\n * @title Asset\n * @dev Represents an asset with its token address and the amount.\n * @param token The address of the asset's token.\n * @param amount The amount of the asset.\n */\nstruct Asset {\n    address token;\n    uint256 amount;\n}\n\nusing AssetLibrary for Asset global;\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/IWhitelistingController.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/**\n * @title Status\n * @notice Enum representing status of a record (e.g., token, protocol, operator)\n *  used for operation validation.\n * @notice Validators must adhere to the following rules for different operations and contexts:\n *  1) For exchanges: `operator`, `pool`, and `input token` *MAY* be either supported or suspended, but the `output token` *MUST* be supported.\n *  2) For deposits: `operator`, `pool`, and every `token` in the `pool` *MUST* be supported.\n *  3) For withdrawals: `operator`, `pool`, and each `token` *MAY* be either supported or suspended.\n *\n * @dev **Note** that deposit denotes **all** ways of aquiring liquidity such\n * as token deposit, LP tokens stake, NFT mint etc.\n */\nenum Status {\n    Undefined,\n    Supported,\n    Suspended\n}\n\n/**\n * @title WhitelistingAddressRecord\n * @notice A struct to store an address and its support status.\n * @dev This struct stores an address and its support status.\n * @dev `source`: The address to be stored.\n * @dev `supported`: Indicates whether the address is supported or not.\n */\nstruct WhitelistingAddressRecord {\n    address source;\n    bool supported;\n}\n\n/**\n * @title TokenPermission\n * @notice This enum represents different levels of permission for a token, including trading, collateral, leverage, and full access.\n * @dev `None`: Represents no permissions granted for the token.\n * @dev `TradeOnly`: Represents the lowest permission level where you can only trade the token.\n * @dev `Collateral`: Allows you to use the token as collateral.\n * @dev `Leverage`: Allows you to leverage the token.\n * @dev `FullAccess`: Represents the highest permission level where you have full access to trade, use as collateral, and leverage the token.\n */\nenum TokenPermission {\n    None,\n    TradeOnly,\n    Collateral,\n    Leverage,\n    FullAccess\n}\n\n/**\n * @title WhitelistingTokenRecord\n * @notice This struct stores an address and its support status for whitelisting, collateral and leverage.\n * @dev `source`: The address of the token.\n * @dev `supported`: Whether the token can be received from a protocol trades.\n * @dev `permission`: Level of [`TokenPermission`](./enum.TokenPermission.html).\n */\nstruct WhitelistingTokenRecord {\n    address source;\n    bool supported;\n    TokenPermission permission;\n}\n\n/**\n * @notice An error indicating that a token is not supported by the whitelisting controller.\n * @dev This error is thrown when an unsupported token is used.\n * @dev `token`: The address of the unsupported token.\n */\nerror TokenIsNotSupported(address token);\n\n/**\n * @notice An error indicating that a token is suspended by the whitelisting controller.\n * @dev This error is thrown when a suspended token is used.\n * @dev `token`: The address of the suspended token.\n */\nerror TokenIsSuspended(address token);\n\n/**\n * @notice An error indicating that the token's permission level is insufficient for the requested action.\n * @dev This can be thrown at [`IWhitelistingController.enforceTokenHasPermission()`](./interface.IWhitelistingController.html#enforcetokenhaspermission)\n * @param token The address of the token that has insufficient permissions.\n * @param required The required permission level for the action.\n * @param actual The actual permission level of the token.\n */\nerror TokenLevelInsufficient(address token, TokenPermission required, TokenPermission actual);\n\n/**\n * @notice An error indicating that an operator is not supported by the whitelisting controller.\n * @dev This error is thrown when an unsupported operator is used.\n * @dev `operator`: The address of the unsupported operator.\n */\nerror OperatorIsNotSupported(address operator);\n\n/**\n * @notice An error indicating that an operator is suspended by the whitelisting controller.\n * @dev This error is thrown when a suspended operator is used.\n * @dev `operator`: The address of the suspended operator.\n */\nerror OperatorIsSuspended(address operator);\n\n/**\n * @notice An error indicating that a protocol is not supported by the whitelisting controller.\n * @dev This error is thrown when an unsupported protocol is used.\n * @dev `protocol`: The identification string of the unsupported protocol.\n */\nerror ProtocolIsNotSupported(string protocol);\n\n/**\n * @notice An error indicating that a protocol is suspended by the whitelisting controller.\n * @dev This error is thrown when a suspended protocol is used.\n * @dev `protocol`: The identification string of the unsupported protocol.\n */\nerror ProtocolIsSuspended(string protocol);\n\n/**\n * @title IWhitelistingController\n * @notice Interface for managing whitelisting of tokens, protocols, and operators.\n */\ninterface IWhitelistingController {\n    /**\n     * @dev Emitted when the support status of a protocol changes.\n     * @dev `protocol`: The identification string of the protocol.\n     * @dev `supported`: Whether the protocol is supported or not.\n     */\n    event ProtocolSupportChanged(string indexed protocol, bool supported);\n\n    /**\n     * @dev Emitted when the support status of a token changes.\n     * @dev `token`: The address of the token.\n     * @dev `supported`: Whether the token is supported or not.\n     * @dev `permission`: Level of [`TokenPermission`](./enum.TokenPermission.html).\n     */\n    event TokenSupportChanged(address indexed token, bool supported, TokenPermission permission);\n\n    /**\n     * @dev Emitted when the support status of an operator changes for a specific protocol.\n     * @dev `protocol`: The identification string of the protocol.\n     * @dev `operator`: The address of the operator.\n     * @dev `supported`: Whether the operator is supported or not.\n     */\n    event OperatorSupportChanged(string indexed protocol, address indexed operator, bool supported);\n\n    /**\n     * @notice Update the support status of multiple tokens.\n     * @dev Emits a [`TokenSupportChanged()`](#tokensupportchanged) event for each token whose status changed.\n     * @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)\n     *  error if no token status changed.\n     * @param _tokens An array of [`WhitelistingTokenRecord`](./struct.WhitelistingTokenRecord.html)\n     * structs containing token addresses, support statuses and permissions.\n     */\n    function updateTokensSupport(WhitelistingTokenRecord[] calldata _tokens) external;\n\n    /**\n     * @notice Update the support status of a protocol.\n     * @dev Emits a [`ProtocolSupportChanged()`](#protocolsupportchanged) event.\n     * @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)\n     *  error if protocol status is up to date.\n     * @param _protocol The identification string of the protocol.\n     * @param _adapterEvaluator The address of the adapter evaluator for the protocol.\n     * @param _supported Whether the protocol is supported or not.\n     */\n    function updateProtocolSupport(\n        string calldata _protocol,\n        address _adapterEvaluator,\n        bool _supported\n    ) external;\n\n    /**\n     * @notice Update the support status of multiple operators for a specific protocol.\n     * @dev Emits a [`OperatorSupportChanged()`](#operatorsupportchanged) event for each token whose status changed.\n     * @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)\n     *  error if no operator status changed.\n     * @param _protocol The identification string of the protocol.\n     * @param _operators An array of `WhitelistingAddressRecord` structs containing operator addresses and support statuses.\n     */\n    function updateOperatorsSupport(\n        string calldata _protocol,\n        WhitelistingAddressRecord[] calldata _operators\n    ) external;\n\n    /**\n     * @notice Ensures that a token has the specified permission level.\n     * @dev This check does not enforce exact match, but only that level is sufficient.\n     *  So if `permission` is TokenPermission.TradeOnly and the token has TokenPermission.Collateral\n     *  then it assumes that level is sufficient since Collateral level includes both\n     *  TradeOnly and Collateral levels.\n     * @param token The address of the token to check for permission.\n     * @param permission The required [`TokenPermission`](TokenPermission) to be enforced.\n     */\n    function enforceTokenHasPermission(address token, TokenPermission permission) external view;\n\n    /**\n     * @notice Returns the support status of a token as well as it's permissions.\n     * @param _token The address of the token.\n     * @return The [`Status`](./enum.Status.html)\n     * of the token.\n     * @return The [`TokenPermission`](./enum.TokenPermission.html)\n     * of the token.\n     */\n    function getTokenSupport(address _token) external view returns (Status, TokenPermission);\n\n    /**\n     * @notice Returns the support status of a protocol.\n     * @param _protocol The identification string of the protocol.\n     * @return The [`Status`](./enum.Status.html)\n     *  of the protocol.\n     */\n    function getProtocolStatus(string calldata _protocol) external view returns (Status);\n\n    /**\n     * @notice Returns the address of the adapter evaluator for a protocol.\n     * @param _protocol The identification string of the protocol.\n     * @return The address of the adapter evaluator for the protocol.\n     */\n    function getProtocolEvaluator(string calldata _protocol) external view returns (address);\n\n    /**\n     * @notice Returns the support status of an operator for a specific protocol.\n     * @param _operator The address of the operator.\n     * @return operatorStatus_ The [`Status`](./enum.Status.html)\n     *  of the operator.\n     * @return protocolStatus_ The [`Status`](./enum.Status.html)\n     *  of the protocol.\n     */\n    function getOperatorStatus(\n        address _operator\n    ) external view returns (Status operatorStatus_, Status protocolStatus_);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IClipperRouter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IClipperRouter {\n    /// @notice Same as `clipperSwapTo` but uses `msg.sender` as recipient\n    /// @param srcToken Source token\n    /// @param dstToken Destination token\n    /// @param inputAmount Amount of source tokens to swap\n    /// @param outputAmount Amount of destination tokens to receive\n    /// @param goodUntil Timestamp until the swap will be valid\n    /// @param r Clipper order signature (r part)\n    /// @param vs Clipper order signature (vs part)\n    /// @return returnAmount Amount of destination tokens received\n    function clipperSwap(\n        address clipperExchange,\n        address srcToken,\n        address dstToken,\n        uint256 inputAmount,\n        uint256 outputAmount,\n        uint256 goodUntil,\n        bytes32 r,\n        bytes32 vs\n    ) external payable returns (uint256 returnAmount);\n\n    /// @notice Performs swap using Clipper exchange. Wraps and unwraps ETH if required.\n    /// Sending non-zero `msg.value` for anything but ETH swaps is prohibited\n    /// @param recipient Address that will receive swap funds\n    /// @param srcToken Source token\n    /// @param dstToken Destination token\n    /// @param inputAmount Amount of source tokens to swap\n    /// @param outputAmount Amount of destination tokens to receive\n    /// @param goodUntil Timestamp until the swap will be valid\n    /// @param r Clipper order signature (r part)\n    /// @param vs Clipper order signature (vs part)\n    /// @return returnAmount Amount of destination tokens received\n    function clipperSwapTo(\n        address clipperExchange,\n        address payable recipient,\n        address srcToken,\n        address dstToken,\n        uint256 inputAmount,\n        uint256 outputAmount,\n        uint256 goodUntil,\n        bytes32 r,\n        bytes32 vs\n    ) external payable returns (uint256 returnAmount);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IGenericRouter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IGenericRouter {\n    struct SwapDescription {\n        address srcToken;\n        address dstToken;\n        address payable srcReceiver;\n        address payable dstReceiver;\n        uint256 amount;\n        uint256 minReturnAmount;\n        uint256 flags;\n    }\n\n    /// @notice Performs a swap, delegating all calls encoded in `data` to `executor`. See tests for usage examples\n    /// @dev router keeps 1 wei of every token on the contract balance for gas optimisations reasons. This affects first swap of every token by leaving 1 wei on the contract.\n    /// @param executor Aggregation executor that executes calls described in `data`\n    /// @param desc Swap description\n    /// @param permit Should contain valid permit that can be used in `addressPermit.permit` calls.\n    /// @param data Encoded calls that `caller` should execute in between of swaps\n    /// @return returnAmount Resulting token amount\n    /// @return spentAmount Source token amount\n    function swap(\n        address executor,\n        SwapDescription calldata desc,\n        bytes calldata permit,\n        bytes calldata data\n    ) external payable returns (uint256 returnAmount, uint256 spentAmount);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderLib.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IOrderLib {\n    struct Order {\n        uint256 salt;\n        address makerAsset;\n        address takerAsset;\n        address maker;\n        address receiver;\n        address allowedSender; // equals to Zero address on public orders\n        uint256 makingAmount;\n        uint256 takingAmount;\n        uint256 offsets;\n        // bytes makerAssetData;\n        // bytes takerAssetData;\n        // bytes getMakingAmount; // this.staticcall(abi.encodePacked(bytes, swapTakerAmount)) => (swapMakerAmount)\n        // bytes getTakingAmount; // this.staticcall(abi.encodePacked(bytes, swapMakerAmount)) => (swapTakerAmount)\n        // bytes predicate;       // this.staticcall(bytes) => (bool)\n        // bytes permit;          // On first fill: permit.1.call(abi.encodePacked(permit.selector, permit.2))\n        // bytes preInteraction;\n        // bytes postInteraction;\n        bytes interactions; // concat(makerAssetData, takerAssetData, getMakingAmount, getTakingAmount, predicate, permit, preIntercation, postInteraction)\n    }\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {IOrderLib} from \"./IOrderLib.sol\";\n\ninterface IOrderMixin {\n    /**\n     * @notice Fills an order. If one doesn't exist (first fill) it will be created using order.makerAssetData\n     * @param order Order quote to fill\n     * @param signature Signature to confirm quote ownership\n     * @param interaction A call data for InteractiveNotificationReceiver. Taker may execute interaction after getting maker assets and before sending taker assets.\n     * @param makingAmount Making amount\n     * @param takingAmount Taking amount\n     * @param skipPermitAndThresholdAmount Specifies maximum allowed takingAmount when takingAmount is zero, otherwise specifies minimum allowed makingAmount. Top-most bit specifies whether taker wants to skip maker's permit.\n     * @return actualMakingAmount Actual amount transferred from maker to taker\n     * @return actualTakingAmount Actual amount transferred from taker to maker\n     * @return orderHash Hash of the filled order\n     */\n    function fillOrder(\n        IOrderLib.Order calldata order,\n        bytes calldata signature,\n        bytes calldata interaction,\n        uint256 makingAmount,\n        uint256 takingAmount,\n        uint256 skipPermitAndThresholdAmount\n    )\n        external\n        payable\n        returns (uint256 actualMakingAmount, uint256 actualTakingAmount, bytes32 orderHash);\n\n    /**\n     * @notice Same as `fillOrder` but allows to specify funds destination instead of `msg.sender`\n     * @param order_ Order quote to fill\n     * @param signature Signature to confirm quote ownership\n     * @param interaction A call data for InteractiveNotificationReceiver. Taker may execute interaction after getting maker assets and before sending taker assets.\n     * @param makingAmount Making amount\n     * @param takingAmount Taking amount\n     * @param skipPermitAndThresholdAmount Specifies maximum allowed takingAmount when takingAmount is zero, otherwise specifies minimum allowed makingAmount. Top-most bit specifies whether taker wants to skip maker's permit.\n     * @param target Address that will receive swap funds\n     * @return actualMakingAmount Actual amount transferred from maker to taker\n     * @return actualTakingAmount Actual amount transferred from taker to maker\n     * @return orderHash Hash of the filled order\n     */\n    function fillOrderTo(\n        IOrderLib.Order calldata order_,\n        bytes calldata signature,\n        bytes calldata interaction,\n        uint256 makingAmount,\n        uint256 takingAmount,\n        uint256 skipPermitAndThresholdAmount,\n        address target\n    )\n        external\n        payable\n        returns (uint256 actualMakingAmount, uint256 actualTakingAmount, bytes32 orderHash);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderRFQLib.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IOrderRFQLib {\n    struct OrderRFQ {\n        uint256 info; // lowest 64 bits is the order id, next 64 bits is the expiration timestamp\n        address makerAsset;\n        address takerAsset;\n        address maker;\n        address allowedSender; // equals to Zero address on public orders\n        uint256 makingAmount;\n        uint256 takingAmount;\n    }\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IOrderRFQMixin.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {IOrderRFQLib} from \"./IOrderRFQLib.sol\";\n\ninterface IOrderRFQMixin {\n    /**\n     * @notice Fills order's quote, fully or partially (whichever is possible)\n     * @param order Order quote to fill\n     * @param signature Signature to confirm quote ownership\n     * @param flagsAndAmount Fill configuration flags with amount packed in one slot\n     * @return filledMakingAmount Actual amount transferred from maker to taker\n     * @return filledTakingAmount Actual amount transferred from taker to maker\n     * @return orderHash Hash of the filled order\n     */\n    function fillOrderRFQ(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes calldata signature,\n        uint256 flagsAndAmount\n    )\n        external\n        payable\n        returns (\n            uint256 /* filledMakingAmount */,\n            uint256 /* filledTakingAmount */,\n            bytes32 /* orderHash */\n        );\n\n    /**\n     * @notice Fills order's quote, fully or partially, with compact signature\n     * @param order Order quote to fill\n     * @param r R component of signature\n     * @param vs VS component of signature\n     * @param flagsAndAmount Fill configuration flags with amount packed in one slot\n     * - Bits 0-252 contain the amount to fill\n     * - Bit 253 is used to indicate whether signature is 64-bit (0) or 65-bit (1)\n     * - Bit 254 is used to indicate whether smart contract (1) signed the order or not (0)\n     * - Bit 255 is used to indicate whether maker (1) or taker amount (0) is given in the amount parameter\n     * @return filledMakingAmount Actual amount transferred from maker to taker\n     * @return filledTakingAmount Actual amount transferred from taker to maker\n     * @return orderHash Hash of the filled order\n     */\n    function fillOrderRFQCompact(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes32 r,\n        bytes32 vs,\n        uint256 flagsAndAmount\n    )\n        external\n        payable\n        returns (uint256 filledMakingAmount, uint256 filledTakingAmount, bytes32 orderHash);\n\n    /**\n     * @notice Same as `fillOrderRFQ` but allows to specify funds destination instead of `msg.sender`\n     * @param order Order quote to fill\n     * @param signature Signature to confirm quote ownership\n     * @param flagsAndAmount Fill configuration flags with amount packed in one slot\n     * @param target Address that will receive swap funds\n     * @return filledMakingAmount Actual amount transferred from maker to taker\n     * @return filledTakingAmount Actual amount transferred from taker to maker\n     * @return orderHash Hash of the filled order\n     */\n    function fillOrderRFQTo(\n        IOrderRFQLib.OrderRFQ memory order,\n        bytes calldata signature,\n        uint256 flagsAndAmount,\n        address target\n    )\n        external\n        payable\n        returns (uint256 filledMakingAmount, uint256 filledTakingAmount, bytes32 orderHash);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IUniswapV3Router.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IUniswapV3Router {\n    /// @notice Same as `uniswapV3SwapTo` but uses `msg.sender` as recipient\n    /// @param amount Amount of source tokens to swap\n    /// @param minReturn Minimal allowed returnAmount to make transaction commit\n    /// @param pools Pools chain used for swaps. Pools src and dst tokens should match to make swap happen\n    function uniswapV3Swap(\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] calldata pools\n    ) external payable returns (uint256 returnAmount);\n\n    /// @notice Performs swap using Uniswap V3 exchange. Wraps and unwraps ETH if required.\n    /// Sending non-zero `msg.value` for anything but ETH swaps is prohibited\n    /// @param recipient Address that will receive swap funds\n    /// @param amount Amount of source tokens to swap\n    /// @param minReturn Minimal allowed returnAmount to make transaction commit\n    /// @param pools Pools chain used for swaps. Pools src and dst tokens should match to make swap happen\n    function uniswapV3SwapTo(\n        address payable recipient,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] calldata pools\n    ) external payable returns (uint256 returnAmount);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/oneinchV5/IUnoswapRouter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IUnoswapRouter {\n    /// @notice Performs swap using Uniswap exchange. Wraps and unwraps ETH if required.\n    /// Sending non-zero `msg.value` for anything but ETH swaps is prohibited\n    /// @param srcToken Source token\n    /// @param amount Amount of source tokens to swap\n    /// @param minReturn Minimal allowed returnAmount to make transaction commit\n    /// @param pools Pools chain used for swaps. Pools src and dst tokens should match to make swap happen\n    function unoswap(\n        address srcToken,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] calldata pools\n    ) external payable returns (uint256 returnAmount);\n\n    /// @notice Performs swap using Uniswap exchange. Wraps and unwraps ETH if required.\n    /// Sending non-zero `msg.value` for anything but ETH swaps is prohibited\n    /// @param recipient Address that will receive swapped funds\n    /// @param srcToken Source token\n    /// @param amount Amount of source tokens to swap\n    /// @param minReturn Minimal allowed returnAmount to make transaction commit\n    /// @param pools Pools chain used for swaps. Pools src and dst tokens should match to make swap happen\n    function unoswapTo(\n        address payable recipient,\n        address srcToken,\n        uint256 amount,\n        uint256 minReturn,\n        uint256[] calldata pools\n    ) external payable returns (uint256 returnAmount);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/uniswapV3/index.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {INonfungiblePositionManager} from \"./INonfungiblePositionManager.sol\";\nimport {ISwapRouter} from \"./ISwapRouter.sol\";\nimport {IUniswapV3Pool} from \"./IUniswapV3Pool.sol\";\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/uniswapV3/INonfungiblePositionManager.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/* solhint-disable ordering */\ninterface INonfungiblePositionManager {\n    event IncreaseLiquidity(\n        uint256 indexed tokenId,\n        uint128 liquidity,\n        uint256 amount0,\n        uint256 amount1\n    );\n    event DecreaseLiquidity(\n        uint256 indexed tokenId,\n        uint128 liquidity,\n        uint256 amount0,\n        uint256 amount1\n    );\n    event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);\n\n    struct MintParams {\n        address token0;\n        address token1;\n        uint24 fee;\n        int24 tickLower;\n        int24 tickUpper;\n        uint256 amount0Desired;\n        uint256 amount1Desired;\n        uint256 amount0Min;\n        uint256 amount1Min;\n        address recipient;\n        uint256 deadline;\n    }\n\n    function mint(\n        MintParams calldata params\n    )\n        external\n        payable\n        returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);\n\n    struct IncreaseLiquidityParams {\n        uint256 tokenId;\n        uint256 amount0Desired;\n        uint256 amount1Desired;\n        uint256 amount0Min;\n        uint256 amount1Min;\n        uint256 deadline;\n    }\n\n    function increaseLiquidity(\n        IncreaseLiquidityParams calldata params\n    ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);\n\n    struct DecreaseLiquidityParams {\n        uint256 tokenId;\n        uint128 liquidity;\n        uint256 amount0Min;\n        uint256 amount1Min;\n        uint256 deadline;\n    }\n\n    function decreaseLiquidity(\n        DecreaseLiquidityParams calldata params\n    ) external payable returns (uint256 amount0, uint256 amount1);\n\n    struct CollectParams {\n        uint256 tokenId;\n        address recipient;\n        uint128 amount0Max;\n        uint128 amount1Max;\n    }\n\n    function collect(\n        CollectParams calldata params\n    ) external payable returns (uint256 amount0, uint256 amount1);\n\n    function positions(\n        uint256 tokenId\n    )\n        external\n        view\n        returns (\n            uint96 nonce,\n            address operator,\n            address token0,\n            address token1,\n            uint24 fee,\n            int24 tickLower,\n            int24 tickUpper,\n            uint128 liquidity,\n            uint256 feeGrowthInside0LastX128,\n            uint256 feeGrowthInside1LastX128,\n            uint128 tokensOwed0,\n            uint128 tokensOwed1\n        );\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/uniswapV3/ISwapRouter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/* solhint-disable ordering */\ninterface ISwapRouter {\n    struct ExactInputSingleParams {\n        address tokenIn;\n        address tokenOut;\n        uint24 fee;\n        address recipient;\n        uint256 deadline;\n        uint256 amountIn;\n        uint256 amountOutMinimum;\n        uint160 sqrtPriceLimitX96;\n    }\n\n    /// @notice Swaps `amountIn` of one token for as much as possible of another token\n    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata\n    /// @return amountOut The amount of the received token\n    function exactInputSingle(\n        ExactInputSingleParams calldata params\n    ) external payable returns (uint256 amountOut);\n\n    struct ExactInputParams {\n        bytes path;\n        address recipient;\n        uint256 deadline;\n        uint256 amountIn;\n        uint256 amountOutMinimum;\n    }\n\n    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path\n    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata\n    /// @return amountOut The amount of the received token\n    function exactInput(\n        ExactInputParams calldata params\n    ) external payable returns (uint256 amountOut);\n\n    struct ExactOutputSingleParams {\n        address tokenIn;\n        address tokenOut;\n        uint24 fee;\n        address recipient;\n        uint256 deadline;\n        uint256 amountOut;\n        uint256 amountInMaximum;\n        uint160 sqrtPriceLimitX96;\n    }\n\n    /// @notice Swaps as little as possible of one token for `amountOut` of another token\n    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata\n    /// @return amountIn The amount of the input token\n    function exactOutputSingle(\n        ExactOutputSingleParams calldata params\n    ) external payable returns (uint256 amountIn);\n\n    struct ExactOutputParams {\n        bytes path;\n        address recipient;\n        uint256 deadline;\n        uint256 amountOut;\n        uint256 amountInMaximum;\n    }\n\n    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)\n    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata\n    /// @return amountIn The amount of the input token\n    function exactOutput(\n        ExactOutputParams calldata params\n    ) external payable returns (uint256 amountIn);\n}\n/* solhint-enable ordering */\n"
      },
      "contracts/interfaces/accountAbstraction/compliance/uniswapV3/IUniswapV3Pool.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\ninterface IUniswapV3Pool {\n    function token0() external view returns (address);\n\n    function token1() external view returns (address);\n\n    function fee() external view returns (uint24);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/IDecreasePositionEvaluator.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {Asset} from \"contracts/libraries/AssetLibrary.sol\";\nimport {Command} from \"../Command.sol\";\nimport {PositionDescriptor} from \"./PositionDescriptor.sol\";\n\ninterface IDecreasePositionEvaluator {\n    /**\n     * @notice Request structure for decreasing a position.\n     * @dev `descriptor`: The [`PositionDescriptor`](/interfaces/accountAbstraction/interpreter/adapters/PositionDescriptor.sol/struct.PositionDescriptor.html)\n     *  struct.\n     * @dev `liquidity`: Abstract amount that can be interpreted differently in different protocols (e.g., amount of LP tokens to burn).\n     * @dev `minOutput`: [`Asset`](/interfaces/accountAbstraction/compliance/Asset.sol/struct.Asset.html) array with minimum amounts that must be retrieved from the position.\n     */\n    struct DecreasePositionRequest {\n        PositionDescriptor descriptor;\n        uint256 liquidity;\n        Asset[] minOutput;\n    }\n\n    /**\n     * @notice Evaluate a decrease position request.\n     * @param _operator Address which initiated the request\n     * @param _request The [`DecreasePositionRequest`](#decreasepositionrequest) struct containing decrease position details.\n     * @return cmds_ An array of [`Command`](../../Command.sol/struct.Command.html) to execute the request.\n     */\n    function evaluate(\n        address _operator,\n        DecreasePositionRequest calldata _request\n    ) external returns (Command[] memory cmds_);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/IExchangeEvaluator.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {Command} from \"../Command.sol\";\n\n/**\n * @title IExchangeEvaluator\n * @notice Interface for compiling commands for token exchanges for different protocols.\n */\ninterface IExchangeEvaluator {\n    /**\n     * @notice Structure for an exchange token request.\n     * @dev `path`: Encoded path of tokens to follow in the exchange, including pool identifiers.\n     * 20 bytes(tokenA) + 4 byte(poolId_A_B) + 20 bytes(tokenB) + ...\n     * ... + 4 byte(poolId_N-1_N) + 20 bytes(tokenN).\n     * @dev `extraData`: Additional data specific to a particular protocol, such as the response from a 1Inch Exchange API.\n     * @dev `amountIn`: The amount of tokenA to spend.\n     * @dev `minAmountOut`: The minimum amount of tokenN to receive.\n     * @dev `recipient`: The recipient of tokenN.\n     */\n    struct ExchangeRequest {\n        bytes path;\n        bytes extraData;\n        uint256 amountIn;\n        uint256 minAmountOut;\n        address recipient;\n    }\n\n    /**\n     * @notice Constructs an exchange token request.\n     * @param _operator Address which initiated the request\n     * @param _request The [`ExchangeRequest`](#exchangerequest) struct containing exchange token details.\n     * @return cmds_ An array of [`Command`](../../Command.sol/struct.Command.html) to execute the request.\n     */\n    function evaluate(\n        address _operator,\n        ExchangeRequest calldata _request\n    ) external view returns (Command[] memory cmds_);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/IIncreasePositionEvaluator.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {Asset} from \"contracts/libraries/AssetLibrary.sol\";\nimport {Command} from \"../Command.sol\";\nimport {PositionDescriptor} from \"./PositionDescriptor.sol\";\n\ninterface IIncreasePositionEvaluator {\n    /**\n     * @notice Structure for an increase position request.\n     * @dev `descriptor`: The [`PositionDescriptor`](/interfaces/accountAbstraction/interpreter/adapters/PositionDescriptor.sol/struct.PositionDescriptor.html)\n     *  struct.\n     * @dev `input`: An array of [`Asset`](/interfaces/accountAbstraction/compliance/Asset.sol/struct.Asset.html) representing the token-amounts that will be added to the position.\n     * @dev `minLiquidityOut`: An abstract amount that can be interpreted differently in different protocols (e.g., minimum amount of LP tokens to receive).\n     */\n    struct IncreasePositionRequest {\n        PositionDescriptor descriptor;\n        Asset[] input;\n        uint256 minLiquidityOut;\n    }\n\n    /**\n     * @notice Evaluate a increase position request.\n     * @param _operator Address which initiated the request\n     * @param _request The [`IncreasePositionRequest`](#increasepositionrequest) struct containing increase position details.\n     * @return cmds_ An array of [`Command`](../../Command.sol/struct.Command.html) to execute the request.\n     */\n    function evaluate(\n        address _operator,\n        IncreasePositionRequest calldata _request\n    ) external returns (Command[] memory cmds_);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/ILiquidityPoolsRepository.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/* solhint-disable no-unused-import */\nimport {\n    Status,\n    TokenIsNotSupported\n} from \"contracts/interfaces/accountAbstraction/compliance/IWhitelistingController.sol\";\nimport {AlreadyUpToDate} from \"contracts/interfaces/base/CommonErrors.sol\";\n/* solhint-enable no-unused-import */\n\n/**\n * @notice Error indicating that the pool ID was not found.\n * @param encodedPool The encoded pool data that was searched for.\n */\nerror PoolIdNotFound(bytes encodedPool);\n\n/**\n * @notice Error indicating that the pool does not exist.\n * @param poolId The unique identifier of the pool that was searched for.\n */\nerror PoolIsNotSupported(uint256 poolId);\n\n/**\n * @notice Error indicating that the pool is suspended.\n * @param poolId The unique identifier of the pool that is suspended.\n */\nerror PoolIsSuspended(uint256 poolId);\n\n/**\n * @title ILiquidityPoolsRepository\n * @notice Interface for managing liquidity pools and their support status.\n */\ninterface ILiquidityPoolsRepository {\n    /**\n     * @notice Update the support status of a liquidity pool.\n     * @param _encodedPool The encoded pool data.\n     * @param _supported Whether the pool is supported or not.\n     * @return poolId_ The unique identifier of the pool.\n     * @dev Reverts with a [`PoolIdNotFound()`](/interfaces/accountAbstraction/interpreter/adapters/ILiquidityPoolsRepository.sol/error.PoolIdNotFound.html)\n     *  error if the pool does not exist.\n     */\n    function updatePoolSupport(\n        bytes calldata _encodedPool,\n        bool _supported\n    ) external returns (uint256 poolId_);\n\n    /**\n     * @notice Get the status of a specific pool.\n     * @param _poolId The unique identifier of the pool.\n     * @return status The status of the pool.\n     * @dev Reverts with a [`PoolIsNotSupported()`](/interfaces/accountAbstraction/interpreter/adapters/ILiquidityPoolsRepository.sol/error.PoolIsNotSupported.html)\n     *  error if the pool does not exist.\n     */\n    function getPoolStatus(uint256 _poolId) external returns (Status status);\n\n    /**\n     * @notice Get the unique identifier (pool ID) of a specific pool.\n     * @param _encodedPool The encoded pool data.\n     * @return poolId_ The unique identifier of the pool.\n     * @dev Reverts with a [`PoolIsNotSupported()`](/interfaces/accountAbstraction/interpreter/adapters/ILiquidityPoolsRepository.sol/error.PoolIsNotSupported.html)\n     *  error if the pool does not exist.\n     */\n    function getPoolId(bytes calldata _encodedPool) external view returns (uint256 poolId_);\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/index.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {\n    IDecreasePositionEvaluator\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/IDecreasePositionEvaluator.sol\";\nimport {\n    IExchangeEvaluator\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/IExchangeEvaluator.sol\";\nimport {\n    IIncreasePositionEvaluator\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/IIncreasePositionEvaluator.sol\";\nimport {\n    AlreadyUpToDate,\n    ILiquidityPoolsRepository,\n    PoolIdNotFound,\n    PoolIsNotSupported,\n    PoolIsSuspended,\n    Status,\n    TokenIsNotSupported\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/ILiquidityPoolsRepository.sol\";\nimport {\n    PositionDescriptor\n} from \"contracts/interfaces/accountAbstraction/interpreter/adapters/PositionDescriptor.sol\";\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/adapters/PositionDescriptor.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n// TODO CRYPTO-145: Possibly move into appropriate interface?\n/**\n * @notice Used to determine the required position for an operation.\n * @dev `poolId`: An identifier that is unique within a single protocol.\n * @dev `extraData`: Additional data used to specify the position, for example\n * this is used in OneInchV5Evaluator to pass swap tx generated via 1inch API.\n */\nstruct PositionDescriptor {\n    uint256 poolId;\n    bytes extraData;\n}\n"
      },
      "contracts/interfaces/accountAbstraction/interpreter/Command.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {CommandLibrary} from \"contracts/libraries/CommandLibrary.sol\";\n\n/**\n * @title Command\n * @notice Contains arguments for a low-level call.\n * @dev This struct allows deferring the call's execution, suspending it by passing it to another function or contract.\n * @dev `target` The address to be called.\n * @dev `value` Value to send in the call.\n * @dev `payload` Encoded call with function selector and arguments.\n */\nstruct Command {\n    address target;\n    uint256 value;\n    bytes payload;\n}\n\nusing CommandLibrary for Command global;\n"
      },
      "contracts/interfaces/base/CommonErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/**\n * @notice An error indicating that the amount for the specified token is zero.\n * @param token The address of the token with a zero amount.\n */\nerror AmountMustNotBeZero(address token);\n\n/**\n * @notice An error indicating that an address must not be zero.\n */\nerror AddressMustNotBeZero();\n\n/**\n * @notice An error indicating that an array must not be empty.\n */\nerror ArrayMustNotBeEmpty();\n\n/**\n * @notice An error indicating storage is already up to date and doesn't need further processing.\n * @dev This error is thrown when attempting to update an entity(s) that is(are) already up to date.\n */\nerror AlreadyUpToDate();\n\n/**\n * @notice An error indicating that an action is unauthorized for the specified account.\n * @param account The address of the unauthorized account.\n */\nerror UnauthorizedAccount(address account);\n"
      },
      "contracts/libraries/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nlibrary Address {\n    address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n    function set(bytes32 _slot, address _value) internal {\n        assembly {\n            sstore(_slot, _value)\n        }\n    }\n\n    function get(bytes32 _slot) internal view returns (address result_) {\n        assembly {\n            result_ := sload(_slot)\n        }\n    }\n\n    function isEth(address _token) internal pure returns (bool) {\n        return _token == ETH || _token == address(0);\n    }\n\n    function sort(address _a, address _b) internal pure returns (address, address) {\n        return _a < _b ? (_a, _b) : (_b, _a);\n    }\n\n    function sort(address[4] memory _array) internal pure returns (address[4] memory _sorted) {\n        // Sorting network for the array of length 4\n        (_sorted[0], _sorted[1]) = sort(_array[0], _array[1]);\n        (_sorted[2], _sorted[3]) = sort(_array[2], _array[3]);\n\n        (_sorted[0], _sorted[2]) = sort(_sorted[0], _sorted[2]);\n        (_sorted[1], _sorted[3]) = sort(_sorted[1], _sorted[3]);\n        (_sorted[1], _sorted[2]) = sort(_sorted[1], _sorted[2]);\n    }\n}\n"
      },
      "contracts/libraries/AssetLibrary.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {SafeTransferLib} from \"solady/src/utils/SafeTransferLib.sol\";\n\nimport {Asset} from \"contracts/interfaces/accountAbstraction/compliance/Asset.sol\";\nimport {AmountMustNotBeZero} from \"contracts/interfaces/base/CommonErrors.sol\";\n\nimport {Address} from \"./Address.sol\";\n\nlibrary AssetLibrary {\n    using SafeTransferLib for address;\n    using Address for address;\n\n    error NotEnoughReceived(address token, uint256 expected, uint256 received);\n\n    function forward(Asset calldata _self, address _to) internal {\n        if (_self.amount == 0) revert AmountMustNotBeZero(_self.token);\n\n        if (_self.token.isEth()) _to.safeTransferETH(_self.amount);\n        else _self.token.safeTransferFrom(msg.sender, _to, _self.amount);\n    }\n\n    function enforceReceived(Asset calldata _self) internal view {\n        if (_self.amount == 0) revert AmountMustNotBeZero(_self.token);\n\n        uint256 balance = _self.token.isEth()\n            ? address(this).balance\n            : _self.token.balanceOf(address(this));\n\n        if (balance < _self.amount) revert NotEnoughReceived(_self.token, _self.amount, balance);\n    }\n}\n"
      },
      "contracts/libraries/CommandLibrary.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {Command} from \"contracts/interfaces/accountAbstraction/interpreter/Command.sol\";\nimport {SafeCall} from \"contracts/libraries/SafeCall.sol\";\n\n/**\n * @notice Utility to convert often-used methods into a Command object\n */\nlibrary CommandPresets {\n    function approve(\n        address _token,\n        address _to,\n        uint256 _amount\n    ) internal pure returns (Command memory cmd_) {\n        cmd_.target = _token;\n        cmd_.payload = abi.encodeCall(IERC20.approve, (_to, _amount));\n    }\n\n    function transfer(\n        address _token,\n        address _to,\n        uint256 _amount\n    ) internal pure returns (Command memory cmd_) {\n        cmd_.target = _token;\n        cmd_.payload = abi.encodeCall(IERC20.transfer, (_to, _amount));\n    }\n}\n\nlibrary CommandExecutor {\n    using SafeCall for Command[];\n\n    function execute(Command[] calldata _cmds) external {\n        _cmds.safeCallAll();\n    }\n}\n\nlibrary CommandLibrary {\n    using CommandLibrary for Command[];\n\n    function last(Command[] memory _self) internal pure returns (Command memory) {\n        return _self[_self.length - 1];\n    }\n\n    function asArray(Command memory _self) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](1);\n        result_[0] = _self;\n    }\n\n    function concat(\n        Command memory _self,\n        Command memory _cmd\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](2);\n        result_[0] = _self;\n        result_[1] = _cmd;\n    }\n\n    function concat(\n        Command memory _self,\n        Command[] memory _cmds\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](_cmds.length + 1);\n        result_[0] = _self;\n        for (uint256 i = 1; i < result_.length; i++) {\n            result_[i] = _cmds[i - 1];\n        }\n    }\n\n    function append(\n        Command[] memory _self,\n        Command[] memory _cmds\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](_self.length + _cmds.length);\n        uint256 i;\n        for (; i < _self.length; i++) {\n            result_[i] = _self[i];\n        }\n        for (; i < result_.length; i++) {\n            result_[i] = _cmds[i - _self.length];\n        }\n    }\n\n    function push(\n        Command[] memory _self,\n        Command memory _cmd\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](_self.length + 1);\n        for (uint256 i; i < _self.length; i++) {\n            result_[i] = _self[i];\n        }\n        result_[_self.length] = _cmd;\n    }\n\n    function unshift(\n        Command[] memory _self,\n        Command memory _cmd\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](1 + _self.length);\n        result_[0] = _cmd;\n        for (uint256 i = 1; i < result_.length; i++) {\n            result_[i] = _self[i - 1];\n        }\n    }\n\n    function unshift(\n        Command[] memory _self,\n        Command[] memory _cmds\n    ) internal pure returns (Command[] memory result_) {\n        result_ = new Command[](_cmds.length + _self.length);\n        uint256 i;\n        for (; i < _cmds.length; i++) {\n            result_[i] = _cmds[i];\n        }\n        for (; i < result_.length; i++) {\n            result_[i] = _self[i - _cmds.length];\n        }\n    }\n\n    function populateWithApprove(\n        Command memory _self,\n        address _token,\n        uint256 _amount\n    ) internal pure returns (Command[] memory result_) {\n        if (_amount != 0) {\n            result_ = CommandPresets.approve(_token, _self.target, _amount).concat(_self);\n        } else {\n            result_ = _self.asArray();\n        }\n    }\n\n    function populateWithRevokeAndApprove(\n        Command memory _self,\n        address _token,\n        uint256 _amount\n    ) internal pure returns (Command[] memory result_) {\n        return\n            CommandPresets.approve(_token, _self.target, 0).concat(\n                _self.populateWithApprove(_token, _amount)\n            );\n    }\n\n    function populateWithApprove(\n        Command[] memory _self,\n        address _token,\n        uint256 _amount\n    ) internal pure returns (Command[] memory result_) {\n        if (_amount != 0) {\n            result_ = _self.unshift(\n                CommandPresets.approve(_token, _self[_self.length - 1].target, _amount)\n            );\n        } else {\n            result_ = _self;\n        }\n    }\n\n    function populateWithApprove(\n        Command memory _self,\n        address[2] memory _tokens,\n        uint256[2] memory _amounts\n    ) internal pure returns (Command[] memory result_) {\n        if (_amounts[0] != 0 && _amounts[1] != 0) {\n            result_ = CommandPresets\n                .approve(_tokens[0], _self.target, _amounts[0])\n                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))\n                .push(_self);\n        } else {\n            if (_amounts[0] != 0) {\n                result_ = populateWithApprove(_self, _tokens[0], _amounts[0]);\n            } else {\n                result_ = populateWithApprove(_self, _tokens[1], _amounts[1]);\n            }\n        }\n    }\n\n    function populateWithApprove(\n        Command memory _self,\n        address[3] memory _tokens,\n        uint256[3] memory _amounts\n    ) internal pure returns (Command[] memory result_) {\n        if (_amounts[0] != 0 && _amounts[1] != 0 && _amounts[2] != 0) {\n            result_ = CommandPresets\n                .approve(_tokens[0], _self.target, _amounts[0])\n                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))\n                .push(CommandPresets.approve(_tokens[2], _self.target, _amounts[2]))\n                .push(_self);\n        } else {\n            if (_amounts[0] == 0) {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[1], _tokens[2]],\n                    [_amounts[1], _amounts[2]]\n                );\n            } else if (_amounts[1] == 0) {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[0], _tokens[2]],\n                    [_amounts[0], _amounts[2]]\n                );\n            } else {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[0], _tokens[1]],\n                    [_amounts[0], _amounts[1]]\n                );\n            }\n        }\n    }\n\n    function populateWithApprove(\n        Command memory _self,\n        address[4] memory _tokens,\n        uint256[4] memory _amounts\n    ) internal pure returns (Command[] memory result_) {\n        if (_amounts[0] != 0 && _amounts[1] != 0 && _amounts[2] != 0 && _amounts[3] != 0) {\n            result_ = CommandPresets\n                .approve(_tokens[0], _self.target, _amounts[0])\n                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))\n                .push(CommandPresets.approve(_tokens[2], _self.target, _amounts[2]))\n                .push(CommandPresets.approve(_tokens[3], _self.target, _amounts[3]))\n                .push(_self);\n        } else {\n            if (_amounts[0] == 0) {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[1], _tokens[2], _tokens[3]],\n                    [_amounts[1], _amounts[2], _amounts[3]]\n                );\n            } else if (_amounts[1] == 0) {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[0], _tokens[2], _tokens[3]],\n                    [_amounts[0], _amounts[2], _amounts[3]]\n                );\n            } else if (_amounts[2] == 0) {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[0], _tokens[1], _tokens[3]],\n                    [_amounts[0], _amounts[1], _amounts[3]]\n                );\n            } else {\n                result_ = populateWithApprove(\n                    _self,\n                    [_tokens[0], _tokens[1], _tokens[2]],\n                    [_amounts[0], _amounts[1], _amounts[2]]\n                );\n            }\n        }\n    }\n}\n"
      },
      "contracts/libraries/SafeCall.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {Command} from \"contracts/interfaces/accountAbstraction/interpreter/Command.sol\";\n\n/**\n * @notice Safe methods performing a low-level calls that revert\n * if the call was not successful\n */\nlibrary SafeCall {\n    using Address for address;\n\n    function safeCallAll(Command[] memory _cmds) internal {\n        for (uint256 i; i < _cmds.length; i++) {\n            safeCall(_cmds[i]);\n        }\n    }\n\n    function safeCall(Command memory _cmd) internal returns (bytes memory result_) {\n        result_ = safeCall(_cmd.target, _cmd.value, _cmd.payload);\n    }\n\n    function safeCall(address _target, bytes memory _data) internal returns (bytes memory result_) {\n        result_ = safeCall(_target, 0, _data);\n    }\n\n    function safeCall(\n        address _target,\n        uint256 _value,\n        bytes memory _data\n    ) internal returns (bytes memory result_) {\n        result_ = _target.functionCallWithValue(_data, _value);\n    }\n\n    function safeDelegateCall(\n        address _target,\n        bytes memory _data\n    ) internal returns (bytes memory result_) {\n        result_ = _target.functionDelegateCall(_data);\n    }\n}\n"
      },
      "solady/src/utils/SafeTransferLib.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\n/// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller.\nlibrary SafeTransferLib {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The ETH transfer has failed.\n    error ETHTransferFailed();\n\n    /// @dev The ERC20 `transferFrom` has failed.\n    error TransferFromFailed();\n\n    /// @dev The ERC20 `transfer` has failed.\n    error TransferFailed();\n\n    /// @dev The ERC20 `approve` has failed.\n    error ApproveFailed();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Suggested gas stipend for contract receiving ETH\n    /// that disallows any storage writes.\n    uint256 internal constant _GAS_STIPEND_NO_STORAGE_WRITES = 2300;\n\n    /// @dev Suggested gas stipend for contract receiving ETH to perform a few\n    /// storage reads and writes, but low enough to prevent griefing.\n    /// Multiply by a small constant (e.g. 2), if needed.\n    uint256 internal constant _GAS_STIPEND_NO_GRIEF = 100000;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       ETH OPERATIONS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Sends `amount` (in wei) ETH to `to`.\n    /// Reverts upon failure.\n    function safeTransferETH(address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Transfer the ETH and check if it succeeded or not.\n            if iszero(call(gas(), to, amount, 0, 0, 0, 0)) {\n                // Store the function selector of `ETHTransferFailed()`.\n                mstore(0x00, 0xb12d13eb)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n    /// The `gasStipend` can be set to a low enough value to prevent\n    /// storage writes or gas griefing.\n    ///\n    /// If sending via the normal procedure fails, force sends the ETH by\n    /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.\n    ///\n    /// Reverts if the current contract has insufficient balance.\n    function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // If insufficient balance, revert.\n            if lt(selfbalance(), amount) {\n                // Store the function selector of `ETHTransferFailed()`.\n                mstore(0x00, 0xb12d13eb)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Transfer the ETH and check if it succeeded or not.\n            if iszero(call(gasStipend, to, amount, 0, 0, 0, 0)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                // We can directly use `SELFDESTRUCT` in the contract creation.\n                // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758\n                if iszero(create(amount, 0x0b, 0x16)) {\n                    // For better gas estimation.\n                    if iszero(gt(gas(), 1000000)) { revert(0, 0) }\n                }\n            }\n        }\n    }\n\n    /// @dev Force sends `amount` (in wei) ETH to `to`, with a gas stipend\n    /// equal to `_GAS_STIPEND_NO_GRIEF`. This gas stipend is a reasonable default\n    /// for 99% of cases and can be overriden with the three-argument version of this\n    /// function if necessary.\n    ///\n    /// If sending via the normal procedure fails, force sends the ETH by\n    /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.\n    ///\n    /// Reverts if the current contract has insufficient balance.\n    function forceSafeTransferETH(address to, uint256 amount) internal {\n        // Manually inlined because the compiler doesn't inline functions with branches.\n        /// @solidity memory-safe-assembly\n        assembly {\n            // If insufficient balance, revert.\n            if lt(selfbalance(), amount) {\n                // Store the function selector of `ETHTransferFailed()`.\n                mstore(0x00, 0xb12d13eb)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Transfer the ETH and check if it succeeded or not.\n            if iszero(call(_GAS_STIPEND_NO_GRIEF, to, amount, 0, 0, 0, 0)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                // We can directly use `SELFDESTRUCT` in the contract creation.\n                // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758\n                if iszero(create(amount, 0x0b, 0x16)) {\n                    // For better gas estimation.\n                    if iszero(gt(gas(), 1000000)) { revert(0, 0) }\n                }\n            }\n        }\n    }\n\n    /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n    /// The `gasStipend` can be set to a low enough value to prevent\n    /// storage writes or gas griefing.\n    ///\n    /// Simply use `gasleft()` for `gasStipend` if you don't need a gas stipend.\n    ///\n    /// Note: Does NOT revert upon failure.\n    /// Returns whether the transfer of ETH is successful instead.\n    function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)\n        internal\n        returns (bool success)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Transfer the ETH and check if it succeeded or not.\n            success := call(gasStipend, to, amount, 0, 0, 0, 0)\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      ERC20 OPERATIONS                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n    /// Reverts upon failure.\n    ///\n    /// The `from` account must have at least `amount` approved for\n    /// the current contract to manage.\n    function safeTransferFrom(address token, address from, address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n\n            mstore(0x60, amount) // Store the `amount` argument.\n            mstore(0x40, to) // Store the `to` argument.\n            mstore(0x2c, shl(96, from)) // Store the `from` argument.\n            // Store the function selector of `transferFrom(address,address,uint256)`.\n            mstore(0x0c, 0x23b872dd000000000000000000000000)\n\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    // Set success to whether the call reverted, if not we check it either\n                    // returned exactly 1 (can't just be non-zero data), or had no return data.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())),\n                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFromFailed()`.\n                mstore(0x00, 0x7939f424)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            mstore(0x60, 0) // Restore the zero slot to zero.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Sends all of ERC20 `token` from `from` to `to`.\n    /// Reverts upon failure.\n    ///\n    /// The `from` account must have at least `amount` approved for\n    /// the current contract to manage.\n    function safeTransferAllFrom(address token, address from, address to)\n        internal\n        returns (uint256 amount)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Cache the free memory pointer.\n\n            mstore(0x40, to) // Store the `to` argument.\n            mstore(0x2c, shl(96, from)) // Store the `from` argument.\n            // Store the function selector of `balanceOf(address)`.\n            mstore(0x0c, 0x70a08231000000000000000000000000)\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n                    staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFromFailed()`.\n                mstore(0x00, 0x7939f424)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            // Store the function selector of `transferFrom(address,address,uint256)`.\n            mstore(0x00, 0x23b872dd)\n            // The `amount` argument is already written to the memory word at 0x6c.\n            amount := mload(0x60)\n\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    // Set success to whether the call reverted, if not we check it either\n                    // returned exactly 1 (can't just be non-zero data), or had no return data.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())),\n                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFromFailed()`.\n                mstore(0x00, 0x7939f424)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            mstore(0x60, 0) // Restore the zero slot to zero.\n            mstore(0x40, m) // Restore the free memory pointer.\n        }\n    }\n\n    /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.\n    /// Reverts upon failure.\n    function safeTransfer(address token, address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x14, to) // Store the `to` argument.\n            mstore(0x34, amount) // Store the `amount` argument.\n            // Store the function selector of `transfer(address,uint256)`.\n            mstore(0x00, 0xa9059cbb000000000000000000000000)\n\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    // Set success to whether the call reverted, if not we check it either\n                    // returned exactly 1 (can't just be non-zero data), or had no return data.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())),\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFailed()`.\n                mstore(0x00, 0x90b8ec18)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Restore the part of the free memory pointer that was overwritten.\n            mstore(0x34, 0)\n        }\n    }\n\n    /// @dev Sends all of ERC20 `token` from the current contract to `to`.\n    /// Reverts upon failure.\n    function safeTransferAll(address token, address to) internal returns (uint256 amount) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.\n            mstore(0x20, address()) // Store the address of the current contract.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n                    staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFailed()`.\n                mstore(0x00, 0x90b8ec18)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            mstore(0x14, to) // Store the `to` argument.\n            // The `amount` argument is already written to the memory word at 0x34.\n            amount := mload(0x34)\n            // Store the function selector of `transfer(address,uint256)`.\n            mstore(0x00, 0xa9059cbb000000000000000000000000)\n\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    // Set success to whether the call reverted, if not we check it either\n                    // returned exactly 1 (can't just be non-zero data), or had no return data.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())),\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                // Store the function selector of `TransferFailed()`.\n                mstore(0x00, 0x90b8ec18)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Restore the part of the free memory pointer that was overwritten.\n            mstore(0x34, 0)\n        }\n    }\n\n    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n    /// Reverts upon failure.\n    function safeApprove(address token, address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x14, to) // Store the `to` argument.\n            mstore(0x34, amount) // Store the `amount` argument.\n            // Store the function selector of `approve(address,uint256)`.\n            mstore(0x00, 0x095ea7b3000000000000000000000000)\n\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    // Set success to whether the call reverted, if not we check it either\n                    // returned exactly 1 (can't just be non-zero data), or had no return data.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())),\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                // Store the function selector of `ApproveFailed()`.\n                mstore(0x00, 0x3e3f8f73)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Restore the part of the free memory pointer that was overwritten.\n            mstore(0x34, 0)\n        }\n    }\n\n    /// @dev Returns the amount of ERC20 `token` owned by `account`.\n    /// Returns zero if the `token` does not exist.\n    function balanceOf(address token, address account) internal view returns (uint256 amount) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x14, account) // Store the `account` argument.\n            // Store the function selector of `balanceOf(address)`.\n            mstore(0x00, 0x70a08231000000000000000000000000)\n            amount :=\n                mul(\n                    mload(0x20),\n                    and( // The arguments of `and` are evaluated from right to left.\n                        gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n                        staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)\n                    )\n                )\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "viaIR": false,
      "optimizer": {
        "enabled": true,
        "runs": 1000000
      },
      "evmVersion": "paris",
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "metadata": {
        "useLiteralContent": true
      },
      "libraries": {}
    }
  }}