creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/utils/Zap.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\npragma solidity 0.8.25;\r\n\r\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\r\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\r\nimport { FixedPointMathLib } from \"solady/utils/FixedPointMathLib.sol\";\r\nimport { CVX, CVXCRV } from \"src/interfaces/convex/Constants.sol\";\r\n\r\n// solhint-disable func-name-mixedcase, var-name-mixedcase\r\ninterface ICurveFactoryPlainPool {\r\n    function price_oracle() external view returns (uint256);\r\n    function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external returns (uint256);\r\n}\r\n\r\ninterface ICurveCryptoPool {\r\n    function price_oracle(uint256 index) external view returns (uint256);\r\n    function exchange_underlying(uint256 i, uint256 j, uint256 dx, uint256 min_dy) external payable returns (uint256);\r\n}\r\n// solhint-enable func-name-mixedcase, var-name-mixedcase\r\n\r\nlibrary Zap {\r\n    using SafeERC20 for IERC20;\r\n    using FixedPointMathLib for uint256;\r\n\r\n    IERC20 internal constant CRV = IERC20(address(0xD533a949740bb3306d119CC777fa900bA034cd52));\r\n\r\n    address internal constant CVXCRV_CRV_POOL = 0x971add32Ea87f10bD192671630be3BE8A11b8623;\r\n    address internal constant CRV_ETH_POOL = 0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14;\r\n    address internal constant CVX_ETH_POOL = 0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4;\r\n    address internal constant CVX_CLEVCVX_POOL = 0xF9078Fb962A7D13F55d40d49C8AA6472aBD1A5a6;\r\n\r\n    function swapCvxToClevCvx(uint256 cvxAmount, uint256 minAmountOut) external returns (uint256) {\r\n        CVX.forceApprove(CVX_CLEVCVX_POOL, cvxAmount);\r\n        return ICurveFactoryPlainPool(CVX_CLEVCVX_POOL).exchange(0, 1, cvxAmount, minAmountOut);\r\n    }\r\n\r\n    function swapCvxCrvToCvx(uint256 cvxCrvAmount, uint256 minAmountOut) external returns (uint256) {\r\n        // cvxCRV -> CRV\r\n        CVXCRV.forceApprove(CVXCRV_CRV_POOL, cvxCrvAmount);\r\n        uint256 crvAmount = ICurveFactoryPlainPool(CVXCRV_CRV_POOL).exchange(1, 0, cvxCrvAmount, 0);\r\n\r\n        // CRV -> ETH\r\n        CRV.forceApprove(CRV_ETH_POOL, crvAmount);\r\n        uint256 ethAmount = ICurveCryptoPool(CRV_ETH_POOL).exchange_underlying(2, 1, crvAmount, 0);\r\n\r\n        // ETH -> CVX\r\n        return ICurveCryptoPool(CVX_ETH_POOL).exchange_underlying{ value: ethAmount }(0, 1, ethAmount, minAmountOut);\r\n    }\r\n}\r\n"
      },
      "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\r\n\r\npragma solidity ^0.8.20;\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n    /**\r\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n     * another (`to`).\r\n     *\r\n     * Note that `value` may be zero.\r\n     */\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n    /**\r\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n     * a call to {approve}. `value` is the new allowance.\r\n     */\r\n    event Approval(address indexed owner, address indexed spender, uint256 value);\r\n\r\n    /**\r\n     * @dev Returns the value of tokens in existence.\r\n     */\r\n    function totalSupply() external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Returns the value of tokens owned by `account`.\r\n     */\r\n    function balanceOf(address account) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transfer(address to, uint256 value) external returns (bool);\r\n\r\n    /**\r\n     * @dev Returns the remaining number of tokens that `spender` will be\r\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n     * zero by default.\r\n     *\r\n     * This value changes when {approve} or {transferFrom} are called.\r\n     */\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\r\n     * caller's tokens.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n     * that someone may use both the old and the new allowance by unfortunate\r\n     * transaction ordering. One possible solution to mitigate this race\r\n     * condition is to first reduce the spender's allowance to 0 and set the\r\n     * desired value afterwards:\r\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n     *\r\n     * Emits an {Approval} event.\r\n     */\r\n    function approve(address spender, uint256 value) external returns (bool);\r\n\r\n    /**\r\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\r\n     * allowance mechanism. `value` is then deducted from the caller's\r\n     * allowance.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\r\n}\r\n"
      },
      "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\r\n\r\npragma solidity ^0.8.20;\r\n\r\nimport {IERC20} from \"../IERC20.sol\";\r\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\r\nimport {Address} from \"../../../utils/Address.sol\";\r\n\r\n/**\r\n * @title SafeERC20\r\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\r\n * contract returns false). Tokens that return no value (and instead revert or\r\n * throw on failure) are also supported, non-reverting calls are assumed to be\r\n * successful.\r\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\r\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\r\n */\r\nlibrary SafeERC20 {\r\n    using Address for address;\r\n\r\n    /**\r\n     * @dev An operation with an ERC20 token failed.\r\n     */\r\n    error SafeERC20FailedOperation(address token);\r\n\r\n    /**\r\n     * @dev Indicates a failed `decreaseAllowance` request.\r\n     */\r\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\r\n\r\n    /**\r\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\r\n     * non-reverting calls are assumed to be successful.\r\n     */\r\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\r\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\r\n    }\r\n\r\n    /**\r\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\r\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\r\n     */\r\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\r\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\r\n    }\r\n\r\n    /**\r\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\r\n     * non-reverting calls are assumed to be successful.\r\n     */\r\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\r\n        uint256 oldAllowance = token.allowance(address(this), spender);\r\n        forceApprove(token, spender, oldAllowance + value);\r\n    }\r\n\r\n    /**\r\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\r\n     * value, non-reverting calls are assumed to be successful.\r\n     */\r\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\r\n        unchecked {\r\n            uint256 currentAllowance = token.allowance(address(this), spender);\r\n            if (currentAllowance < requestedDecrease) {\r\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\r\n            }\r\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\r\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\r\n     * to be set to zero before setting it to a non-zero value, such as USDT.\r\n     */\r\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\r\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\r\n\r\n        if (!_callOptionalReturnBool(token, approvalCall)) {\r\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\r\n            _callOptionalReturn(token, approvalCall);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\r\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\r\n     * @param token The token targeted by the call.\r\n     * @param data The call data (encoded using abi.encode or one of its variants).\r\n     */\r\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\r\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\r\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\r\n        // the target address contains contract code and also asserts for success in the low-level call.\r\n\r\n        bytes memory returndata = address(token).functionCall(data);\r\n        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\r\n            revert SafeERC20FailedOperation(address(token));\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\r\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\r\n     * @param token The token targeted by the call.\r\n     * @param data The call data (encoded using abi.encode or one of its variants).\r\n     *\r\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\r\n     */\r\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\r\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\r\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\r\n        // and not revert is the subcall reverts.\r\n\r\n        (bool success, bytes memory returndata) = address(token).call(data);\r\n        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\r\n    }\r\n}\r\n"
      },
      "lib/solady/src/utils/FixedPointMathLib.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.4;\r\n\r\n/// @notice Arithmetic library with operations for fixed-point numbers.\r\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/FixedPointMathLib.sol)\r\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)\r\nlibrary FixedPointMathLib {\r\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\r\n    /*                       CUSTOM ERRORS                        */\r\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\r\n\r\n    /// @dev The operation failed, as the output exceeds the maximum value of uint256.\r\n    error ExpOverflow();\r\n\r\n    /// @dev The operation failed, as the output exceeds the maximum value of uint256.\r\n    error FactorialOverflow();\r\n\r\n    /// @dev The operation failed, due to an overflow.\r\n    error RPowOverflow();\r\n\r\n    /// @dev The mantissa is too big to fit.\r\n    error MantissaOverflow();\r\n\r\n    /// @dev The operation failed, due to an multiplication overflow.\r\n    error MulWadFailed();\r\n\r\n    /// @dev The operation failed, due to an multiplication overflow.\r\n    error SMulWadFailed();\r\n\r\n    /// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.\r\n    error DivWadFailed();\r\n\r\n    /// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.\r\n    error SDivWadFailed();\r\n\r\n    /// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.\r\n    error MulDivFailed();\r\n\r\n    /// @dev The division failed, as the denominator is zero.\r\n    error DivFailed();\r\n\r\n    /// @dev The full precision multiply-divide operation failed, either due\r\n    /// to the result being larger than 256 bits, or a division by a zero.\r\n    error FullMulDivFailed();\r\n\r\n    /// @dev The output is undefined, as the input is less-than-or-equal to zero.\r\n    error LnWadUndefined();\r\n\r\n    /// @dev The input outside the acceptable domain.\r\n    error OutOfDomain();\r\n\r\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\r\n    /*                         CONSTANTS                          */\r\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\r\n\r\n    /// @dev The scalar of ETH and most ERC20s.\r\n    uint256 internal constant WAD = 1e18;\r\n\r\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\r\n    /*              SIMPLIFIED FIXED POINT OPERATIONS             */\r\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded down.\r\n    function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\r\n            if mul(y, gt(x, div(not(0), y))) {\r\n                mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := div(mul(x, y), WAD)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded down.\r\n    function sMulWad(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mul(x, y)\r\n            // Equivalent to `require((x == 0 || z / x == y) && !(x == -1 && y == type(int256).min))`.\r\n            if iszero(gt(or(iszero(x), eq(sdiv(z, x), y)), lt(not(x), eq(y, shl(255, 1))))) {\r\n                mstore(0x00, 0xedcd4dd4) // `SMulWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := sdiv(z, WAD)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded down, but without overflow checks.\r\n    function rawMulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := div(mul(x, y), WAD)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded down, but without overflow checks.\r\n    function rawSMulWad(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := sdiv(mul(x, y), WAD)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded up.\r\n    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\r\n            if mul(y, gt(x, div(not(0), y))) {\r\n                mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := add(iszero(iszero(mod(mul(x, y), WAD))), div(mul(x, y), WAD))\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * y) / WAD` rounded up, but without overflow checks.\r\n    function rawMulWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := add(iszero(iszero(mod(mul(x, y), WAD))), div(mul(x, y), WAD))\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded down.\r\n    function divWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to `require(y != 0 && (WAD == 0 || x <= type(uint256).max / WAD))`.\r\n            if iszero(mul(y, iszero(mul(WAD, gt(x, div(not(0), WAD)))))) {\r\n                mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := div(mul(x, WAD), y)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded down.\r\n    function sDivWad(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mul(x, WAD)\r\n            // Equivalent to `require(y != 0 && ((x * WAD) / WAD == x))`.\r\n            if iszero(and(iszero(iszero(y)), eq(sdiv(z, WAD), x))) {\r\n                mstore(0x00, 0x5c43740d) // `SDivWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := sdiv(mul(x, WAD), y)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded down, but without overflow and divide by zero checks.\r\n    function rawDivWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := div(mul(x, WAD), y)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded down, but without overflow and divide by zero checks.\r\n    function rawSDivWad(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := sdiv(mul(x, WAD), y)\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded up.\r\n    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to `require(y != 0 && (WAD == 0 || x <= type(uint256).max / WAD))`.\r\n            if iszero(mul(y, iszero(mul(WAD, gt(x, div(not(0), WAD)))))) {\r\n                mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := add(iszero(iszero(mod(mul(x, WAD), y))), div(mul(x, WAD), y))\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `(x * WAD) / y` rounded up, but without overflow and divide by zero checks.\r\n    function rawDivWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := add(iszero(iszero(mod(mul(x, WAD), y))), div(mul(x, WAD), y))\r\n        }\r\n    }\r\n\r\n    /// @dev Equivalent to `x` to the power of `y`.\r\n    /// because `x ** y = (e ** ln(x)) ** y = e ** (ln(x) * y)`.\r\n    function powWad(int256 x, int256 y) internal pure returns (int256) {\r\n        // Using `ln(x)` means `x` must be greater than 0.\r\n        return expWad((lnWad(x) * y) / int256(WAD));\r\n    }\r\n\r\n    /// @dev Returns `exp(x)`, denominated in `WAD`.\r\n    /// Credit to Remco Bloemen under MIT license: https://2π.com/22/exp-ln\r\n    function expWad(int256 x) internal pure returns (int256 r) {\r\n        unchecked {\r\n            // When the result is less than 0.5 we return zero.\r\n            // This happens when `x <= (log(1e-18) * 1e18) ~ -4.15e19`.\r\n            if (x <= -41446531673892822313) return r;\r\n\r\n            /// @solidity memory-safe-assembly\r\n            assembly {\r\n                // When the result is greater than `(2**255 - 1) / 1e18` we can not represent it as\r\n                // an int. This happens when `x >= floor(log((2**255 - 1) / 1e18) * 1e18) ≈ 135`.\r\n                if iszero(slt(x, 135305999368893231589)) {\r\n                    mstore(0x00, 0xa37bfec9) // `ExpOverflow()`.\r\n                    revert(0x1c, 0x04)\r\n                }\r\n            }\r\n\r\n            // `x` is now in the range `(-42, 136) * 1e18`. Convert to `(-42, 136) * 2**96`\r\n            // for more intermediate precision and a binary basis. This base conversion\r\n            // is a multiplication by 1e18 / 2**96 = 5**18 / 2**78.\r\n            x = (x << 78) / 5 ** 18;\r\n\r\n            // Reduce range of x to (-½ ln 2, ½ ln 2) * 2**96 by factoring out powers\r\n            // of two such that exp(x) = exp(x') * 2**k, where k is an integer.\r\n            // Solving this gives k = round(x / log(2)) and x' = x - k * log(2).\r\n            int256 k = ((x << 96) / 54916777467707473351141471128 + 2 ** 95) >> 96;\r\n            x = x - k * 54916777467707473351141471128;\r\n\r\n            // `k` is in the range `[-61, 195]`.\r\n\r\n            // Evaluate using a (6, 7)-term rational approximation.\r\n            // `p` is made monic, we'll multiply by a scale factor later.\r\n            int256 y = x + 1346386616545796478920950773328;\r\n            y = ((y * x) >> 96) + 57155421227552351082224309758442;\r\n            int256 p = y + x - 94201549194550492254356042504812;\r\n            p = ((p * y) >> 96) + 28719021644029726153956944680412240;\r\n            p = p * x + (4385272521454847904659076985693276 << 96);\r\n\r\n            // We leave `p` in `2**192` basis so we don't need to scale it back up for the division.\r\n            int256 q = x - 2855989394907223263936484059900;\r\n            q = ((q * x) >> 96) + 50020603652535783019961831881945;\r\n            q = ((q * x) >> 96) - 533845033583426703283633433725380;\r\n            q = ((q * x) >> 96) + 3604857256930695427073651918091429;\r\n            q = ((q * x) >> 96) - 14423608567350463180887372962807573;\r\n            q = ((q * x) >> 96) + 26449188498355588339934803723976023;\r\n\r\n            /// @solidity memory-safe-assembly\r\n            assembly {\r\n                // Div in assembly because solidity adds a zero check despite the unchecked.\r\n                // The q polynomial won't have zeros in the domain as all its roots are complex.\r\n                // No scaling is necessary because p is already `2**96` too large.\r\n                r := sdiv(p, q)\r\n            }\r\n\r\n            // r should be in the range `(0.09, 0.25) * 2**96`.\r\n\r\n            // We now need to multiply r by:\r\n            // - The scale factor `s ≈ 6.031367120`.\r\n            // - The `2**k` factor from the range reduction.\r\n            // - The `1e18 / 2**96` factor for base conversion.\r\n            // We do this all at once, with an intermediate result in `2**213`\r\n            // basis, so the final right shift is always by a positive amount.\r\n            r = int256(\r\n                (uint256(r) * 3822833074963236453042738258902158003155416615667) >> uint256(195 - k)\r\n            );\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `ln(x)`, denominated in `WAD`.\r\n    /// Credit to Remco Bloemen under MIT license: https://2π.com/22/exp-ln\r\n    function lnWad(int256 x) internal pure returns (int256 r) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // We want to convert `x` from `10**18` fixed point to `2**96` fixed point.\r\n            // We do this by multiplying by `2**96 / 10**18`. But since\r\n            // `ln(x * C) = ln(x) + ln(C)`, we can simply do nothing here\r\n            // and add `ln(2**96 / 10**18)` at the end.\r\n\r\n            // Compute `k = log2(x) - 96`, `r = 159 - k = 255 - log2(x) = 255 ^ log2(x)`.\r\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\r\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\r\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\r\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\r\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\r\n            // We place the check here for more optimal stack operations.\r\n            if iszero(sgt(x, 0)) {\r\n                mstore(0x00, 0x1615e638) // `LnWadUndefined()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            // forgefmt: disable-next-item\r\n            r := xor(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),\r\n                0xf8f9f9faf9fdfafbf9fdfcfdfafbfcfef9fafdfafcfcfbfefafafcfbffffffff))\r\n\r\n            // Reduce range of x to (1, 2) * 2**96\r\n            // ln(2^k * x) = k * ln(2) + ln(x)\r\n            x := shr(159, shl(r, x))\r\n\r\n            // Evaluate using a (8, 8)-term rational approximation.\r\n            // `p` is made monic, we will multiply by a scale factor later.\r\n            // forgefmt: disable-next-item\r\n            let p := sub( // This heavily nested expression is to avoid stack-too-deep for via-ir.\r\n                sar(96, mul(add(43456485725739037958740375743393,\r\n                sar(96, mul(add(24828157081833163892658089445524,\r\n                sar(96, mul(add(3273285459638523848632254066296,\r\n                    x), x))), x))), x)), 11111509109440967052023855526967)\r\n            p := sub(sar(96, mul(p, x)), 45023709667254063763336534515857)\r\n            p := sub(sar(96, mul(p, x)), 14706773417378608786704636184526)\r\n            p := sub(mul(p, x), shl(96, 795164235651350426258249787498))\r\n            // We leave `p` in `2**192` basis so we don't need to scale it back up for the division.\r\n\r\n            // `q` is monic by convention.\r\n            let q := add(5573035233440673466300451813936, x)\r\n            q := add(71694874799317883764090561454958, sar(96, mul(x, q)))\r\n            q := add(283447036172924575727196451306956, sar(96, mul(x, q)))\r\n            q := add(401686690394027663651624208769553, sar(96, mul(x, q)))\r\n            q := add(204048457590392012362485061816622, sar(96, mul(x, q)))\r\n            q := add(31853899698501571402653359427138, sar(96, mul(x, q)))\r\n            q := add(909429971244387300277376558375, sar(96, mul(x, q)))\r\n\r\n            // `p / q` is in the range `(0, 0.125) * 2**96`.\r\n\r\n            // Finalization, we need to:\r\n            // - Multiply by the scale factor `s = 5.549…`.\r\n            // - Add `ln(2**96 / 10**18)`.\r\n            // - Add `k * ln(2)`.\r\n            // - Multiply by `10**18 / 2**96 = 5**18 >> 78`.\r\n\r\n            // The q polynomial is known not to have zeros in the domain.\r\n            // No scaling required because p is already `2**96` too large.\r\n            p := sdiv(p, q)\r\n            // Multiply by the scaling factor: `s * 5**18 * 2**96`, base is now `5**18 * 2**192`.\r\n            p := mul(1677202110996718588342820967067443963516166, p)\r\n            // Add `ln(2) * k * 5**18 * 2**192`.\r\n            // forgefmt: disable-next-item\r\n            p := add(mul(16597577552685614221487285958193947469193820559219878177908093499208371, sub(159, r)), p)\r\n            // Add `ln(2**96 / 10**18) * 5**18 * 2**192`.\r\n            p := add(600920179829731861736702779321621459595472258049074101567377883020018308, p)\r\n            // Base conversion: mul `2**18 / 2**192`.\r\n            r := sar(174, p)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `W_0(x)`, denominated in `WAD`.\r\n    /// See: https://en.wikipedia.org/wiki/Lambert_W_function\r\n    /// a.k.a. Product log function. This is an approximation of the principal branch.\r\n    function lambertW0Wad(int256 x) internal pure returns (int256 w) {\r\n        // forgefmt: disable-next-item\r\n        unchecked {\r\n            if ((w = x) <= -367879441171442322) revert OutOfDomain(); // `x` less than `-1/e`.\r\n            int256 wad = int256(WAD);\r\n            int256 p = x;\r\n            uint256 c; // Whether we need to avoid catastrophic cancellation.\r\n            uint256 i = 4; // Number of iterations.\r\n            if (w <= 0x1ffffffffffff) {\r\n                if (-0x4000000000000 <= w) {\r\n                    i = 1; // Inputs near zero only take one step to converge.\r\n                } else if (w <= -0x3ffffffffffffff) {\r\n                    i = 32; // Inputs near `-1/e` take very long to converge.\r\n                }\r\n            } else if (w >> 63 == 0) {\r\n                /// @solidity memory-safe-assembly\r\n                assembly {\r\n                    // Inline log2 for more performance, since the range is small.\r\n                    let v := shr(49, w)\r\n                    let l := shl(3, lt(0xff, v))\r\n                    l := add(or(l, byte(and(0x1f, shr(shr(l, v), 0x8421084210842108cc6318c6db6d54be)),\r\n                        0x0706060506020504060203020504030106050205030304010505030400000000)), 49)\r\n                    w := sdiv(shl(l, 7), byte(sub(l, 31), 0x0303030303030303040506080c13))\r\n                    c := gt(l, 60)\r\n                    i := add(2, add(gt(l, 53), c))\r\n                }\r\n            } else {\r\n                int256 ll = lnWad(w = lnWad(w));\r\n                /// @solidity memory-safe-assembly\r\n                assembly {\r\n                    // `w = ln(x) - ln(ln(x)) + b * ln(ln(x)) / ln(x)`.\r\n                    w := add(sdiv(mul(ll, 1023715080943847266), w), sub(w, ll))\r\n                    i := add(3, iszero(shr(68, x)))\r\n                    c := iszero(shr(143, x))\r\n                }\r\n                if (c == 0) {\r\n                    do { // If `x` is big, use Newton's so that intermediate values won't overflow.\r\n                        int256 e = expWad(w);\r\n                        /// @solidity memory-safe-assembly\r\n                        assembly {\r\n                            let t := mul(w, div(e, wad))\r\n                            w := sub(w, sdiv(sub(t, x), div(add(e, t), wad)))\r\n                        }\r\n                        if (p <= w) break;\r\n                        p = w;\r\n                    } while (--i != 0);\r\n                    /// @solidity memory-safe-assembly\r\n                    assembly {\r\n                        w := sub(w, sgt(w, 2))\r\n                    }\r\n                    return w;\r\n                }\r\n            }\r\n            do { // Otherwise, use Halley's for faster convergence.\r\n                int256 e = expWad(w);\r\n                /// @solidity memory-safe-assembly\r\n                assembly {\r\n                    let t := add(w, wad)\r\n                    let s := sub(mul(w, e), mul(x, wad))\r\n                    w := sub(w, sdiv(mul(s, wad), sub(mul(e, t), sdiv(mul(add(t, wad), s), add(t, t)))))\r\n                }\r\n                if (p <= w) break;\r\n                p = w;\r\n            } while (--i != c);\r\n            /// @solidity memory-safe-assembly\r\n            assembly {\r\n                w := sub(w, sgt(w, 2))\r\n            }\r\n            // For certain ranges of `x`, we'll use the quadratic-rate recursive formula of\r\n            // R. Iacono and J.P. Boyd for the last iteration, to avoid catastrophic cancellation.\r\n            if (c != 0) {\r\n                int256 t = w | 1;\r\n                /// @solidity memory-safe-assembly\r\n                assembly {\r\n                    x := sdiv(mul(x, wad), t)\r\n                }\r\n                x = (t * (wad + lnWad(x)));\r\n                /// @solidity memory-safe-assembly\r\n                assembly {\r\n                    w := sdiv(x, add(wad, t))\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\r\n    /*                  GENERAL NUMBER UTILITIES                  */\r\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\r\n\r\n    /// @dev Calculates `floor(x * y / d)` with full precision.\r\n    /// Throws if result overflows a uint256 or when `d` is zero.\r\n    /// Credit to Remco Bloemen under MIT license: https://2π.com/21/muldiv\r\n    function fullMulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 result) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            for {} 1 {} {\r\n                // 512-bit multiply `[p1 p0] = x * y`.\r\n                // Compute the product mod `2**256` and mod `2**256 - 1`\r\n                // then use the Chinese Remainder Theorem to reconstruct\r\n                // the 512 bit result. The result is stored in two 256\r\n                // variables such that `product = p1 * 2**256 + p0`.\r\n\r\n                // Least significant 256 bits of the product.\r\n                result := mul(x, y) // Temporarily use `result` as `p0` to save gas.\r\n                let mm := mulmod(x, y, not(0))\r\n                // Most significant 256 bits of the product.\r\n                let p1 := sub(mm, add(result, lt(mm, result)))\r\n\r\n                // Handle non-overflow cases, 256 by 256 division.\r\n                if iszero(p1) {\r\n                    if iszero(d) {\r\n                        mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\r\n                        revert(0x1c, 0x04)\r\n                    }\r\n                    result := div(result, d)\r\n                    break\r\n                }\r\n\r\n                // Make sure the result is less than `2**256`. Also prevents `d == 0`.\r\n                if iszero(gt(d, p1)) {\r\n                    mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\r\n                    revert(0x1c, 0x04)\r\n                }\r\n\r\n                /*------------------- 512 by 256 division --------------------*/\r\n\r\n                // Make division exact by subtracting the remainder from `[p1 p0]`.\r\n                // Compute remainder using mulmod.\r\n                let r := mulmod(x, y, d)\r\n                // `t` is the least significant bit of `d`.\r\n                // Always greater or equal to 1.\r\n                let t := and(d, sub(0, d))\r\n                // Divide `d` by `t`, which is a power of two.\r\n                d := div(d, t)\r\n                // Invert `d mod 2**256`\r\n                // Now that `d` is an odd number, it has an inverse\r\n                // modulo `2**256` such that `d * inv = 1 mod 2**256`.\r\n                // Compute the inverse by starting with a seed that is correct\r\n                // correct for four bits. That is, `d * inv = 1 mod 2**4`.\r\n                let inv := xor(2, mul(3, d))\r\n                // Now use Newton-Raphson iteration to improve the precision.\r\n                // Thanks to Hensel's lifting lemma, this also works in modular\r\n                // arithmetic, doubling the correct bits in each step.\r\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**8\r\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**16\r\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**32\r\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**64\r\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**128\r\n                result :=\r\n                    mul(\r\n                        // Divide [p1 p0] by the factors of two.\r\n                        // Shift in bits from `p1` into `p0`. For this we need\r\n                        // to flip `t` such that it is `2**256 / t`.\r\n                        or(\r\n                            mul(sub(p1, gt(r, result)), add(div(sub(0, t), t), 1)),\r\n                            div(sub(result, r), t)\r\n                        ),\r\n                        // inverse mod 2**256\r\n                        mul(inv, sub(2, mul(d, inv)))\r\n                    )\r\n                break\r\n            }\r\n        }\r\n    }\r\n\r\n    /// @dev Calculates `floor(x * y / d)` with full precision, rounded up.\r\n    /// Throws if result overflows a uint256 or when `d` is zero.\r\n    /// Credit to Uniswap-v3-core under MIT license:\r\n    /// https://github.com/Uniswap/v3-core/blob/main/contracts/libraries/FullMath.sol\r\n    function fullMulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 result) {\r\n        result = fullMulDiv(x, y, d);\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            if mulmod(x, y, d) {\r\n                result := add(result, 1)\r\n                if iszero(result) {\r\n                    mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\r\n                    revert(0x1c, 0x04)\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `floor(x * y / d)`.\r\n    /// Reverts if `x * y` overflows, or `d` is zero.\r\n    function mulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\r\n            if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\r\n                mstore(0x00, 0xad251c27) // `MulDivFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := div(mul(x, y), d)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `ceil(x * y / d)`.\r\n    /// Reverts if `x * y` overflows, or `d` is zero.\r\n    function mulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\r\n            if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\r\n                mstore(0x00, 0xad251c27) // `MulDivFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := add(iszero(iszero(mod(mul(x, y), d))), div(mul(x, y), d))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `ceil(x / d)`.\r\n    /// Reverts if `d` is zero.\r\n    function divUp(uint256 x, uint256 d) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            if iszero(d) {\r\n                mstore(0x00, 0x65244e4e) // `DivFailed()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            z := add(iszero(iszero(mod(x, d))), div(x, d))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `max(0, x - y)`.\r\n    function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mul(gt(x, y), sub(x, y))\r\n        }\r\n    }\r\n\r\n    /// @dev Exponentiate `x` to `y` by squaring, denominated in base `b`.\r\n    /// Reverts if the computation overflows.\r\n    function rpow(uint256 x, uint256 y, uint256 b) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mul(b, iszero(y)) // `0 ** 0 = 1`. Otherwise, `0 ** n = 0`.\r\n            if x {\r\n                z := xor(b, mul(xor(b, x), and(y, 1))) // `z = isEven(y) ? scale : x`\r\n                let half := shr(1, b) // Divide `b` by 2.\r\n                // Divide `y` by 2 every iteration.\r\n                for { y := shr(1, y) } y { y := shr(1, y) } {\r\n                    let xx := mul(x, x) // Store x squared.\r\n                    let xxRound := add(xx, half) // Round to the nearest number.\r\n                    // Revert if `xx + half` overflowed, or if `x ** 2` overflows.\r\n                    if or(lt(xxRound, xx), shr(128, x)) {\r\n                        mstore(0x00, 0x49f7642b) // `RPowOverflow()`.\r\n                        revert(0x1c, 0x04)\r\n                    }\r\n                    x := div(xxRound, b) // Set `x` to scaled `xxRound`.\r\n                    // If `y` is odd:\r\n                    if and(y, 1) {\r\n                        let zx := mul(z, x) // Compute `z * x`.\r\n                        let zxRound := add(zx, half) // Round to the nearest number.\r\n                        // If `z * x` overflowed or `zx + half` overflowed:\r\n                        if or(xor(div(zx, x), z), lt(zxRound, zx)) {\r\n                            // Revert if `x` is non-zero.\r\n                            if iszero(iszero(x)) {\r\n                                mstore(0x00, 0x49f7642b) // `RPowOverflow()`.\r\n                                revert(0x1c, 0x04)\r\n                            }\r\n                        }\r\n                        z := div(zxRound, b) // Return properly scaled `zxRound`.\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the square root of `x`.\r\n    function sqrt(uint256 x) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            // `floor(sqrt(2**15)) = 181`. `sqrt(2**15) - 181 = 2.84`.\r\n            z := 181 // The \"correct\" value is 1, but this saves a multiplication later.\r\n\r\n            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad\r\n            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.\r\n\r\n            // Let `y = x / 2**r`. We check `y >= 2**(k + 8)`\r\n            // but shift right by `k` bits to ensure that if `x >= 256`, then `y >= 256`.\r\n            let r := shl(7, lt(0xffffffffffffffffffffffffffffffffff, x))\r\n            r := or(r, shl(6, lt(0xffffffffffffffffff, shr(r, x))))\r\n            r := or(r, shl(5, lt(0xffffffffff, shr(r, x))))\r\n            r := or(r, shl(4, lt(0xffffff, shr(r, x))))\r\n            z := shl(shr(1, r), z)\r\n\r\n            // Goal was to get `z*z*y` within a small factor of `x`. More iterations could\r\n            // get y in a tighter range. Currently, we will have y in `[256, 256*(2**16))`.\r\n            // We ensured `y >= 256` so that the relative difference between `y` and `y+1` is small.\r\n            // That's not possible if `x < 256` but we can just verify those cases exhaustively.\r\n\r\n            // Now, `z*z*y <= x < z*z*(y+1)`, and `y <= 2**(16+8)`, and either `y >= 256`, or `x < 256`.\r\n            // Correctness can be checked exhaustively for `x < 256`, so we assume `y >= 256`.\r\n            // Then `z*sqrt(y)` is within `sqrt(257)/sqrt(256)` of `sqrt(x)`, or about 20bps.\r\n\r\n            // For `s` in the range `[1/256, 256]`, the estimate `f(s) = (181/1024) * (s+1)`\r\n            // is in the range `(1/2.84 * sqrt(s), 2.84 * sqrt(s))`,\r\n            // with largest error when `s = 1` and when `s = 256` or `1/256`.\r\n\r\n            // Since `y` is in `[256, 256*(2**16))`, let `a = y/65536`, so that `a` is in `[1/256, 256)`.\r\n            // Then we can estimate `sqrt(y)` using\r\n            // `sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2**18`.\r\n\r\n            // There is no overflow risk here since `y < 2**136` after the first branch above.\r\n            z := shr(18, mul(z, add(shr(r, x), 65536))) // A `mul()` is saved from starting `z` at 181.\r\n\r\n            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n            z := shr(1, add(z, div(x, z)))\r\n\r\n            // If `x+1` is a perfect square, the Babylonian method cycles between\r\n            // `floor(sqrt(x))` and `ceil(sqrt(x))`. This statement ensures we return floor.\r\n            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division\r\n            z := sub(z, lt(div(x, z), z))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the cube root of `x`.\r\n    /// Credit to bout3fiddy and pcaversaccio under AGPLv3 license:\r\n    /// https://github.com/pcaversaccio/snekmate/blob/main/src/utils/Math.vy\r\n    function cbrt(uint256 x) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            let r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\r\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\r\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\r\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\r\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\r\n\r\n            z := div(shl(div(r, 3), shl(lt(0xf, shr(r, x)), 0xf)), xor(7, mod(r, 3)))\r\n\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\r\n\r\n            z := sub(z, lt(div(x, mul(z, z)), z))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the square root of `x`, denominated in `WAD`.\r\n    function sqrtWad(uint256 x) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = 10 ** 9;\r\n            if (x <= type(uint256).max / 10 ** 36 - 1) {\r\n                x *= 10 ** 18;\r\n                z = 1;\r\n            }\r\n            z *= sqrt(x);\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the cube root of `x`, denominated in `WAD`.\r\n    function cbrtWad(uint256 x) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = 10 ** 12;\r\n            if (x <= (type(uint256).max / 10 ** 36) * 10 ** 18 - 1) {\r\n                if (x >= type(uint256).max / 10 ** 36) {\r\n                    x *= 10 ** 18;\r\n                    z = 10 ** 6;\r\n                } else {\r\n                    x *= 10 ** 36;\r\n                    z = 1;\r\n                }\r\n            }\r\n            z *= cbrt(x);\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the factorial of `x`.\r\n    function factorial(uint256 x) internal pure returns (uint256 result) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            if iszero(lt(x, 58)) {\r\n                mstore(0x00, 0xaba0f2a2) // `FactorialOverflow()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            for { result := 1 } x { x := sub(x, 1) } { result := mul(result, x) }\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log2 of `x`.\r\n    /// Equivalent to computing the index of the most significant bit (MSB) of `x`.\r\n    /// Returns 0 if `x` is zero.\r\n    function log2(uint256 x) internal pure returns (uint256 r) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\r\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\r\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\r\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\r\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\r\n            // forgefmt: disable-next-item\r\n            r := or(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),\r\n                0x0706060506020504060203020504030106050205030304010505030400000000))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log2 of `x`, rounded up.\r\n    /// Returns 0 if `x` is zero.\r\n    function log2Up(uint256 x) internal pure returns (uint256 r) {\r\n        r = log2(x);\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            r := add(r, lt(shl(r, 1), x))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log10 of `x`.\r\n    /// Returns 0 if `x` is zero.\r\n    function log10(uint256 x) internal pure returns (uint256 r) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            if iszero(lt(x, 100000000000000000000000000000000000000)) {\r\n                x := div(x, 100000000000000000000000000000000000000)\r\n                r := 38\r\n            }\r\n            if iszero(lt(x, 100000000000000000000)) {\r\n                x := div(x, 100000000000000000000)\r\n                r := add(r, 20)\r\n            }\r\n            if iszero(lt(x, 10000000000)) {\r\n                x := div(x, 10000000000)\r\n                r := add(r, 10)\r\n            }\r\n            if iszero(lt(x, 100000)) {\r\n                x := div(x, 100000)\r\n                r := add(r, 5)\r\n            }\r\n            r := add(r, add(gt(x, 9), add(gt(x, 99), add(gt(x, 999), gt(x, 9999)))))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log10 of `x`, rounded up.\r\n    /// Returns 0 if `x` is zero.\r\n    function log10Up(uint256 x) internal pure returns (uint256 r) {\r\n        r = log10(x);\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            r := add(r, lt(exp(10, r), x))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log256 of `x`.\r\n    /// Returns 0 if `x` is zero.\r\n    function log256(uint256 x) internal pure returns (uint256 r) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\r\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\r\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\r\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\r\n            r := or(shr(3, r), lt(0xff, shr(r, x)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the log256 of `x`, rounded up.\r\n    /// Returns 0 if `x` is zero.\r\n    function log256Up(uint256 x) internal pure returns (uint256 r) {\r\n        r = log256(x);\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            r := add(r, lt(shl(shl(3, r), 1), x))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the scientific notation format `mantissa * 10 ** exponent` of `x`.\r\n    /// Useful for compressing prices (e.g. using 25 bit mantissa and 7 bit exponent).\r\n    function sci(uint256 x) internal pure returns (uint256 mantissa, uint256 exponent) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            mantissa := x\r\n            if mantissa {\r\n                if iszero(mod(mantissa, 1000000000000000000000000000000000)) {\r\n                    mantissa := div(mantissa, 1000000000000000000000000000000000)\r\n                    exponent := 33\r\n                }\r\n                if iszero(mod(mantissa, 10000000000000000000)) {\r\n                    mantissa := div(mantissa, 10000000000000000000)\r\n                    exponent := add(exponent, 19)\r\n                }\r\n                if iszero(mod(mantissa, 1000000000000)) {\r\n                    mantissa := div(mantissa, 1000000000000)\r\n                    exponent := add(exponent, 12)\r\n                }\r\n                if iszero(mod(mantissa, 1000000)) {\r\n                    mantissa := div(mantissa, 1000000)\r\n                    exponent := add(exponent, 6)\r\n                }\r\n                if iszero(mod(mantissa, 10000)) {\r\n                    mantissa := div(mantissa, 10000)\r\n                    exponent := add(exponent, 4)\r\n                }\r\n                if iszero(mod(mantissa, 100)) {\r\n                    mantissa := div(mantissa, 100)\r\n                    exponent := add(exponent, 2)\r\n                }\r\n                if iszero(mod(mantissa, 10)) {\r\n                    mantissa := div(mantissa, 10)\r\n                    exponent := add(exponent, 1)\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    /// @dev Convenience function for packing `x` into a smaller number using `sci`.\r\n    /// The `mantissa` will be in bits [7..255] (the upper 249 bits).\r\n    /// The `exponent` will be in bits [0..6] (the lower 7 bits).\r\n    /// Use `SafeCastLib` to safely ensure that the `packed` number is small\r\n    /// enough to fit in the desired unsigned integer type:\r\n    /// ```\r\n    ///     uint32 packed = SafeCastLib.toUint32(FixedPointMathLib.packSci(777 ether));\r\n    /// ```\r\n    function packSci(uint256 x) internal pure returns (uint256 packed) {\r\n        (x, packed) = sci(x); // Reuse for `mantissa` and `exponent`.\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            if shr(249, x) {\r\n                mstore(0x00, 0xce30380c) // `MantissaOverflow()`.\r\n                revert(0x1c, 0x04)\r\n            }\r\n            packed := or(shl(7, x), packed)\r\n        }\r\n    }\r\n\r\n    /// @dev Convenience function for unpacking a packed number from `packSci`.\r\n    function unpackSci(uint256 packed) internal pure returns (uint256 unpacked) {\r\n        unchecked {\r\n            unpacked = (packed >> 7) * 10 ** (packed & 0x7f);\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the average of `x` and `y`.\r\n    function avg(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = (x & y) + ((x ^ y) >> 1);\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the average of `x` and `y`.\r\n    function avg(int256 x, int256 y) internal pure returns (int256 z) {\r\n        unchecked {\r\n            z = (x >> 1) + (y >> 1) + (x & y & 1);\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the absolute value of `x`.\r\n    function abs(int256 x) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(sar(255, x), add(sar(255, x), x))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the absolute distance between `x` and `y`.\r\n    function dist(int256 x, int256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(mul(xor(sub(y, x), sub(x, y)), sgt(x, y)), sub(y, x))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the minimum of `x` and `y`.\r\n    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, y), lt(y, x)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the minimum of `x` and `y`.\r\n    function min(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, y), slt(y, x)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the maximum of `x` and `y`.\r\n    function max(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, y), gt(y, x)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns the maximum of `x` and `y`.\r\n    function max(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, y), sgt(y, x)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x`, bounded to `minValue` and `maxValue`.\r\n    function clamp(uint256 x, uint256 minValue, uint256 maxValue)\r\n        internal\r\n        pure\r\n        returns (uint256 z)\r\n    {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, minValue), gt(minValue, x)))\r\n            z := xor(z, mul(xor(z, maxValue), lt(maxValue, z)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x`, bounded to `minValue` and `maxValue`.\r\n    function clamp(int256 x, int256 minValue, int256 maxValue) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := xor(x, mul(xor(x, minValue), sgt(minValue, x)))\r\n            z := xor(z, mul(xor(z, maxValue), slt(maxValue, z)))\r\n        }\r\n    }\r\n\r\n    /// @dev Returns greatest common divisor of `x` and `y`.\r\n    function gcd(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            for { z := x } y {} {\r\n                let t := y\r\n                y := mod(z, y)\r\n                z := t\r\n            }\r\n        }\r\n    }\r\n\r\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\r\n    /*                   RAW NUMBER OPERATIONS                    */\r\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\r\n\r\n    /// @dev Returns `x + y`, without checking for overflow.\r\n    function rawAdd(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = x + y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x + y`, without checking for overflow.\r\n    function rawAdd(int256 x, int256 y) internal pure returns (int256 z) {\r\n        unchecked {\r\n            z = x + y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x - y`, without checking for underflow.\r\n    function rawSub(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = x - y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x - y`, without checking for underflow.\r\n    function rawSub(int256 x, int256 y) internal pure returns (int256 z) {\r\n        unchecked {\r\n            z = x - y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x * y`, without checking for overflow.\r\n    function rawMul(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        unchecked {\r\n            z = x * y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x * y`, without checking for overflow.\r\n    function rawMul(int256 x, int256 y) internal pure returns (int256 z) {\r\n        unchecked {\r\n            z = x * y;\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x / y`, returning 0 if `y` is zero.\r\n    function rawDiv(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := div(x, y)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x / y`, returning 0 if `y` is zero.\r\n    function rawSDiv(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := sdiv(x, y)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x % y`, returning 0 if `y` is zero.\r\n    function rawMod(uint256 x, uint256 y) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mod(x, y)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `x % y`, returning 0 if `y` is zero.\r\n    function rawSMod(int256 x, int256 y) internal pure returns (int256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := smod(x, y)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `(x + y) % d`, return 0 if `d` if zero.\r\n    function rawAddMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := addmod(x, y, d)\r\n        }\r\n    }\r\n\r\n    /// @dev Returns `(x * y) % d`, return 0 if `d` if zero.\r\n    function rawMulMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\r\n        /// @solidity memory-safe-assembly\r\n        assembly {\r\n            z := mulmod(x, y, d)\r\n        }\r\n    }\r\n}\r\n"
      },
      "src/interfaces/convex/Constants.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.25;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nIERC20 constant CVX = IERC20(address(0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B));\nIERC20 constant CVXCRV = IERC20(address(0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7));\n"
      },
      "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\r\n\r\npragma solidity ^0.8.20;\r\n\r\n/**\r\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\r\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\r\n *\r\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\r\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\r\n * need to send a transaction, and thus is not required to hold Ether at all.\r\n *\r\n * ==== Security Considerations\r\n *\r\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\r\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\r\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\r\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\r\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\r\n * generally recommended is:\r\n *\r\n * ```solidity\r\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\r\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\r\n *     doThing(..., value);\r\n * }\r\n *\r\n * function doThing(..., uint256 value) public {\r\n *     token.safeTransferFrom(msg.sender, address(this), value);\r\n *     ...\r\n * }\r\n * ```\r\n *\r\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\r\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\r\n * {SafeERC20-safeTransferFrom}).\r\n *\r\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\r\n * contracts should have entry points that don't rely on permit.\r\n */\r\ninterface IERC20Permit {\r\n    /**\r\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\r\n     * given ``owner``'s signed approval.\r\n     *\r\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\r\n     * ordering also apply here.\r\n     *\r\n     * Emits an {Approval} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `spender` cannot be the zero address.\r\n     * - `deadline` must be a timestamp in the future.\r\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\r\n     * over the EIP712-formatted function arguments.\r\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\r\n     *\r\n     * For more information on the signature format, see the\r\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\r\n     * section].\r\n     *\r\n     * CAUTION: See Security Considerations above.\r\n     */\r\n    function permit(\r\n        address owner,\r\n        address spender,\r\n        uint256 value,\r\n        uint256 deadline,\r\n        uint8 v,\r\n        bytes32 r,\r\n        bytes32 s\r\n    ) external;\r\n\r\n    /**\r\n     * @dev Returns the current nonce for `owner`. This value must be\r\n     * included whenever a signature is generated for {permit}.\r\n     *\r\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\r\n     * prevents a signature from being used multiple times.\r\n     */\r\n    function nonces(address owner) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\r\n     */\r\n    // solhint-disable-next-line func-name-mixedcase\r\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\r\n}\r\n"
      },
      "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\r\n\r\npragma solidity ^0.8.20;\r\n\r\n/**\r\n * @dev Collection of functions related to the address type\r\n */\r\nlibrary Address {\r\n    /**\r\n     * @dev The ETH balance of the account is not enough to perform the operation.\r\n     */\r\n    error AddressInsufficientBalance(address account);\r\n\r\n    /**\r\n     * @dev There's no code at `target` (it is not a contract).\r\n     */\r\n    error AddressEmptyCode(address target);\r\n\r\n    /**\r\n     * @dev A call to an address target failed. The target may have reverted.\r\n     */\r\n    error FailedInnerCall();\r\n\r\n    /**\r\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\r\n     * `recipient`, forwarding all available gas and reverting on errors.\r\n     *\r\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\r\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\r\n     * imposed by `transfer`, making them unable to receive funds via\r\n     * `transfer`. {sendValue} removes this limitation.\r\n     *\r\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\r\n     *\r\n     * IMPORTANT: because control is transferred to `recipient`, care must be\r\n     * taken to not create reentrancy vulnerabilities. Consider using\r\n     * {ReentrancyGuard} or the\r\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\r\n     */\r\n    function sendValue(address payable recipient, uint256 amount) internal {\r\n        if (address(this).balance < amount) {\r\n            revert AddressInsufficientBalance(address(this));\r\n        }\r\n\r\n        (bool success, ) = recipient.call{value: amount}(\"\");\r\n        if (!success) {\r\n            revert FailedInnerCall();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Performs a Solidity function call using a low level `call`. A\r\n     * plain `call` is an unsafe replacement for a function call: use this\r\n     * function instead.\r\n     *\r\n     * If `target` reverts with a revert reason or custom error, it is bubbled\r\n     * up by this function (like regular Solidity function calls). However, if\r\n     * the call reverted with no returned reason, this function reverts with a\r\n     * {FailedInnerCall} error.\r\n     *\r\n     * Returns the raw returned data. To convert to the expected return value,\r\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `target` must be a contract.\r\n     * - calling `target` with `data` must not revert.\r\n     */\r\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, 0);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but also transferring `value` wei to `target`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the calling contract must have an ETH balance of at least `value`.\r\n     * - the called Solidity function must be `payable`.\r\n     */\r\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\r\n        if (address(this).balance < value) {\r\n            revert AddressInsufficientBalance(address(this));\r\n        }\r\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\r\n        return verifyCallResultFromTarget(target, success, returndata);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but performing a static call.\r\n     */\r\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\r\n        (bool success, bytes memory returndata) = target.staticcall(data);\r\n        return verifyCallResultFromTarget(target, success, returndata);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but performing a delegate call.\r\n     */\r\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\r\n        (bool success, bytes memory returndata) = target.delegatecall(data);\r\n        return verifyCallResultFromTarget(target, success, returndata);\r\n    }\r\n\r\n    /**\r\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\r\n     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\r\n     * unsuccessful call.\r\n     */\r\n    function verifyCallResultFromTarget(\r\n        address target,\r\n        bool success,\r\n        bytes memory returndata\r\n    ) internal view returns (bytes memory) {\r\n        if (!success) {\r\n            _revert(returndata);\r\n        } else {\r\n            // only check if target is a contract if the call was successful and the return data is empty\r\n            // otherwise we already know that it was a contract\r\n            if (returndata.length == 0 && target.code.length == 0) {\r\n                revert AddressEmptyCode(target);\r\n            }\r\n            return returndata;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\r\n     * revert reason or with a default {FailedInnerCall} error.\r\n     */\r\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\r\n        if (!success) {\r\n            _revert(returndata);\r\n        } else {\r\n            return returndata;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\r\n     */\r\n    function _revert(bytes memory returndata) private pure {\r\n        // Look for revert reason and bubble it up if present\r\n        if (returndata.length > 0) {\r\n            // The easiest way to bubble the revert reason is using memory via assembly\r\n            /// @solidity memory-safe-assembly\r\n            assembly {\r\n                let returndata_size := mload(returndata)\r\n                revert(add(32, returndata), returndata_size)\r\n            }\r\n        } else {\r\n            revert FailedInnerCall();\r\n        }\r\n    }\r\n}\r\n"
      }
    },
    "settings": {
      "remappings": [
        "forge-std/=lib/forge-std/src/",
        "solady/=lib/solady/src/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
        "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "solady/=lib/solady/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 10000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "cancun",
      "viaIR": false,
      "libraries": {
        "src/utils/Zap.sol": {
          "Zap": "0x52BE7b0E42e198a62DF3e305183fcba08473B701"
        }
      }
    }
  }}