{"constructor_args":"0x000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e2","is_partially_verified":false,"is_changed_bytecode":false,"abi":[{"inputs":[{"internalType":"address","name":"marketAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllowanceOverflow","type":"error"},{"inputs":[],"name":"AllowanceUnderflow","type":"error"},{"inputs":[],"name":"CapExceeded","type":"error"},{"inputs":[],"name":"DepositMoreThanMax","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidPermit","type":"error"},{"inputs":[],"name":"MintMoreThanMax","type":"error"},{"inputs":[],"name":"NoReentrantCalls","type":"error"},{"inputs":[],"name":"NotMarketOwner","type":"error"},{"inputs":[],"name":"PermitExpired","type":"error"},{"inputs":[],"name":"RedeemMoreThanMax","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"SanctionedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"SharesMismatch","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"WithdrawMoreThanMax","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAssets","type":"error"},{"inputs":[],"name":"ZeroShares","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensSwept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"result","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetsPerShareRay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"market","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sanctionsSentinel","outputs":[{"internalType":"contract IWildcatSanctionsSentinel","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sharesPerAssetRay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"sweep","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrappedMarket","outputs":[{"internalType":"contract IWildcatMarketToken","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"conflicting_implementations":null,"certified":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\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 amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` 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 amount) 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 `amount` as the allowance of `spender` over the 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 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` 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 amount) external returns (bool);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"lib/solady/src/tokens/ERC20.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC20 + EIP-2612 implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC20.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol)\n///\n/// @dev Note:\n/// - The ERC20 standard allows minting and transferring to and from the zero address,\n///   minting and transferring zero tokens, as well as self-approvals.\n///   For performance, this implementation WILL NOT revert for such actions.\n///   Please add any checks with overrides if desired.\n/// - The `permit` function use the ecrecover precompile (0x1).\n///\n/// If you are overriding:\n/// - NEVER violate the ERC20 invariant:\n///   the total sum of all balances must be equal to `totalSupply()`.\n/// - Check that the overridden function is actually used in the function you want to\n///   change the behavior of. Much of the code has been manually inlined for performance.\nabstract contract ERC20 {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The total supply has overflowed.\n    error TotalSupplyOverflow();\n\n    /// @dev The allowance has overflowed.\n    error AllowanceOverflow();\n\n    /// @dev The allowance has underflowed.\n    error AllowanceUnderflow();\n\n    /// @dev Insufficient balance.\n    error InsufficientBalance();\n\n    /// @dev Insufficient allowance.\n    error InsufficientAllowance();\n\n    /// @dev The permit is invalid.\n    error InvalidPermit();\n\n    /// @dev The permit has expired.\n    error PermitExpired();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                           EVENTS                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Emitted when `amount` tokens is transferred from `from` to `to`.\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n\n    /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`.\n    event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n    /// @dev `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n    uint256 private constant _TRANSFER_EVENT_SIGNATURE =\n        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n    /// @dev `keccak256(bytes(\"Approval(address,address,uint256)\"))`.\n    uint256 private constant _APPROVAL_EVENT_SIGNATURE =\n        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          STORAGE                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The storage slot for the total supply.\n    uint256 private constant _TOTAL_SUPPLY_SLOT = 0x05345cdf77eb68f44c;\n\n    /// @dev The balance slot of `owner` is given by:\n    /// ```\n    ///     mstore(0x0c, _BALANCE_SLOT_SEED)\n    ///     mstore(0x00, owner)\n    ///     let balanceSlot := keccak256(0x0c, 0x20)\n    /// ```\n    uint256 private constant _BALANCE_SLOT_SEED = 0x87a211a2;\n\n    /// @dev The allowance slot of (`owner`, `spender`) is given by:\n    /// ```\n    ///     mstore(0x20, spender)\n    ///     mstore(0x0c, _ALLOWANCE_SLOT_SEED)\n    ///     mstore(0x00, owner)\n    ///     let allowanceSlot := keccak256(0x0c, 0x34)\n    /// ```\n    uint256 private constant _ALLOWANCE_SLOT_SEED = 0x7f5e9f20;\n\n    /// @dev The nonce slot of `owner` is given by:\n    /// ```\n    ///     mstore(0x0c, _NONCES_SLOT_SEED)\n    ///     mstore(0x00, owner)\n    ///     let nonceSlot := keccak256(0x0c, 0x20)\n    /// ```\n    uint256 private constant _NONCES_SLOT_SEED = 0x38377508;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev `(_NONCES_SLOT_SEED << 16) | 0x1901`.\n    uint256 private constant _NONCES_SLOT_SEED_WITH_SIGNATURE_PREFIX = 0x383775081901;\n\n    /// @dev `keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\")`.\n    bytes32 private constant _DOMAIN_TYPEHASH =\n        0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n    /// @dev `keccak256(\"1\")`.\n    bytes32 private constant _VERSION_HASH =\n        0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;\n\n    /// @dev `keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\")`.\n    bytes32 private constant _PERMIT_TYPEHASH =\n        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       ERC20 METADATA                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the name of the token.\n    function name() public view virtual returns (string memory);\n\n    /// @dev Returns the symbol of the token.\n    function symbol() public view virtual returns (string memory);\n\n    /// @dev Returns the decimals places of the token.\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                           ERC20                            */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the amount of tokens in existence.\n    function totalSupply() public view virtual returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := sload(_TOTAL_SUPPLY_SLOT)\n        }\n    }\n\n    /// @dev Returns the amount of tokens owned by `owner`.\n    function balanceOf(address owner) public view virtual returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x0c, _BALANCE_SLOT_SEED)\n            mstore(0x00, owner)\n            result := sload(keccak256(0x0c, 0x20))\n        }\n    }\n\n    /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`.\n    function allowance(address owner, address spender)\n        public\n        view\n        virtual\n        returns (uint256 result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x20, spender)\n            mstore(0x0c, _ALLOWANCE_SLOT_SEED)\n            mstore(0x00, owner)\n            result := sload(keccak256(0x0c, 0x34))\n        }\n    }\n\n    /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n    ///\n    /// Emits a {Approval} event.\n    function approve(address spender, uint256 amount) public virtual returns (bool) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the allowance slot and store the amount.\n            mstore(0x20, spender)\n            mstore(0x0c, _ALLOWANCE_SLOT_SEED)\n            mstore(0x00, caller())\n            sstore(keccak256(0x0c, 0x34), amount)\n            // Emit the {Approval} event.\n            mstore(0x00, amount)\n            log3(0x00, 0x20, _APPROVAL_EVENT_SIGNATURE, caller(), shr(96, mload(0x2c)))\n        }\n        return true;\n    }\n\n    /// @dev Transfer `amount` tokens from the caller to `to`.\n    ///\n    /// Requirements:\n    /// - `from` must at least have `amount`.\n    ///\n    /// Emits a {Transfer} event.\n    function transfer(address to, uint256 amount) public virtual returns (bool) {\n        _beforeTokenTransfer(msg.sender, to, amount);\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the balance slot and load its value.\n            mstore(0x0c, _BALANCE_SLOT_SEED)\n            mstore(0x00, caller())\n            let fromBalanceSlot := keccak256(0x0c, 0x20)\n            let fromBalance := sload(fromBalanceSlot)\n            // Revert if insufficient balance.\n            if gt(amount, fromBalance) {\n                mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                revert(0x1c, 0x04)\n            }\n            // Subtract and store the updated balance.\n            sstore(fromBalanceSlot, sub(fromBalance, amount))\n            // Compute the balance slot of `to`.\n            mstore(0x00, to)\n            let toBalanceSlot := keccak256(0x0c, 0x20)\n            // Add and store the updated balance of `to`.\n            // Will not overflow because the sum of all user balances\n            // cannot exceed the maximum uint256 value.\n            sstore(toBalanceSlot, add(sload(toBalanceSlot), amount))\n            // Emit the {Transfer} event.\n            mstore(0x20, amount)\n            log3(0x20, 0x20, _TRANSFER_EVENT_SIGNATURE, caller(), shr(96, mload(0x0c)))\n        }\n        _afterTokenTransfer(msg.sender, to, amount);\n        return true;\n    }\n\n    /// @dev Transfers `amount` tokens from `from` to `to`.\n    ///\n    /// Note: Does not update the allowance if it is the maximum uint256 value.\n    ///\n    /// Requirements:\n    /// - `from` must at least have `amount`.\n    /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`.\n    ///\n    /// Emits a {Transfer} event.\n    function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {\n        _beforeTokenTransfer(from, to, amount);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let from_ := shl(96, from)\n            // Compute the allowance slot and load its value.\n            mstore(0x20, caller())\n            mstore(0x0c, or(from_, _ALLOWANCE_SLOT_SEED))\n            let allowanceSlot := keccak256(0x0c, 0x34)\n            let allowance_ := sload(allowanceSlot)\n            // If the allowance is not the maximum uint256 value.\n            if add(allowance_, 1) {\n                // Revert if the amount to be transferred exceeds the allowance.\n                if gt(amount, allowance_) {\n                    mstore(0x00, 0x13be252b) // `InsufficientAllowance()`.\n                    revert(0x1c, 0x04)\n                }\n                // Subtract and store the updated allowance.\n                sstore(allowanceSlot, sub(allowance_, amount))\n            }\n            // Compute the balance slot and load its value.\n            mstore(0x0c, or(from_, _BALANCE_SLOT_SEED))\n            let fromBalanceSlot := keccak256(0x0c, 0x20)\n            let fromBalance := sload(fromBalanceSlot)\n            // Revert if insufficient balance.\n            if gt(amount, fromBalance) {\n                mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                revert(0x1c, 0x04)\n            }\n            // Subtract and store the updated balance.\n            sstore(fromBalanceSlot, sub(fromBalance, amount))\n            // Compute the balance slot of `to`.\n            mstore(0x00, to)\n            let toBalanceSlot := keccak256(0x0c, 0x20)\n            // Add and store the updated balance of `to`.\n            // Will not overflow because the sum of all user balances\n            // cannot exceed the maximum uint256 value.\n            sstore(toBalanceSlot, add(sload(toBalanceSlot), amount))\n            // Emit the {Transfer} event.\n            mstore(0x20, amount)\n            log3(0x20, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, from_), shr(96, mload(0x0c)))\n        }\n        _afterTokenTransfer(from, to, amount);\n        return true;\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                          EIP-2612                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev For more performance, override to return the constant value\n    /// of `keccak256(bytes(name()))` if `name()` will never change.\n    function _constantNameHash() internal view virtual returns (bytes32 result) {}\n\n    /// @dev Returns the current nonce for `owner`.\n    /// This value is used to compute the signature for EIP-2612 permit.\n    function nonces(address owner) public view virtual returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the nonce slot and load its value.\n            mstore(0x0c, _NONCES_SLOT_SEED)\n            mstore(0x00, owner)\n            result := sload(keccak256(0x0c, 0x20))\n        }\n    }\n\n    /// @dev Sets `value` as the allowance of `spender` over the tokens of `owner`,\n    /// authorized by a signed approval by `owner`.\n    ///\n    /// Emits a {Approval} event.\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        bytes32 nameHash = _constantNameHash();\n        //  We simply calculate it on-the-fly to allow for cases where the `name` may change.\n        if (nameHash == bytes32(0)) nameHash = keccak256(bytes(name()));\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Revert if the block timestamp greater than `deadline`.\n            if gt(timestamp(), deadline) {\n                mstore(0x00, 0x1a15a3cc) // `PermitExpired()`.\n                revert(0x1c, 0x04)\n            }\n            let m := mload(0x40) // Grab the free memory pointer.\n            // Clean the upper 96 bits.\n            owner := shr(96, shl(96, owner))\n            spender := shr(96, shl(96, spender))\n            // Compute the nonce slot and load its value.\n            mstore(0x0e, _NONCES_SLOT_SEED_WITH_SIGNATURE_PREFIX)\n            mstore(0x00, owner)\n            let nonceSlot := keccak256(0x0c, 0x20)\n            let nonceValue := sload(nonceSlot)\n            // Prepare the domain separator.\n            mstore(m, _DOMAIN_TYPEHASH)\n            mstore(add(m, 0x20), nameHash)\n            mstore(add(m, 0x40), _VERSION_HASH)\n            mstore(add(m, 0x60), chainid())\n            mstore(add(m, 0x80), address())\n            mstore(0x2e, keccak256(m, 0xa0))\n            // Prepare the struct hash.\n            mstore(m, _PERMIT_TYPEHASH)\n            mstore(add(m, 0x20), owner)\n            mstore(add(m, 0x40), spender)\n            mstore(add(m, 0x60), value)\n            mstore(add(m, 0x80), nonceValue)\n            mstore(add(m, 0xa0), deadline)\n            mstore(0x4e, keccak256(m, 0xc0))\n            // Prepare the ecrecover calldata.\n            mstore(0x00, keccak256(0x2c, 0x42))\n            mstore(0x20, and(0xff, v))\n            mstore(0x40, r)\n            mstore(0x60, s)\n            let t := staticcall(gas(), 1, 0, 0x80, 0x20, 0x20)\n            // If the ecrecover fails, the returndatasize will be 0x00,\n            // `owner` will be be checked if it equals the hash at 0x00,\n            // which evaluates to false (i.e. 0), and we will revert.\n            // If the ecrecover succeeds, the returndatasize will be 0x20,\n            // `owner` will be compared against the returned address at 0x20.\n            if iszero(eq(mload(returndatasize()), owner)) {\n                mstore(0x00, 0xddafbaef) // `InvalidPermit()`.\n                revert(0x1c, 0x04)\n            }\n            // Increment and store the updated nonce.\n            sstore(nonceSlot, add(nonceValue, t)) // `t` is 1 if ecrecover succeeds.\n            // Compute the allowance slot and store the value.\n            // The `owner` is already at slot 0x20.\n            mstore(0x40, or(shl(160, _ALLOWANCE_SLOT_SEED), spender))\n            sstore(keccak256(0x2c, 0x34), value)\n            // Emit the {Approval} event.\n            log3(add(m, 0x60), 0x20, _APPROVAL_EVENT_SIGNATURE, owner, spender)\n            mstore(0x40, m) // Restore the free memory pointer.\n            mstore(0x60, 0) // Restore the zero pointer.\n        }\n    }\n\n    /// @dev Returns the EIP-712 domain separator for the EIP-2612 permit.\n    function DOMAIN_SEPARATOR() public view virtual returns (bytes32 result) {\n        bytes32 nameHash = _constantNameHash();\n        //  We simply calculate it on-the-fly to allow for cases where the `name` may change.\n        if (nameHash == bytes32(0)) nameHash = keccak256(bytes(name()));\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40) // Grab the free memory pointer.\n            mstore(m, _DOMAIN_TYPEHASH)\n            mstore(add(m, 0x20), nameHash)\n            mstore(add(m, 0x40), _VERSION_HASH)\n            mstore(add(m, 0x60), chainid())\n            mstore(add(m, 0x80), address())\n            result := keccak256(m, 0xa0)\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  INTERNAL MINT FUNCTIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Mints `amount` tokens to `to`, increasing the total supply.\n    ///\n    /// Emits a {Transfer} event.\n    function _mint(address to, uint256 amount) internal virtual {\n        _beforeTokenTransfer(address(0), to, amount);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let totalSupplyBefore := sload(_TOTAL_SUPPLY_SLOT)\n            let totalSupplyAfter := add(totalSupplyBefore, amount)\n            // Revert if the total supply overflows.\n            if lt(totalSupplyAfter, totalSupplyBefore) {\n                mstore(0x00, 0xe5cfe957) // `TotalSupplyOverflow()`.\n                revert(0x1c, 0x04)\n            }\n            // Store the updated total supply.\n            sstore(_TOTAL_SUPPLY_SLOT, totalSupplyAfter)\n            // Compute the balance slot and load its value.\n            mstore(0x0c, _BALANCE_SLOT_SEED)\n            mstore(0x00, to)\n            let toBalanceSlot := keccak256(0x0c, 0x20)\n            // Add and store the updated balance.\n            sstore(toBalanceSlot, add(sload(toBalanceSlot), amount))\n            // Emit the {Transfer} event.\n            mstore(0x20, amount)\n            log3(0x20, 0x20, _TRANSFER_EVENT_SIGNATURE, 0, shr(96, mload(0x0c)))\n        }\n        _afterTokenTransfer(address(0), to, amount);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  INTERNAL BURN FUNCTIONS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Burns `amount` tokens from `from`, reducing the total supply.\n    ///\n    /// Emits a {Transfer} event.\n    function _burn(address from, uint256 amount) internal virtual {\n        _beforeTokenTransfer(from, address(0), amount);\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the balance slot and load its value.\n            mstore(0x0c, _BALANCE_SLOT_SEED)\n            mstore(0x00, from)\n            let fromBalanceSlot := keccak256(0x0c, 0x20)\n            let fromBalance := sload(fromBalanceSlot)\n            // Revert if insufficient balance.\n            if gt(amount, fromBalance) {\n                mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                revert(0x1c, 0x04)\n            }\n            // Subtract and store the updated balance.\n            sstore(fromBalanceSlot, sub(fromBalance, amount))\n            // Subtract and store the updated total supply.\n            sstore(_TOTAL_SUPPLY_SLOT, sub(sload(_TOTAL_SUPPLY_SLOT), amount))\n            // Emit the {Transfer} event.\n            mstore(0x00, amount)\n            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, shl(96, from)), 0)\n        }\n        _afterTokenTransfer(from, address(0), amount);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                INTERNAL TRANSFER FUNCTIONS                 */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Moves `amount` of tokens from `from` to `to`.\n    function _transfer(address from, address to, uint256 amount) internal virtual {\n        _beforeTokenTransfer(from, to, amount);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let from_ := shl(96, from)\n            // Compute the balance slot and load its value.\n            mstore(0x0c, or(from_, _BALANCE_SLOT_SEED))\n            let fromBalanceSlot := keccak256(0x0c, 0x20)\n            let fromBalance := sload(fromBalanceSlot)\n            // Revert if insufficient balance.\n            if gt(amount, fromBalance) {\n                mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n                revert(0x1c, 0x04)\n            }\n            // Subtract and store the updated balance.\n            sstore(fromBalanceSlot, sub(fromBalance, amount))\n            // Compute the balance slot of `to`.\n            mstore(0x00, to)\n            let toBalanceSlot := keccak256(0x0c, 0x20)\n            // Add and store the updated balance of `to`.\n            // Will not overflow because the sum of all user balances\n            // cannot exceed the maximum uint256 value.\n            sstore(toBalanceSlot, add(sload(toBalanceSlot), amount))\n            // Emit the {Transfer} event.\n            mstore(0x20, amount)\n            log3(0x20, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, from_), shr(96, mload(0x0c)))\n        }\n        _afterTokenTransfer(from, to, amount);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                INTERNAL ALLOWANCE FUNCTIONS                */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Updates the allowance of `owner` for `spender` based on spent `amount`.\n    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute the allowance slot and load its value.\n            mstore(0x20, spender)\n            mstore(0x0c, _ALLOWANCE_SLOT_SEED)\n            mstore(0x00, owner)\n            let allowanceSlot := keccak256(0x0c, 0x34)\n            let allowance_ := sload(allowanceSlot)\n            // If the allowance is not the maximum uint256 value.\n            if add(allowance_, 1) {\n                // Revert if the amount to be transferred exceeds the allowance.\n                if gt(amount, allowance_) {\n                    mstore(0x00, 0x13be252b) // `InsufficientAllowance()`.\n                    revert(0x1c, 0x04)\n                }\n                // Subtract and store the updated allowance.\n                sstore(allowanceSlot, sub(allowance_, amount))\n            }\n        }\n    }\n\n    /// @dev Sets `amount` as the allowance of `spender` over the tokens of `owner`.\n    ///\n    /// Emits a {Approval} event.\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let owner_ := shl(96, owner)\n            // Compute the allowance slot and store the amount.\n            mstore(0x20, spender)\n            mstore(0x0c, or(owner_, _ALLOWANCE_SLOT_SEED))\n            sstore(keccak256(0x0c, 0x34), amount)\n            // Emit the {Approval} event.\n            mstore(0x00, amount)\n            log3(0x00, 0x20, _APPROVAL_EVENT_SIGNATURE, shr(96, owner_), shr(96, mload(0x2c)))\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     HOOKS TO OVERRIDE                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Hook that is called before any transfer of tokens.\n    /// This includes minting and burning.\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n    /// @dev Hook that is called after any transfer of tokens.\n    /// This includes minting and burning.\n    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n"},{"file_path":"lib/solady/src/tokens/ERC4626.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport {ERC20} from \"./ERC20.sol\";\nimport {FixedPointMathLib} from \"../utils/FixedPointMathLib.sol\";\nimport {SafeTransferLib} from \"../utils/SafeTransferLib.sol\";\n\n/// @notice Simple ERC4626 tokenized Vault implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC4626.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/mixins/ERC4626.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC4626.sol)\nabstract contract ERC4626 is ERC20 {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The default underlying decimals.\n    uint8 internal constant _DEFAULT_UNDERLYING_DECIMALS = 18;\n\n    /// @dev The default decimals offset.\n    uint8 internal constant _DEFAULT_DECIMALS_OFFSET = 0;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Cannot deposit more than the max limit.\n    error DepositMoreThanMax();\n\n    /// @dev Cannot mint more than the max limit.\n    error MintMoreThanMax();\n\n    /// @dev Cannot withdraw more than the max limit.\n    error WithdrawMoreThanMax();\n\n    /// @dev Cannot redeem more than the max limit.\n    error RedeemMoreThanMax();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                           EVENTS                           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Emitted during a mint call or deposit call.\n    event Deposit(address indexed by, address indexed owner, uint256 assets, uint256 shares);\n\n    /// @dev Emitted during a withdraw call or redeem call.\n    event Withdraw(\n        address indexed by,\n        address indexed to,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /// @dev `keccak256(bytes(\"Deposit(address,address,uint256,uint256)\"))`.\n    uint256 private constant _DEPOSIT_EVENT_SIGNATURE =\n        0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7;\n\n    /// @dev `keccak256(bytes(\"Withdraw(address,address,address,uint256,uint256)\"))`.\n    uint256 private constant _WITHDRAW_EVENT_SIGNATURE =\n        0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     ERC4626 CONSTANTS                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev To be overridden to return the address of the underlying asset.\n    ///\n    /// - MUST be an ERC20 token contract.\n    /// - MUST NOT revert.\n    function asset() public view virtual returns (address);\n\n    /// @dev To be overridden to return the number of decimals of the underlying asset.\n    /// Default: 18.\n    ///\n    /// - MUST NOT revert.\n    function _underlyingDecimals() internal view virtual returns (uint8) {\n        return _DEFAULT_UNDERLYING_DECIMALS;\n    }\n\n    /// @dev Override to return a non-zero value to make the inflation attack even more unfeasible.\n    /// Only used when {_useVirtualShares} returns true.\n    /// Default: 0.\n    ///\n    /// - MUST NOT revert.\n    function _decimalsOffset() internal view virtual returns (uint8) {\n        return _DEFAULT_DECIMALS_OFFSET;\n    }\n\n    /// @dev Returns whether virtual shares will be used to mitigate the inflation attack.\n    /// See: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3706\n    /// Override to return true or false.\n    /// Default: true.\n    ///\n    /// - MUST NOT revert.\n    function _useVirtualShares() internal view virtual returns (bool) {\n        return true;\n    }\n\n    /// @dev Returns the decimals places of the token.\n    ///\n    /// - MUST NOT revert.\n    function decimals() public view virtual override(ERC20) returns (uint8) {\n        if (!_useVirtualShares()) return _underlyingDecimals();\n        return _underlyingDecimals() + _decimalsOffset();\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                ASSET DECIMALS GETTER HELPER                */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Helper function to get the decimals of the underlying asset.\n    /// Useful for setting the return value of `_underlyingDecimals` during initialization.\n    /// If the retrieval succeeds, `success` will be true, and `result` will hold the result.\n    /// Otherwise, `success` will be false, and `result` will be zero.\n    ///\n    /// Example usage:\n    /// ```\n    /// (bool success, uint8 result) = _tryGetAssetDecimals(underlying);\n    /// _decimals = success ? result : _DEFAULT_UNDERLYING_DECIMALS;\n    /// ```\n    function _tryGetAssetDecimals(address underlying)\n        internal\n        view\n        returns (bool success, uint8 result)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Store the function selector of `decimals()`.\n            mstore(0x00, 0x313ce567)\n            // Arguments are evaluated last to first.\n            success :=\n                and(\n                    // Returned value is less than 256, at left-padded to 32 bytes.\n                    and(lt(mload(0x00), 0x100), gt(returndatasize(), 0x1f)),\n                    // The staticcall succeeds.\n                    staticcall(gas(), underlying, 0x1c, 0x04, 0x00, 0x20)\n                )\n            result := mul(mload(0x00), success)\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      ACCOUNTING LOGIC                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the total amount of the underlying asset managed by the Vault.\n    ///\n    /// - SHOULD include any compounding that occurs from the yield.\n    /// - MUST be inclusive of any fees that are charged against assets in the Vault.\n    /// - MUST NOT revert.\n    function totalAssets() public view virtual returns (uint256 assets) {\n        assets = SafeTransferLib.balanceOf(asset(), address(this));\n    }\n\n    /// @dev Returns the amount of shares that the Vault will exchange for the amount of\n    /// assets provided, in an ideal scenario where all conditions are met.\n    ///\n    /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n    /// - MUST NOT show any variations depending on the caller.\n    /// - MUST NOT reflect slippage or other on-chain conditions, during the actual exchange.\n    /// - MUST NOT revert.\n    ///\n    /// Note: This calculation MAY NOT reflect the \"per-user\" price-per-share, and instead\n    /// should reflect the \"average-user's\" price-per-share, i.e. what the average user should\n    /// expect to see when exchanging to and from.\n    function convertToShares(uint256 assets) public view virtual returns (uint256 shares) {\n        if (!_useVirtualShares()) {\n            uint256 supply = totalSupply();\n            return _eitherIsZero(assets, supply)\n                ? _initialConvertToShares(assets)\n                : FixedPointMathLib.fullMulDiv(assets, supply, totalAssets());\n        }\n        uint256 o = _decimalsOffset();\n        if (o == 0) {\n            return FixedPointMathLib.fullMulDiv(assets, totalSupply() + 1, _inc(totalAssets()));\n        }\n        return FixedPointMathLib.fullMulDiv(assets, totalSupply() + 10 ** o, _inc(totalAssets()));\n    }\n\n    /// @dev Returns the amount of assets that the Vault will exchange for the amount of\n    /// shares provided, in an ideal scenario where all conditions are met.\n    ///\n    /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n    /// - MUST NOT show any variations depending on the caller.\n    /// - MUST NOT reflect slippage or other on-chain conditions, during the actual exchange.\n    /// - MUST NOT revert.\n    ///\n    /// Note: This calculation MAY NOT reflect the \"per-user\" price-per-share, and instead\n    /// should reflect the \"average-user's\" price-per-share, i.e. what the average user should\n    /// expect to see when exchanging to and from.\n    function convertToAssets(uint256 shares) public view virtual returns (uint256 assets) {\n        if (!_useVirtualShares()) {\n            uint256 supply = totalSupply();\n            return supply == 0\n                ? _initialConvertToAssets(shares)\n                : FixedPointMathLib.fullMulDiv(shares, totalAssets(), supply);\n        }\n        uint256 o = _decimalsOffset();\n        if (o == 0) {\n            return FixedPointMathLib.fullMulDiv(shares, totalAssets() + 1, _inc(totalSupply()));\n        }\n        return FixedPointMathLib.fullMulDiv(shares, totalAssets() + 1, totalSupply() + 10 ** o);\n    }\n\n    /// @dev Allows an on-chain or off-chain user to simulate the effects of their deposit\n    /// at the current block, given current on-chain conditions.\n    ///\n    /// - MUST return as close to and no more than the exact amount of Vault shares that\n    ///   will be minted in a deposit call in the same transaction, i.e. deposit should\n    ///   return the same or more shares as `previewDeposit` if call in the same transaction.\n    /// - MUST NOT account for deposit limits like those returned from `maxDeposit` and should\n    ///   always act as if the deposit will be accepted, regardless of approvals, etc.\n    /// - MUST be inclusive of deposit fees. Integrators should be aware of this.\n    /// - MUST not revert.\n    ///\n    /// Note: Any unfavorable discrepancy between `convertToShares` and `previewDeposit` SHOULD\n    /// be considered slippage in share price or some other type of condition, meaning\n    /// the depositor will lose assets by depositing.\n    function previewDeposit(uint256 assets) public view virtual returns (uint256 shares) {\n        shares = convertToShares(assets);\n    }\n\n    /// @dev Allows an on-chain or off-chain user to simulate the effects of their mint\n    /// at the current block, given current on-chain conditions.\n    ///\n    /// - MUST return as close to and no fewer than the exact amount of assets that\n    ///   will be deposited in a mint call in the same transaction, i.e. mint should\n    ///   return the same or fewer assets as `previewMint` if called in the same transaction.\n    /// - MUST NOT account for mint limits like those returned from `maxMint` and should\n    ///   always act as if the mint will be accepted, regardless of approvals, etc.\n    /// - MUST be inclusive of deposit fees. Integrators should be aware of this.\n    /// - MUST not revert.\n    ///\n    /// Note: Any unfavorable discrepancy between `convertToAssets` and `previewMint` SHOULD\n    /// be considered slippage in share price or some other type of condition,\n    /// meaning the depositor will lose assets by minting.\n    function previewMint(uint256 shares) public view virtual returns (uint256 assets) {\n        if (!_useVirtualShares()) {\n            uint256 supply = totalSupply();\n            return supply == 0\n                ? _initialConvertToAssets(shares)\n                : FixedPointMathLib.fullMulDivUp(shares, totalAssets(), supply);\n        }\n        uint256 o = _decimalsOffset();\n        if (o == 0) {\n            return FixedPointMathLib.fullMulDivUp(shares, totalAssets() + 1, _inc(totalSupply()));\n        }\n        return FixedPointMathLib.fullMulDivUp(shares, totalAssets() + 1, totalSupply() + 10 ** o);\n    }\n\n    /// @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal\n    /// at the current block, given the current on-chain conditions.\n    ///\n    /// - MUST return as close to and no fewer than the exact amount of Vault shares that\n    ///   will be burned in a withdraw call in the same transaction, i.e. withdraw should\n    ///   return the same or fewer shares as `previewWithdraw` if call in the same transaction.\n    /// - MUST NOT account for withdrawal limits like those returned from `maxWithdraw` and should\n    ///   always act as if the withdrawal will be accepted, regardless of share balance, etc.\n    /// - MUST be inclusive of withdrawal fees. Integrators should be aware of this.\n    /// - MUST not revert.\n    ///\n    /// Note: Any unfavorable discrepancy between `convertToShares` and `previewWithdraw` SHOULD\n    /// be considered slippage in share price or some other type of condition,\n    /// meaning the depositor will lose assets by depositing.\n    function previewWithdraw(uint256 assets) public view virtual returns (uint256 shares) {\n        if (!_useVirtualShares()) {\n            uint256 supply = totalSupply();\n            return _eitherIsZero(assets, supply)\n                ? _initialConvertToShares(assets)\n                : FixedPointMathLib.fullMulDivUp(assets, supply, totalAssets());\n        }\n        uint256 o = _decimalsOffset();\n        if (o == 0) {\n            return FixedPointMathLib.fullMulDivUp(assets, totalSupply() + 1, _inc(totalAssets()));\n        }\n        return FixedPointMathLib.fullMulDivUp(assets, totalSupply() + 10 ** o, _inc(totalAssets()));\n    }\n\n    /// @dev Allows an on-chain or off-chain user to simulate the effects of their redemption\n    /// at the current block, given current on-chain conditions.\n    ///\n    /// - MUST return as close to and no more than the exact amount of assets that\n    ///   will be withdrawn in a redeem call in the same transaction, i.e. redeem should\n    ///   return the same or more assets as `previewRedeem` if called in the same transaction.\n    /// - MUST NOT account for redemption limits like those returned from `maxRedeem` and should\n    ///   always act as if the redemption will be accepted, regardless of approvals, etc.\n    /// - MUST be inclusive of withdrawal fees. Integrators should be aware of this.\n    /// - MUST NOT revert.\n    ///\n    /// Note: Any unfavorable discrepancy between `convertToAssets` and `previewRedeem` SHOULD\n    /// be considered slippage in share price or some other type of condition,\n    /// meaning the depositor will lose assets by depositing.\n    function previewRedeem(uint256 shares) public view virtual returns (uint256 assets) {\n        assets = convertToAssets(shares);\n    }\n\n    /// @dev Private helper to return if either value is zero.\n    function _eitherIsZero(uint256 a, uint256 b) private pure returns (bool result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := or(iszero(a), iszero(b))\n        }\n    }\n\n    /// @dev Private helper to return the value plus one.\n    function _inc(uint256 x) private pure returns (uint256) {\n        unchecked {\n            return x + 1;\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*              DEPOSIT / WITHDRAWAL LIMIT LOGIC              */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns the maximum amount of the underlying asset that can be deposited\n    /// into the Vault for `to`, via a deposit call.\n    ///\n    /// - MUST return a limited value if `to` is subject to some deposit limit.\n    /// - MUST return `2**256-1` if there is no maximum limit.\n    /// - MUST NOT revert.\n    function maxDeposit(address to) public view virtual returns (uint256 maxAssets) {\n        to = to; // Silence unused variable warning.\n        maxAssets = type(uint256).max;\n    }\n\n    /// @dev Returns the maximum amount of the Vault shares that can be minter for `to`,\n    /// via a mint call.\n    ///\n    /// - MUST return a limited value if `to` is subject to some mint limit.\n    /// - MUST return `2**256-1` if there is no maximum limit.\n    /// - MUST NOT revert.\n    function maxMint(address to) public view virtual returns (uint256 maxShares) {\n        to = to; // Silence unused variable warning.\n        maxShares = type(uint256).max;\n    }\n\n    /// @dev Returns the maximum amount of the underlying asset that can be withdrawn\n    /// from the `owner`'s balance in the Vault, via a withdraw call.\n    ///\n    /// - MUST return a limited value if `owner` is subject to some withdrawal limit or timelock.\n    /// - MUST NOT revert.\n    function maxWithdraw(address owner) public view virtual returns (uint256 maxAssets) {\n        maxAssets = convertToAssets(balanceOf(owner));\n    }\n\n    /// @dev Returns the maximum amount of Vault shares that can be redeemed\n    /// from the `owner`'s balance in the Vault, via a redeem call.\n    ///\n    /// - MUST return a limited value if `owner` is subject to some withdrawal limit or timelock.\n    /// - MUST return `balanceOf(owner)` otherwise.\n    /// - MUST NOT revert.\n    function maxRedeem(address owner) public view virtual returns (uint256 maxShares) {\n        maxShares = balanceOf(owner);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                 DEPOSIT / WITHDRAWAL LOGIC                 */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Mints `shares` Vault shares to `to` by depositing exactly `assets`\n    /// of underlying tokens.\n    ///\n    /// - MUST emit the {Deposit} event.\n    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault\n    ///   contract before the deposit execution, and are accounted for during deposit.\n    /// - MUST revert if all of `assets` cannot be deposited, such as due to deposit limit,\n    ///   slippage, insufficient approval, etc.\n    ///\n    /// Note: Most implementations will require pre-approval of the Vault with the\n    /// Vault's underlying `asset` token.\n    function deposit(uint256 assets, address to) public virtual returns (uint256 shares) {\n        if (assets > maxDeposit(to)) _revert(0xb3c61a83); // `DepositMoreThanMax()`.\n        shares = previewDeposit(assets);\n        _deposit(msg.sender, to, assets, shares);\n    }\n\n    /// @dev Mints exactly `shares` Vault shares to `to` by depositing `assets`\n    /// of underlying tokens.\n    ///\n    /// - MUST emit the {Deposit} event.\n    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault\n    ///   contract before the mint execution, and are accounted for during mint.\n    /// - MUST revert if all of `shares` cannot be deposited, such as due to deposit limit,\n    ///   slippage, insufficient approval, etc.\n    ///\n    /// Note: Most implementations will require pre-approval of the Vault with the\n    /// Vault's underlying `asset` token.\n    function mint(uint256 shares, address to) public virtual returns (uint256 assets) {\n        if (shares > maxMint(to)) _revert(0x6a695959); // `MintMoreThanMax()`.\n        assets = previewMint(shares);\n        _deposit(msg.sender, to, assets, shares);\n    }\n\n    /// @dev Burns `shares` from `owner` and sends exactly `assets` of underlying tokens to `to`.\n    ///\n    /// - MUST emit the {Withdraw} event.\n    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault\n    ///   contract before the withdraw execution, and are accounted for during withdraw.\n    /// - MUST revert if all of `assets` cannot be withdrawn, such as due to withdrawal limit,\n    ///   slippage, insufficient balance, etc.\n    ///\n    /// Note: Some implementations will require pre-requesting to the Vault before a withdrawal\n    /// may be performed. Those methods should be performed separately.\n    function withdraw(uint256 assets, address to, address owner)\n        public\n        virtual\n        returns (uint256 shares)\n    {\n        if (assets > maxWithdraw(owner)) _revert(0x936941fc); // `WithdrawMoreThanMax()`.\n        shares = previewWithdraw(assets);\n        _withdraw(msg.sender, to, owner, assets, shares);\n    }\n\n    /// @dev Burns exactly `shares` from `owner` and sends `assets` of underlying tokens to `to`.\n    ///\n    /// - MUST emit the {Withdraw} event.\n    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault\n    ///   contract before the redeem execution, and are accounted for during redeem.\n    /// - MUST revert if all of shares cannot be redeemed, such as due to withdrawal limit,\n    ///   slippage, insufficient balance, etc.\n    ///\n    /// Note: Some implementations will require pre-requesting to the Vault before a redeem\n    /// may be performed. Those methods should be performed separately.\n    function redeem(uint256 shares, address to, address owner)\n        public\n        virtual\n        returns (uint256 assets)\n    {\n        if (shares > maxRedeem(owner)) _revert(0x4656425a); // `RedeemMoreThanMax()`.\n        assets = previewRedeem(shares);\n        _withdraw(msg.sender, to, owner, assets, shares);\n    }\n\n    /// @dev Internal helper for reverting efficiently.\n    function _revert(uint256 s) private pure {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, s)\n            revert(0x1c, 0x04)\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      INTERNAL HELPERS                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev For deposits and mints.\n    ///\n    /// Emits a {Deposit} event.\n    function _deposit(address by, address to, uint256 assets, uint256 shares) internal virtual {\n        SafeTransferLib.safeTransferFrom(asset(), by, address(this), assets);\n        _mint(to, shares);\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Emit the {Deposit} event.\n            mstore(0x00, assets)\n            mstore(0x20, shares)\n            let m := shr(96, not(0))\n            log3(0x00, 0x40, _DEPOSIT_EVENT_SIGNATURE, and(m, by), and(m, to))\n        }\n        _afterDeposit(assets, shares);\n    }\n\n    /// @dev For withdrawals and redemptions.\n    ///\n    /// Emits a {Withdraw} event.\n    function _withdraw(address by, address to, address owner, uint256 assets, uint256 shares)\n        internal\n        virtual\n    {\n        if (by != owner) _spendAllowance(owner, by, shares);\n        _beforeWithdraw(assets, shares);\n        _burn(owner, shares);\n        SafeTransferLib.safeTransfer(asset(), to, assets);\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Emit the {Withdraw} event.\n            mstore(0x00, assets)\n            mstore(0x20, shares)\n            let m := shr(96, not(0))\n            log4(0x00, 0x40, _WITHDRAW_EVENT_SIGNATURE, and(m, by), and(m, to), and(m, owner))\n        }\n    }\n\n    /// @dev Internal conversion function (from assets to shares) to apply when the Vault is empty.\n    /// Only used when {_useVirtualShares} returns false.\n    ///\n    /// Note: Make sure to keep this function consistent with {_initialConvertToAssets}\n    /// when overriding it.\n    function _initialConvertToShares(uint256 assets)\n        internal\n        view\n        virtual\n        returns (uint256 shares)\n    {\n        shares = assets;\n    }\n\n    /// @dev Internal conversion function (from shares to assets) to apply when the Vault is empty.\n    /// Only used when {_useVirtualShares} returns false.\n    ///\n    /// Note: Make sure to keep this function consistent with {_initialConvertToShares}\n    /// when overriding it.\n    function _initialConvertToAssets(uint256 shares)\n        internal\n        view\n        virtual\n        returns (uint256 assets)\n    {\n        assets = shares;\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     HOOKS TO OVERRIDE                      */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Hook that is called before any withdrawal or redemption.\n    function _beforeWithdraw(uint256 assets, uint256 shares) internal virtual {}\n\n    /// @dev Hook that is called after any deposit or mint.\n    function _afterDeposit(uint256 assets, uint256 shares) internal virtual {}\n}\n"},{"file_path":"lib/solady/src/utils/FixedPointMathLib.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Arithmetic library with operations for fixed-point numbers.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/FixedPointMathLib.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)\nlibrary FixedPointMathLib {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The operation failed, as the output exceeds the maximum value of uint256.\n    error ExpOverflow();\n\n    /// @dev The operation failed, as the output exceeds the maximum value of uint256.\n    error FactorialOverflow();\n\n    /// @dev The operation failed, due to an overflow.\n    error RPowOverflow();\n\n    /// @dev The operation failed, due to an multiplication overflow.\n    error MulWadFailed();\n\n    /// @dev The operation failed, either due to a\n    /// multiplication overflow, or a division by a zero.\n    error DivWadFailed();\n\n    /// @dev The multiply-divide operation failed, either due to a\n    /// multiplication overflow, or a division by a zero.\n    error MulDivFailed();\n\n    /// @dev The division failed, as the denominator is zero.\n    error DivFailed();\n\n    /// @dev The full precision multiply-divide operation failed, either due\n    /// to the result being larger than 256 bits, or a division by a zero.\n    error FullMulDivFailed();\n\n    /// @dev The output is undefined, as the input is less-than-or-equal to zero.\n    error LnWadUndefined();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev The scalar of ETH and most ERC20s.\n    uint256 internal constant WAD = 1e18;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*              SIMPLIFIED FIXED POINT OPERATIONS             */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Equivalent to `(x * y) / WAD` rounded down.\n    function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\n            if mul(y, gt(x, div(not(0), y))) {\n                mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := div(mul(x, y), WAD)\n        }\n    }\n\n    /// @dev Equivalent to `(x * y) / WAD` rounded up.\n    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\n            if mul(y, gt(x, div(not(0), y))) {\n                mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := add(iszero(iszero(mod(mul(x, y), WAD))), div(mul(x, y), WAD))\n        }\n    }\n\n    /// @dev Equivalent to `(x * WAD) / y` rounded down.\n    function divWad(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to `require(y != 0 && (WAD == 0 || x <= type(uint256).max / WAD))`.\n            if iszero(mul(y, iszero(mul(WAD, gt(x, div(not(0), WAD)))))) {\n                mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := div(mul(x, WAD), y)\n        }\n    }\n\n    /// @dev Equivalent to `(x * WAD) / y` rounded up.\n    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to `require(y != 0 && (WAD == 0 || x <= type(uint256).max / WAD))`.\n            if iszero(mul(y, iszero(mul(WAD, gt(x, div(not(0), WAD)))))) {\n                mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := add(iszero(iszero(mod(mul(x, WAD), y))), div(mul(x, WAD), y))\n        }\n    }\n\n    /// @dev Equivalent to `x` to the power of `y`.\n    /// because `x ** y = (e ** ln(x)) ** y = e ** (ln(x) * y)`.\n    function powWad(int256 x, int256 y) internal pure returns (int256) {\n        // Using `ln(x)` means `x` must be greater than 0.\n        return expWad((lnWad(x) * y) / int256(WAD));\n    }\n\n    /// @dev Returns `exp(x)`, denominated in `WAD`.\n    function expWad(int256 x) internal pure returns (int256 r) {\n        unchecked {\n            // When the result is < 0.5 we return zero. This happens when\n            // x <= floor(log(0.5e18) * 1e18) ~ -42e18\n            if (x <= -42139678854452767551) return r;\n\n            /// @solidity memory-safe-assembly\n            assembly {\n                // When the result is > (2**255 - 1) / 1e18 we can not represent it as an\n                // int. This happens when x >= floor(log((2**255 - 1) / 1e18) * 1e18) ~ 135.\n                if iszero(slt(x, 135305999368893231589)) {\n                    mstore(0x00, 0xa37bfec9) // `ExpOverflow()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n\n            // x is now in the range (-42, 136) * 1e18. Convert to (-42, 136) * 2**96\n            // for more intermediate precision and a binary basis. This base conversion\n            // is a multiplication by 1e18 / 2**96 = 5**18 / 2**78.\n            x = (x << 78) / 5 ** 18;\n\n            // Reduce range of x to (-½ ln 2, ½ ln 2) * 2**96 by factoring out powers\n            // of two such that exp(x) = exp(x') * 2**k, where k is an integer.\n            // Solving this gives k = round(x / log(2)) and x' = x - k * log(2).\n            int256 k = ((x << 96) / 54916777467707473351141471128 + 2 ** 95) >> 96;\n            x = x - k * 54916777467707473351141471128;\n\n            // k is in the range [-61, 195].\n\n            // Evaluate using a (6, 7)-term rational approximation.\n            // p is made monic, we'll multiply by a scale factor later.\n            int256 y = x + 1346386616545796478920950773328;\n            y = ((y * x) >> 96) + 57155421227552351082224309758442;\n            int256 p = y + x - 94201549194550492254356042504812;\n            p = ((p * y) >> 96) + 28719021644029726153956944680412240;\n            p = p * x + (4385272521454847904659076985693276 << 96);\n\n            // We leave p in 2**192 basis so we don't need to scale it back up for the division.\n            int256 q = x - 2855989394907223263936484059900;\n            q = ((q * x) >> 96) + 50020603652535783019961831881945;\n            q = ((q * x) >> 96) - 533845033583426703283633433725380;\n            q = ((q * x) >> 96) + 3604857256930695427073651918091429;\n            q = ((q * x) >> 96) - 14423608567350463180887372962807573;\n            q = ((q * x) >> 96) + 26449188498355588339934803723976023;\n\n            /// @solidity memory-safe-assembly\n            assembly {\n                // Div in assembly because solidity adds a zero check despite the unchecked.\n                // The q polynomial won't have zeros in the domain as all its roots are complex.\n                // No scaling is necessary because p is already 2**96 too large.\n                r := sdiv(p, q)\n            }\n\n            // r should be in the range (0.09, 0.25) * 2**96.\n\n            // We now need to multiply r by:\n            // * the scale factor s = ~6.031367120.\n            // * the 2**k factor from the range reduction.\n            // * the 1e18 / 2**96 factor for base conversion.\n            // We do this all at once, with an intermediate result in 2**213\n            // basis, so the final right shift is always by a positive amount.\n            r = int256(\n                (uint256(r) * 3822833074963236453042738258902158003155416615667) >> uint256(195 - k)\n            );\n        }\n    }\n\n    /// @dev Returns `ln(x)`, denominated in `WAD`.\n    function lnWad(int256 x) internal pure returns (int256 r) {\n        unchecked {\n            /// @solidity memory-safe-assembly\n            assembly {\n                if iszero(sgt(x, 0)) {\n                    mstore(0x00, 0x1615e638) // `LnWadUndefined()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n\n            // We want to convert x from 10**18 fixed point to 2**96 fixed point.\n            // We do this by multiplying by 2**96 / 10**18. But since\n            // ln(x * C) = ln(x) + ln(C), we can simply do nothing here\n            // and add ln(2**96 / 10**18) at the end.\n\n            // Compute k = log2(x) - 96.\n            int256 k;\n            /// @solidity memory-safe-assembly\n            assembly {\n                k := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n                k := or(k, shl(6, lt(0xffffffffffffffff, shr(k, x))))\n                k := or(k, shl(5, lt(0xffffffff, shr(k, x))))\n                k := or(k, shl(4, lt(0xffff, shr(k, x))))\n                k := or(k, shl(3, lt(0xff, shr(k, x))))\n                k := or(k, shl(2, lt(0xf, shr(k, x))))\n                k := sub(or(k, byte(shr(k, x), hex\"00000101020202020303030303030303\")), 96)\n            }\n\n            // Reduce range of x to (1, 2) * 2**96\n            // ln(2^k * x) = k * ln(2) + ln(x)\n            x = int256(uint256(x << uint256(159 - k)) >> 159);\n\n            // Evaluate using a (8, 8)-term rational approximation.\n            // p is made monic, we will multiply by a scale factor later.\n            int256 p = x + 3273285459638523848632254066296;\n            p = ((p * x) >> 96) + 24828157081833163892658089445524;\n            p = ((p * x) >> 96) + 43456485725739037958740375743393;\n            p = ((p * x) >> 96) - 11111509109440967052023855526967;\n            p = ((p * x) >> 96) - 45023709667254063763336534515857;\n            p = ((p * x) >> 96) - 14706773417378608786704636184526;\n            p = p * x - (795164235651350426258249787498 << 96);\n\n            // We leave p in 2**192 basis so we don't need to scale it back up for the division.\n            // q is monic by convention.\n            int256 q = x + 5573035233440673466300451813936;\n            q = ((q * x) >> 96) + 71694874799317883764090561454958;\n            q = ((q * x) >> 96) + 283447036172924575727196451306956;\n            q = ((q * x) >> 96) + 401686690394027663651624208769553;\n            q = ((q * x) >> 96) + 204048457590392012362485061816622;\n            q = ((q * x) >> 96) + 31853899698501571402653359427138;\n            q = ((q * x) >> 96) + 909429971244387300277376558375;\n            /// @solidity memory-safe-assembly\n            assembly {\n                // Div in assembly because solidity adds a zero check despite the unchecked.\n                // The q polynomial is known not to have zeros in the domain.\n                // No scaling required because p is already 2**96 too large.\n                r := sdiv(p, q)\n            }\n\n            // r is in the range (0, 0.125) * 2**96\n\n            // Finalization, we need to:\n            // * multiply by the scale factor s = 5.549…\n            // * add ln(2**96 / 10**18)\n            // * add k * ln(2)\n            // * multiply by 10**18 / 2**96 = 5**18 >> 78\n\n            // mul s * 5e18 * 2**96, base is now 5**18 * 2**192\n            r *= 1677202110996718588342820967067443963516166;\n            // add ln(2) * k * 5e18 * 2**192\n            r += 16597577552685614221487285958193947469193820559219878177908093499208371 * k;\n            // add ln(2**96 / 10**18) * 5e18 * 2**192\n            r += 600920179829731861736702779321621459595472258049074101567377883020018308;\n            // base conversion: mul 2**18 / 2**192\n            r >>= 174;\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  GENERAL NUMBER UTILITIES                  */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Calculates `floor(a * b / d)` with full precision.\n    /// Throws if result overflows a uint256 or when `d` is zero.\n    /// Credit to Remco Bloemen under MIT license: https://2π.com/21/muldiv\n    function fullMulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            for {} 1 {} {\n                // 512-bit multiply `[p1 p0] = x * y`.\n                // Compute the product mod `2**256` and mod `2**256 - 1`\n                // then use the Chinese Remainder Theorem to reconstruct\n                // the 512 bit result. The result is stored in two 256\n                // variables such that `product = p1 * 2**256 + p0`.\n\n                // Least significant 256 bits of the product.\n                let p0 := mul(x, y)\n                let mm := mulmod(x, y, not(0))\n                // Most significant 256 bits of the product.\n                let p1 := sub(mm, add(p0, lt(mm, p0)))\n\n                // Handle non-overflow cases, 256 by 256 division.\n                if iszero(p1) {\n                    if iszero(d) {\n                        mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\n                        revert(0x1c, 0x04)\n                    }\n                    result := div(p0, d)\n                    break\n                }\n\n                // Make sure the result is less than `2**256`. Also prevents `d == 0`.\n                if iszero(gt(d, p1)) {\n                    mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\n                    revert(0x1c, 0x04)\n                }\n\n                /*------------------- 512 by 256 division --------------------*/\n\n                // Make division exact by subtracting the remainder from `[p1 p0]`.\n                // Compute remainder using mulmod.\n                let r := mulmod(x, y, d)\n                // `t` is the least significant bit of `d`.\n                // Always greater or equal to 1.\n                let t := and(d, sub(0, d))\n                // Divide `d` by `t`, which is a power of two.\n                d := div(d, t)\n                // Invert `d mod 2**256`\n                // Now that `d` is an odd number, it has an inverse\n                // modulo `2**256` such that `d * inv = 1 mod 2**256`.\n                // Compute the inverse by starting with a seed that is correct\n                // correct for four bits. That is, `d * inv = 1 mod 2**4`.\n                let inv := xor(mul(3, d), 2)\n                // Now use Newton-Raphson iteration to improve the precision.\n                // Thanks to Hensel's lifting lemma, this also works in modular\n                // arithmetic, doubling the correct bits in each step.\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**8\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**16\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**32\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**64\n                inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**128\n                result :=\n                    mul(\n                        // Divide [p1 p0] by the factors of two.\n                        // Shift in bits from `p1` into `p0`. For this we need\n                        // to flip `t` such that it is `2**256 / t`.\n                        or(mul(sub(p1, gt(r, p0)), add(div(sub(0, t), t), 1)), div(sub(p0, r), t)),\n                        // inverse mod 2**256\n                        mul(inv, sub(2, mul(d, inv)))\n                    )\n                break\n            }\n        }\n    }\n\n    /// @dev Calculates `floor(x * y / d)` with full precision, rounded up.\n    /// Throws if result overflows a uint256 or when `d` is zero.\n    /// Credit to Uniswap-v3-core under MIT license:\n    /// https://github.com/Uniswap/v3-core/blob/contracts/libraries/FullMath.sol\n    function fullMulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 result) {\n        result = fullMulDiv(x, y, d);\n        /// @solidity memory-safe-assembly\n        assembly {\n            if mulmod(x, y, d) {\n                result := add(result, 1)\n                if iszero(result) {\n                    mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n        }\n    }\n\n    /// @dev Returns `floor(x * y / d)`.\n    /// Reverts if `x * y` overflows, or `d` is zero.\n    function mulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\n            if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\n                mstore(0x00, 0xad251c27) // `MulDivFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := div(mul(x, y), d)\n        }\n    }\n\n    /// @dev Returns `ceil(x * y / d)`.\n    /// Reverts if `x * y` overflows, or `d` is zero.\n    function mulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\n            if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\n                mstore(0x00, 0xad251c27) // `MulDivFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := add(iszero(iszero(mod(mul(x, y), d))), div(mul(x, y), d))\n        }\n    }\n\n    /// @dev Returns `ceil(x / d)`.\n    /// Reverts if `d` is zero.\n    function divUp(uint256 x, uint256 d) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(d) {\n                mstore(0x00, 0x65244e4e) // `DivFailed()`.\n                revert(0x1c, 0x04)\n            }\n            z := add(iszero(iszero(mod(x, d))), div(x, d))\n        }\n    }\n\n    /// @dev Returns `max(0, x - y)`.\n    function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := mul(gt(x, y), sub(x, y))\n        }\n    }\n\n    /// @dev Exponentiate `x` to `y` by squaring, denominated in base `b`.\n    /// Reverts if the computation overflows.\n    function rpow(uint256 x, uint256 y, uint256 b) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := mul(b, iszero(y)) // `0 ** 0 = 1`. Otherwise, `0 ** n = 0`.\n            if x {\n                z := xor(b, mul(xor(b, x), and(y, 1))) // `z = isEven(y) ? scale : x`\n                let half := shr(1, b) // Divide `b` by 2.\n                // Divide `y` by 2 every iteration.\n                for { y := shr(1, y) } y { y := shr(1, y) } {\n                    let xx := mul(x, x) // Store x squared.\n                    let xxRound := add(xx, half) // Round to the nearest number.\n                    // Revert if `xx + half` overflowed, or if `x ** 2` overflows.\n                    if or(lt(xxRound, xx), shr(128, x)) {\n                        mstore(0x00, 0x49f7642b) // `RPowOverflow()`.\n                        revert(0x1c, 0x04)\n                    }\n                    x := div(xxRound, b) // Set `x` to scaled `xxRound`.\n                    // If `y` is odd:\n                    if and(y, 1) {\n                        let zx := mul(z, x) // Compute `z * x`.\n                        let zxRound := add(zx, half) // Round to the nearest number.\n                        // If `z * x` overflowed or `zx + half` overflowed:\n                        if or(xor(div(zx, x), z), lt(zxRound, zx)) {\n                            // Revert if `x` is non-zero.\n                            if iszero(iszero(x)) {\n                                mstore(0x00, 0x49f7642b) // `RPowOverflow()`.\n                                revert(0x1c, 0x04)\n                            }\n                        }\n                        z := div(zxRound, b) // Return properly scaled `zxRound`.\n                    }\n                }\n            }\n        }\n    }\n\n    /// @dev Returns the square root of `x`.\n    function sqrt(uint256 x) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // `floor(sqrt(2**15)) = 181`. `sqrt(2**15) - 181 = 2.84`.\n            z := 181 // The \"correct\" value is 1, but this saves a multiplication later.\n\n            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad\n            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.\n\n            // Let `y = x / 2**r`. We check `y >= 2**(k + 8)`\n            // but shift right by `k` bits to ensure that if `x >= 256`, then `y >= 256`.\n            let r := shl(7, lt(0xffffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffffff, shr(r, x))))\n            z := shl(shr(1, r), z)\n\n            // Goal was to get `z*z*y` within a small factor of `x`. More iterations could\n            // get y in a tighter range. Currently, we will have y in `[256, 256*(2**16))`.\n            // We ensured `y >= 256` so that the relative difference between `y` and `y+1` is small.\n            // That's not possible if `x < 256` but we can just verify those cases exhaustively.\n\n            // Now, `z*z*y <= x < z*z*(y+1)`, and `y <= 2**(16+8)`, and either `y >= 256`, or `x < 256`.\n            // Correctness can be checked exhaustively for `x < 256`, so we assume `y >= 256`.\n            // Then `z*sqrt(y)` is within `sqrt(257)/sqrt(256)` of `sqrt(x)`, or about 20bps.\n\n            // For `s` in the range `[1/256, 256]`, the estimate `f(s) = (181/1024) * (s+1)`\n            // is in the range `(1/2.84 * sqrt(s), 2.84 * sqrt(s))`,\n            // with largest error when `s = 1` and when `s = 256` or `1/256`.\n\n            // Since `y` is in `[256, 256*(2**16))`, let `a = y/65536`, so that `a` is in `[1/256, 256)`.\n            // Then we can estimate `sqrt(y)` using\n            // `sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2**18`.\n\n            // There is no overflow risk here since `y < 2**136` after the first branch above.\n            z := shr(18, mul(z, add(shr(r, x), 65536))) // A `mul()` is saved from starting `z` at 181.\n\n            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n\n            // If `x+1` is a perfect square, the Babylonian method cycles between\n            // `floor(sqrt(x))` and `ceil(sqrt(x))`. This statement ensures we return floor.\n            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division\n            z := sub(z, lt(div(x, z), z))\n        }\n    }\n\n    /// @dev Returns the cube root of `x`.\n    /// Credit to bout3fiddy and pcaversaccio under AGPLv3 license:\n    /// https://github.com/pcaversaccio/snekmate/blob/main/src/utils/Math.vy\n    function cbrt(uint256 x) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\n\n            z := div(shl(div(r, 3), shl(lt(0xf, shr(r, x)), 0xf)), xor(7, mod(r, 3)))\n\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n            z := div(add(add(div(x, mul(z, z)), z), z), 3)\n\n            z := sub(z, lt(div(x, mul(z, z)), z))\n        }\n    }\n\n    /// @dev Returns the square root of `x`, denominated in `WAD`.\n    function sqrtWad(uint256 x) internal pure returns (uint256 z) {\n        unchecked {\n            z = 10 ** 9;\n            if (x <= type(uint256).max / 10 ** 36 - 1) {\n                x *= 10 ** 18;\n                z = 1;\n            }\n            z *= sqrt(x);\n        }\n    }\n\n    /// @dev Returns the cube root of `x`, denominated in `WAD`.\n    function cbrtWad(uint256 x) internal pure returns (uint256 z) {\n        unchecked {\n            z = 10 ** 12;\n            if (x <= (type(uint256).max / 10 ** 36) * 10 ** 18 - 1) {\n                if (x >= type(uint256).max / 10 ** 36) {\n                    x *= 10 ** 18;\n                    z = 10 ** 6;\n                } else {\n                    x *= 10 ** 36;\n                    z = 1;\n                }\n            }\n            z *= cbrt(x);\n        }\n    }\n\n    /// @dev Returns the factorial of `x`.\n    function factorial(uint256 x) internal pure returns (uint256 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(lt(x, 58)) {\n                mstore(0x00, 0xaba0f2a2) // `FactorialOverflow()`.\n                revert(0x1c, 0x04)\n            }\n            for { result := 1 } x { x := sub(x, 1) } { result := mul(result, x) }\n        }\n    }\n\n    /// @dev Returns the log2 of `x`.\n    /// Equivalent to computing the index of the most significant bit (MSB) of `x`.\n    /// Returns 0 if `x` is zero.\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\n            r := or(r, shl(2, lt(0xf, shr(r, x))))\n            r := or(r, byte(shr(r, x), hex\"00000101020202020303030303030303\"))\n        }\n    }\n\n    /// @dev Returns the log2 of `x`, rounded up.\n    /// Returns 0 if `x` is zero.\n    function log2Up(uint256 x) internal pure returns (uint256 r) {\n        r = log2(x);\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := add(r, lt(shl(r, 1), x))\n        }\n    }\n\n    /// @dev Returns the log10 of `x`.\n    /// Returns 0 if `x` is zero.\n    function log10(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(lt(x, 100000000000000000000000000000000000000)) {\n                x := div(x, 100000000000000000000000000000000000000)\n                r := 38\n            }\n            if iszero(lt(x, 100000000000000000000)) {\n                x := div(x, 100000000000000000000)\n                r := add(r, 20)\n            }\n            if iszero(lt(x, 10000000000)) {\n                x := div(x, 10000000000)\n                r := add(r, 10)\n            }\n            if iszero(lt(x, 100000)) {\n                x := div(x, 100000)\n                r := add(r, 5)\n            }\n            r := add(r, add(gt(x, 9), add(gt(x, 99), add(gt(x, 999), gt(x, 9999)))))\n        }\n    }\n\n    /// @dev Returns the log10 of `x`, rounded up.\n    /// Returns 0 if `x` is zero.\n    function log10Up(uint256 x) internal pure returns (uint256 r) {\n        r = log10(x);\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := add(r, lt(exp(10, r), x))\n        }\n    }\n\n    /// @dev Returns the log256 of `x`.\n    /// Returns 0 if `x` is zero.\n    function log256(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(shr(3, r), lt(0xff, shr(r, x)))\n        }\n    }\n\n    /// @dev Returns the log256 of `x`, rounded up.\n    /// Returns 0 if `x` is zero.\n    function log256Up(uint256 x) internal pure returns (uint256 r) {\n        r = log256(x);\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := add(r, lt(shl(shl(3, r), 1), x))\n        }\n    }\n\n    /// @dev Returns the average of `x` and `y`.\n    function avg(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        unchecked {\n            z = (x & y) + ((x ^ y) >> 1);\n        }\n    }\n\n    /// @dev Returns the average of `x` and `y`.\n    function avg(int256 x, int256 y) internal pure returns (int256 z) {\n        unchecked {\n            z = (x >> 1) + (y >> 1) + (((x & 1) + (y & 1)) >> 1);\n        }\n    }\n\n    /// @dev Returns the absolute value of `x`.\n    function abs(int256 x) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(sub(0, shr(255, x)), add(sub(0, shr(255, x)), x))\n        }\n    }\n\n    /// @dev Returns the absolute distance between `x` and `y`.\n    function dist(int256 x, int256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(mul(xor(sub(y, x), sub(x, y)), sgt(x, y)), sub(y, x))\n        }\n    }\n\n    /// @dev Returns the minimum of `x` and `y`.\n    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, y), lt(y, x)))\n        }\n    }\n\n    /// @dev Returns the minimum of `x` and `y`.\n    function min(int256 x, int256 y) internal pure returns (int256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, y), slt(y, x)))\n        }\n    }\n\n    /// @dev Returns the maximum of `x` and `y`.\n    function max(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, y), gt(y, x)))\n        }\n    }\n\n    /// @dev Returns the maximum of `x` and `y`.\n    function max(int256 x, int256 y) internal pure returns (int256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, y), sgt(y, x)))\n        }\n    }\n\n    /// @dev Returns `x`, bounded to `minValue` and `maxValue`.\n    function clamp(uint256 x, uint256 minValue, uint256 maxValue)\n        internal\n        pure\n        returns (uint256 z)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, minValue), gt(minValue, x)))\n            z := xor(z, mul(xor(z, maxValue), lt(maxValue, z)))\n        }\n    }\n\n    /// @dev Returns `x`, bounded to `minValue` and `maxValue`.\n    function clamp(int256 x, int256 minValue, int256 maxValue) internal pure returns (int256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := xor(x, mul(xor(x, minValue), sgt(minValue, x)))\n            z := xor(z, mul(xor(z, maxValue), slt(maxValue, z)))\n        }\n    }\n\n    /// @dev Returns greatest common divisor of `x` and `y`.\n    function gcd(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            for { z := x } y {} {\n                let t := y\n                y := mod(z, y)\n                z := t\n            }\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                   RAW NUMBER OPERATIONS                    */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns `x + y`, without checking for overflow.\n    function rawAdd(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        unchecked {\n            z = x + y;\n        }\n    }\n\n    /// @dev Returns `x + y`, without checking for overflow.\n    function rawAdd(int256 x, int256 y) internal pure returns (int256 z) {\n        unchecked {\n            z = x + y;\n        }\n    }\n\n    /// @dev Returns `x - y`, without checking for underflow.\n    function rawSub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        unchecked {\n            z = x - y;\n        }\n    }\n\n    /// @dev Returns `x - y`, without checking for underflow.\n    function rawSub(int256 x, int256 y) internal pure returns (int256 z) {\n        unchecked {\n            z = x - y;\n        }\n    }\n\n    /// @dev Returns `x * y`, without checking for overflow.\n    function rawMul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        unchecked {\n            z = x * y;\n        }\n    }\n\n    /// @dev Returns `x * y`, without checking for overflow.\n    function rawMul(int256 x, int256 y) internal pure returns (int256 z) {\n        unchecked {\n            z = x * y;\n        }\n    }\n\n    /// @dev Returns `x / y`, returning 0 if `y` is zero.\n    function rawDiv(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := div(x, y)\n        }\n    }\n\n    /// @dev Returns `x / y`, returning 0 if `y` is zero.\n    function rawSDiv(int256 x, int256 y) internal pure returns (int256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := sdiv(x, y)\n        }\n    }\n\n    /// @dev Returns `x % y`, returning 0 if `y` is zero.\n    function rawMod(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := mod(x, y)\n        }\n    }\n\n    /// @dev Returns `x % y`, returning 0 if `y` is zero.\n    function rawSMod(int256 x, int256 y) internal pure returns (int256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := smod(x, y)\n        }\n    }\n\n    /// @dev Returns `(x + y) % d`, return 0 if `d` if zero.\n    function rawAddMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := addmod(x, y, d)\n        }\n    }\n\n    /// @dev Returns `(x * y) % d`, return 0 if `d` if zero.\n    function rawMulMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := mulmod(x, y, d)\n        }\n    }\n}\n"},{"file_path":"lib/solady/src/utils/LibBit.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Library for bit twiddling and boolean operations.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBit.sol)\n/// @author Inspired by (https://graphics.stanford.edu/~seander/bithacks.html)\nlibrary LibBit {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                  BIT TWIDDLING OPERATIONS                  */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Find last set.\n    /// Returns the index of the most significant bit of `x`,\n    /// counting from the least significant bit position.\n    /// If `x` is zero, returns 256.\n    function fls(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := or(shl(8, iszero(x)), shl(7, lt(0xffffffffffffffffffffffffffffffff, x)))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\n            r := or(r, shl(2, lt(0xf, shr(r, x))))\n            r := or(r, byte(shr(r, x), hex\"00000101020202020303030303030303\"))\n        }\n    }\n\n    /// @dev Count leading zeros.\n    /// Returns the number of zeros preceding the most significant one bit.\n    /// If `x` is zero, returns 256.\n    function clz(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\n            r := or(r, shl(2, lt(0xf, shr(r, x))))\n            // forgefmt: disable-next-item\n            r := add(iszero(x), xor(255,\n                or(r, byte(shr(r, x), hex\"00000101020202020303030303030303\"))))\n        }\n    }\n\n    /// @dev Find first set.\n    /// Returns the index of the least significant bit of `x`,\n    /// counting from the least significant bit position.\n    /// If `x` is zero, returns 256.\n    /// Equivalent to `ctz` (count trailing zeros), which gives\n    /// the number of zeros following the least significant one bit.\n    function ffs(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Isolate the least significant bit.\n            let b := and(x, add(not(x), 1))\n\n            r := or(shl(8, iszero(x)), shl(7, lt(0xffffffffffffffffffffffffffffffff, b)))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, b))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, b))))\n\n            // For the remaining 32 bits, use a De Bruijn lookup.\n            // forgefmt: disable-next-item\n            r := or(r, byte(and(div(0xd76453e0, shr(r, b)), 0x1f),\n                0x001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b1503160405))\n        }\n    }\n\n    /// @dev Returns the number of set bits in `x`.\n    function popCount(uint256 x) internal pure returns (uint256 c) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let max := not(0)\n            let isMax := eq(x, max)\n            x := sub(x, and(shr(1, x), div(max, 3)))\n            x := add(and(x, div(max, 5)), and(shr(2, x), div(max, 5)))\n            x := and(add(x, shr(4, x)), div(max, 17))\n            c := or(shl(8, isMax), shr(248, mul(x, div(max, 255))))\n        }\n    }\n\n    /// @dev Returns whether `x` is a power of 2.\n    function isPo2(uint256 x) internal pure returns (bool result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to `x && !(x & (x - 1))`.\n            result := iszero(add(and(x, sub(x, 1)), iszero(x)))\n        }\n    }\n\n    /// @dev Returns `x` reversed at the bit level.\n    function reverseBits(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Computing masks on-the-fly reduces bytecode size by about 500 bytes.\n            let m := not(0)\n            r := x\n            for { let s := 128 } 1 {} {\n                m := xor(m, shl(s, m))\n                r := or(and(shr(s, r), m), and(shl(s, r), not(m)))\n                s := shr(1, s)\n                if iszero(s) { break }\n            }\n        }\n    }\n\n    /// @dev Returns `x` reversed at the byte level.\n    function reverseBytes(uint256 x) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Computing masks on-the-fly reduces bytecode size by about 200 bytes.\n            let m := not(0)\n            r := x\n            for { let s := 128 } 1 {} {\n                m := xor(m, shl(s, m))\n                r := or(and(shr(s, r), m), and(shl(s, r), not(m)))\n                s := shr(1, s)\n                if eq(s, 4) { break }\n            }\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     BOOLEAN OPERATIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    // A Solidity bool on the stack or memory is represented as a 256-bit word.\n    // Non-zero values are true, zero is false.\n    // A clean bool is either 0 (false) or 1 (true) under the hood.\n    // Usually, if not always, the bool result of a regular Solidity expression,\n    // or the argument of a public/external function will be a clean bool.\n    // You can usually use the raw variants for more performance.\n    // If uncertain, test (best with exact compiler settings).\n    // Or use the non-raw variants (compiler can sometimes optimize out the double `iszero`s).\n\n    /// @dev Returns `x & y`. Inputs must be clean.\n    function rawAnd(bool x, bool y) internal pure returns (bool z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := and(x, y)\n        }\n    }\n\n    /// @dev Returns `x & y`.\n    function and(bool x, bool y) internal pure returns (bool z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := and(iszero(iszero(x)), iszero(iszero(y)))\n        }\n    }\n\n    /// @dev Returns `x | y`. Inputs must be clean.\n    function rawOr(bool x, bool y) internal pure returns (bool z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := or(x, y)\n        }\n    }\n\n    /// @dev Returns `x | y`.\n    function or(bool x, bool y) internal pure returns (bool z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := or(iszero(iszero(x)), iszero(iszero(y)))\n        }\n    }\n\n    /// @dev Returns 1 if `b` is true, else 0. Input must be clean.\n    function rawToUint(bool b) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := b\n        }\n    }\n\n    /// @dev Returns 1 if `b` is true, else 0.\n    function toUint(bool b) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            z := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"lib/solady/src/utils/SafeTransferLib.sol","source_code":"// 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///\n/// @dev Note:\n/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.\n/// - For ERC20s, this implementation won't check that a token has code,\n///   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 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    uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       ETH OPERATIONS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.\n    //\n    // The regular variants:\n    // - Forwards all remaining gas to the target.\n    // - Reverts if the target reverts.\n    // - Reverts if the current contract has insufficient balance.\n    //\n    // The force variants:\n    // - Forwards with an optional gas stipend\n    //   (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).\n    // - If the target reverts, or if the gas stipend is exhausted,\n    //   creates a temporary contract to force send the ETH via `SELFDESTRUCT`.\n    //   Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.\n    // - Reverts if the current contract has insufficient balance.\n    //\n    // The try variants:\n    // - Forwards with a mandatory gas stipend.\n    // - Instead of reverting, returns whether the transfer succeeded.\n\n    /// @dev Sends `amount` (in wei) ETH to `to`.\n    function safeTransferETH(address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /// @dev Sends all the ETH in the current contract to `to`.\n    function safeTransferAllETH(address to) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Transfer all the ETH and check if it succeeded or not.\n            if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n        }\n    }\n\n    /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n    function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if lt(selfbalance(), amount) {\n                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n            if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n            }\n        }\n    }\n\n    /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.\n    function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n            }\n        }\n    }\n\n    /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.\n    function forceSafeTransferETH(address to, uint256 amount) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            if lt(selfbalance(), amount) {\n                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n            if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n            }\n        }\n    }\n\n    /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.\n    function forceSafeTransferAllETH(address to) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // forgefmt: disable-next-item\n            if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n                mstore(0x00, to) // Store the address in scratch space.\n                mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n            }\n        }\n    }\n\n    /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n    function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)\n        internal\n        returns (bool success)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)\n        }\n    }\n\n    /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.\n    function trySafeTransferAllETH(address to, uint256 gasStipend)\n        internal\n        returns (bool success)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)\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            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            mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n            // Perform the transfer, reverting upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n                revert(0x1c, 0x04)\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 their entire balance 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            mstore(0x40, to) // Store the `to` argument.\n            mstore(0x2c, shl(96, from)) // Store the `from` argument.\n            mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\n            // Read the balance, reverting upon failure.\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                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.\n            amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.\n            // Perform the transfer, reverting upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n                revert(0x1c, 0x04)\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            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n            // Perform the transfer, reverting upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\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            // Read the balance, reverting upon failure.\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                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x14, to) // Store the `to` argument.\n            amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.\n            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n            // Perform the transfer, reverting upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\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            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n            // Perform the approval, reverting upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n                revert(0x1c, 0x04)\n            }\n            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n        }\n    }\n\n    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n    /// If the initial attempt to approve fails, attempts to reset the approved amount to zero,\n    /// then retries the approval again (some tokens, e.g. USDT, requires this).\n    /// Reverts upon failure.\n    function safeApproveWithRetry(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            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n            // Perform the approval, retrying upon failure.\n            if iszero(\n                and( // The arguments of `and` are evaluated from right to left.\n                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                )\n            ) {\n                mstore(0x34, 0) // Store 0 for the `amount`.\n                mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n                pop(call(gas(), token, 0, 0x10, 0x44, 0x00, 0x00)) // Reset the approval.\n                mstore(0x34, amount) // Store back the original `amount`.\n                // Retry the approval, reverting upon failure.\n                if iszero(\n                    and(\n                        or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n                        call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n                    )\n                ) {\n                    mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n                    revert(0x1c, 0x04)\n                }\n            }\n            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\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            mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\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"},{"file_path":"src/ReentrancyGuard.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.8.20;\n\n/// @dev Selector for `error NoReentrantCalls()`\nuint256 constant NoReentrantCalls_ErrorSelector = 0x7fa8a987;\n\nuint256 constant _REENTRANCY_GUARD_SLOT = 0x929eee14;\n\n/**\n * @title ReentrancyGuard\n * @author d1ll0n\n * @notice Changes from original:\n *   - Removed the checks for whether tstore is supported.\n * @author Modified from Seaport contract by 0age (https://github.com/ProjectOpenSea/seaport-1.6)\n *\n * @notice ReentrancyGuard contains a transient storage variable and related\n *         functionality for protecting against reentrancy.\n */\ncontract ReentrancyGuard {\n  /**\n   * @dev Revert with an error when a caller attempts to reenter a protected function.\n   *\n   *      Note: Only defined for the sake of the interface and readability - the\n   *      definition is not directly referenced in the contract code.\n   */\n  error NoReentrantCalls();\n\n  uint256 private constant _NOT_ENTERED = 0;\n  uint256 private constant _ENTERED = 1;\n\n  /**\n   * @dev Reentrancy guard for state-changing functions.\n   *      Reverts if the reentrancy guard is currently set; otherwise, sets\n   *      the reentrancy guard, executes the function body, then clears the\n   *      reentrancy guard.\n   */\n  modifier nonReentrant() {\n    _setReentrancyGuard();\n    _;\n    _clearReentrancyGuard();\n  }\n\n  /**\n   * @dev Reentrancy guard for view functions.\n   *      Reverts if the reentrancy guard is currently set.\n   */\n  modifier nonReentrantView() {\n    _assertNonReentrant();\n    _;\n  }\n\n  /**\n   * @dev Internal function to ensure that a sentinel value for the reentrancy\n   *      guard is not currently set and, if not, to set a sentinel value for\n   *      the reentrancy guard.\n   */\n  function _setReentrancyGuard() internal {\n    assembly {\n      // Retrieve the current value of the reentrancy guard slot.\n      let _reentrancyGuard := tload(_REENTRANCY_GUARD_SLOT)\n\n      // Ensure that the reentrancy guard is not already set.\n      // Equivalent to `if (_reentrancyGuard != _NOT_ENTERED) revert NoReentrantCalls();`\n      if _reentrancyGuard {\n        mstore(0, NoReentrantCalls_ErrorSelector)\n        revert(0x1c, 0x04)\n      }\n\n      // Set the reentrancy guard.\n      // Equivalent to `_reentrancyGuard = _ENTERED;`\n      tstore(_REENTRANCY_GUARD_SLOT, _ENTERED)\n    }\n  }\n\n  /**\n   * @dev Internal function to unset the reentrancy guard sentinel value.\n   */\n  function _clearReentrancyGuard() internal {\n    assembly {\n      // Equivalent to `_reentrancyGuard = _NOT_ENTERED;`\n      tstore(_REENTRANCY_GUARD_SLOT, _NOT_ENTERED)\n    }\n  }\n\n  /**\n   * @dev Internal view function to ensure that a sentinel value for the\n   *         reentrancy guard is not currently set.\n   */\n  function _assertNonReentrant() internal view {\n    assembly {\n      // Ensure that the reentrancy guard is not currently set.\n      // Equivalent to `if (_reentrancyGuard != _NOT_ENTERED) revert NoReentrantCalls();`\n      if tload(_REENTRANCY_GUARD_SLOT) {\n        mstore(0, NoReentrantCalls_ErrorSelector)\n        revert(0x1c, 0x04)\n      }\n    }\n  }\n}\n"},{"file_path":"src/interfaces/IWildcatSanctionsSentinel.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.8.20;\n\ninterface IWildcatSanctionsSentinel {\n  event NewSanctionsEscrow(\n    address indexed borrower,\n    address indexed account,\n    address indexed asset\n  );\n\n  event SanctionOverride(address indexed borrower, address indexed account);\n\n  event SanctionOverrideRemoved(address indexed borrower, address indexed account);\n\n  struct TmpEscrowParams {\n    address borrower;\n    address account;\n    address asset;\n  }\n\n  function WildcatSanctionsEscrowInitcodeHash() external pure returns (bytes32);\n\n  // Returns immutable sanctions list contract\n  function chainalysisSanctionsList() external view returns (address);\n\n  // Returns immutable arch-controller\n  function archController() external view returns (address);\n\n  // Returns temporary escrow params\n  function tmpEscrowParams()\n    external\n    view\n    returns (address borrower, address account, address asset);\n\n  // Returns result of `chainalysisSanctionsList().isSanctioned(account)`\n  function isFlaggedByChainalysis(address account) external view returns (bool);\n\n  // Returns result of `chainalysisSanctionsList().isSanctioned(account)`\n  // if borrower has not overridden the status of `account`\n  function isSanctioned(address borrower, address account) external view returns (bool);\n\n  // Returns boolean indicating whether `borrower` has overridden the\n  // sanction status of `account`\n  function sanctionOverrides(address borrower, address account) external view returns (bool);\n\n  function overrideSanction(address account) external;\n\n  function removeSanctionOverride(address account) external;\n\n  // Returns create2 address of sanctions escrow contract for\n  // combination of `borrower,account,asset`\n  function getEscrowAddress(\n    address borrower,\n    address account,\n    address asset\n  ) external view returns (address escrowContract);\n\n  /**\n   * @dev Returns a create2 deployment of WildcatSanctionsEscrow unique to each\n   *      combination of `account,borrower,asset`. If the contract is already\n   *      deployed, returns the existing address.\n   *\n   *      Emits `NewSanctionsEscrow(borrower, account, asset)` if a new contract\n   *      is deployed.\n   *\n   *      The sanctions escrow contract is used to hold assets until either the\n   *      sanctioned status is lifted or the assets are released by the borrower.\n   */\n  function createEscrow(\n    address borrower,\n    address account,\n    address asset\n  ) external returns (address escrowContract);\n}\n"},{"file_path":"src/libraries/Errors.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.8.20;\n\nuint256 constant Panic_CompilerPanic = 0x00;\nuint256 constant Panic_AssertFalse = 0x01;\nuint256 constant Panic_Arithmetic = 0x11;\nuint256 constant Panic_DivideByZero = 0x12;\nuint256 constant Panic_InvalidEnumValue = 0x21;\nuint256 constant Panic_InvalidStorageByteArray = 0x22;\nuint256 constant Panic_EmptyArrayPop = 0x31;\nuint256 constant Panic_ArrayOutOfBounds = 0x32;\nuint256 constant Panic_MemoryTooLarge = 0x41;\nuint256 constant Panic_UninitializedFunctionPointer = 0x51;\n\nuint256 constant Panic_ErrorSelector = 0x4e487b71;\nuint256 constant Panic_ErrorCodePointer = 0x20;\nuint256 constant Panic_ErrorLength = 0x24;\nuint256 constant Error_SelectorPointer = 0x1c;\n\n/**\n * @dev Reverts with the given error selector.\n * @param errorSelector The left-aligned error selector.\n */\nfunction revertWithSelector(bytes4 errorSelector) pure {\n  assembly {\n    mstore(0, errorSelector)\n    revert(0, 4)\n  }\n}\n\n/**\n * @dev Reverts with the given error selector.\n * @param errorSelector The left-padded error selector.\n */\nfunction revertWithSelector(uint256 errorSelector) pure {\n  assembly {\n    mstore(0, errorSelector)\n    revert(Error_SelectorPointer, 4)\n  }\n}\n\n/**\n * @dev Reverts with the given error selector and argument.\n * @param errorSelector The left-aligned error selector.\n * @param argument The argument to the error.\n */\nfunction revertWithSelectorAndArgument(bytes4 errorSelector, uint256 argument) pure {\n  assembly {\n    mstore(0, errorSelector)\n    mstore(4, argument)\n    revert(0, 0x24)\n  }\n}\n\n/**\n * @dev Reverts with the given error selector and argument.\n * @param errorSelector The left-padded error selector.\n * @param argument The argument to the error.\n */\nfunction revertWithSelectorAndArgument(uint256 errorSelector, uint256 argument) pure {\n  assembly {\n    mstore(0, errorSelector)\n    mstore(0x20, argument)\n    revert(Error_SelectorPointer, 0x24)\n  }\n}\n"},{"file_path":"src/libraries/LibERC20.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport './StringQuery.sol';\n\n/// @notice Safe ERC20 library\n/// @author d1ll0n\n/// @notice Changes from solady:\n///   - Removed Permit2 and ETH functions\n///   - `balanceOf(address)` reverts if the call fails or does not return >=32 bytes\n///   - Added queries for `name`, `symbol`, `decimals`\n///   - Set name to LibERC20 as it has queries unrelated to transfers and ETH functions were removed\n/// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibERC20.sol)\n/// @author Previously modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibERC20.sol)\n///\n/// @dev Note:\n/// - For ERC20s, this implementation won't check that a token has code,\n///   responsibility is delegated to the caller.\nlibrary LibERC20 {\n  /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n  /*                       CUSTOM ERRORS                        */\n  /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\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 `balanceOf` call has failed.\n  error BalanceOfFailed();\n\n  /// @dev The ERC20 `name` call has failed.\n  error NameFailed();\n\n  /// @dev The ERC20 `symbol` call has failed.\n  error SymbolFailed();\n\n  /// @dev The ERC20 `decimals` call has failed.\n  error DecimalsFailed();\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      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      mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n      // Perform the transfer, reverting upon failure.\n      if iszero(\n        and(\n          // The arguments of `and` are evaluated from right to left.\n          or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n          call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n        )\n      ) {\n        mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n        revert(0x1c, 0x04)\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      mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n      // Perform the transfer, reverting upon failure.\n      if iszero(\n        and(\n          // The arguments of `and` are evaluated from right to left.\n          or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n          call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n        )\n      ) {\n        mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n        revert(0x1c, 0x04)\n      }\n      mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\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      // Read the balance, reverting upon failure.\n      if iszero(\n        and(\n          // 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        mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n        revert(0x1c, 0x04)\n      }\n      mstore(0x14, to) // Store the `to` argument.\n      amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.\n      mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n      // Perform the transfer, reverting upon failure.\n      if iszero(\n        and(\n          // The arguments of `and` are evaluated from right to left.\n          or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n          call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n        )\n      ) {\n        mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n        revert(0x1c, 0x04)\n      }\n      mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n    }\n  }\n\n  /// @dev Returns the amount of ERC20 `token` owned by `account`.\n  /// Reverts if the call to `balanceOf` reverts or returns less than 32 bytes.\n  function balanceOf(address token, address account) internal view returns (uint256 amount) {\n    /// @solidity memory-safe-assembly\n    assembly {\n      mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.\n      mstore(0x20, account) // Store the `account` argument.\n      // Read the balance, reverting upon failure.\n      if iszero(\n        and(\n          // 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, 0x00, 0x20)\n        )\n      ) {\n        mstore(0x00, 0x4963f6d5) // `BalanceOfFailed()`.\n        revert(0x1c, 0x04)\n      }\n      amount := mload(0x00)\n    }\n  }\n\n  /// @dev Returns the `decimals` of ERC20 `token`.\n  /// Reverts if the call to `decimals` reverts or returns less than 32 bytes.\n  function decimals(address token) internal view returns (uint8 _decimals) {\n    assembly {\n      // Write selector for `decimals()` to the end of the first word\n      // of scratch space.\n      mstore(0, 0x313ce567)\n      // Call `asset.decimals()`, writing up to 32 bytes of returndata\n      // to scratch space, overwriting the calldata used for the call.\n      // Reverts if the call fails, does not return exactly 32 bytes, or the returndata\n      // exceeds 8 bits.\n      if iszero(\n        and(\n          and(eq(returndatasize(), 0x20), lt(mload(0), 0x100)),\n          staticcall(gas(), token, 0x1c, 0x04, 0, 0x20)\n        )\n      ) {\n        mstore(0x00, 0x3394d170) // `DecimalsFailed()`.\n        revert(0x1c, 0x04)\n      }\n      // Read the return value from scratch space\n      _decimals := mload(0)\n    }\n  }\n\n  /// @dev Returns the `name` of ERC20 `token`.\n  /// Reverts if the call to `name` reverts or returns a value which is neither\n  /// a bytes32 string nor a valid ABI-encoded string.\n  function name(address token) internal view returns (string memory) {\n    // The `name` function selector is 0x06fdde03.\n    // The `NameFailed` error selector is 0x2ed09f54.\n    return queryStringOrBytes32AsString(token, 0x06fdde03, 0x2ed09f54);\n  }\n\n  /// @dev Returns the `symbol` of ERC20 `token`.\n  /// Reverts if the call to `symbol` reverts or returns a value which is neither\n  /// a bytes32 string nor a valid ABI-encoded string.\n  function symbol(address token) internal view returns (string memory) {\n    // The `symbol` function selector is 0x95d89b41.\n    // The `SymbolFailed` error selector is 0x3ddcc60a.\n    return queryStringOrBytes32AsString(token, 0x95d89b41, 0x3ddcc60a);\n  }\n}\n"},{"file_path":"src/libraries/MathUtils.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.8.20;\n\nimport './Errors.sol';\n\nuint256 constant BIP = 1e4;\nuint256 constant HALF_BIP = 0.5e4;\n\nuint256 constant RAY = 1e27;\nuint256 constant HALF_RAY = 0.5e27;\n\nuint256 constant BIP_RAY_RATIO = 1e23;\n\nuint256 constant SECONDS_IN_365_DAYS = 365 days;\n\nlibrary MathUtils {\n  /// @dev The multiply-divide operation failed, either due to a\n  /// multiplication overflow, or a division by a zero.\n  error MulDivFailed();\n\n  using MathUtils for uint256;\n\n  /**\n   * @dev Function to calculate the interest accumulated using a linear interest rate formula\n   *\n   * @param rateBip The interest rate, in bips\n   * @param timeDelta The time elapsed since the last interest accrual\n   * @return result The interest rate linearly accumulated during the timeDelta, in ray\n   */\n  function calculateLinearInterestFromBips(\n    uint256 rateBip,\n    uint256 timeDelta\n  ) internal pure returns (uint256 result) {\n    uint256 rate = rateBip.bipToRay();\n    uint256 accumulatedInterestRay = rate * timeDelta;\n    unchecked {\n      return accumulatedInterestRay / SECONDS_IN_365_DAYS;\n    }\n  }\n\n  /**\n   * @dev Return the smaller of `a` and `b`\n   */\n  function min(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    c = ternary(a < b, a, b);\n  }\n\n  /**\n   * @dev Return the larger of `a` and `b`.\n   */\n  function max(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    c = ternary(a < b, b, a);\n  }\n\n  /**\n   * @dev Saturation subtraction. Subtract `b` from `a` and return the result\n   *      if it is positive or zero if it underflows.\n   */\n  function satSub(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    assembly {\n      // (a > b) * (a - b)\n      // If a-b underflows, the product will be zero\n      c := mul(gt(a, b), sub(a, b))\n    }\n  }\n\n  /**\n   * @dev Saturation addition. Add `a` to `b` and return the result\n   *      if it is less than `maxValue` or `maxValue` if it overflows.\n   */\n  function satAdd(uint256 a, uint256 b, uint256 maxValue) internal pure returns (uint256 c) {\n    unchecked {\n      c = a + b;\n      return ternary(c < maxValue, c, maxValue);\n    }\n  }\n\n  /**\n   * @dev Return `valueIfTrue` if `condition` is true and `valueIfFalse` if it is false.\n   *      Equivalent to `condition ? valueIfTrue : valueIfFalse`\n   */\n  function ternary(\n    bool condition,\n    uint256 valueIfTrue,\n    uint256 valueIfFalse\n  ) internal pure returns (uint256 c) {\n    assembly {\n      c := add(valueIfFalse, mul(condition, sub(valueIfTrue, valueIfFalse)))\n    }\n  }\n\n  /**\n   * @dev Multiplies two bip, rounding half up to the nearest bip\n   *      see https://twitter.com/transmissions11/status/1451131036377571328\n   */\n  function bipMul(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    assembly {\n      // equivalent to `require(b == 0 || a <= (type(uint256).max - HALF_BIP) / b)`\n      if iszero(or(iszero(b), iszero(gt(a, div(sub(not(0), HALF_BIP), b))))) {\n        // Store the Panic error signature.\n        mstore(0, Panic_ErrorSelector)\n        // Store the arithmetic (0x11) panic code.\n        mstore(Panic_ErrorCodePointer, Panic_Arithmetic)\n        // revert(abi.encodeWithSignature(\"Panic(uint256)\", 0x11))\n        revert(Error_SelectorPointer, Panic_ErrorLength)\n      }\n\n      c := div(add(mul(a, b), HALF_BIP), BIP)\n    }\n  }\n\n  /**\n   * @dev Divides two bip, rounding half up to the nearest bip\n   *      see https://twitter.com/transmissions11/status/1451131036377571328\n   */\n  function bipDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    assembly {\n      // equivalent to `require(b != 0 && a <= (type(uint256).max - b/2) / BIP)`\n      if or(iszero(b), gt(a, div(sub(not(0), div(b, 2)), BIP))) {\n        mstore(0, Panic_ErrorSelector)\n        mstore(Panic_ErrorCodePointer, Panic_Arithmetic)\n        revert(Error_SelectorPointer, Panic_ErrorLength)\n      }\n\n      c := div(add(mul(a, BIP), div(b, 2)), b)\n    }\n  }\n\n  /**\n   * @dev Converts bip up to ray\n   */\n  function bipToRay(uint256 a) internal pure returns (uint256 b) {\n    // to avoid overflow, b/BIP_RAY_RATIO == a\n    assembly {\n      b := mul(a, BIP_RAY_RATIO)\n      // equivalent to `require((b = a * BIP_RAY_RATIO) / BIP_RAY_RATIO == a )\n      if iszero(eq(div(b, BIP_RAY_RATIO), a)) {\n        mstore(0, Panic_ErrorSelector)\n        mstore(Panic_ErrorCodePointer, Panic_Arithmetic)\n        revert(Error_SelectorPointer, Panic_ErrorLength)\n      }\n    }\n  }\n\n  /**\n   * @dev Multiplies two ray, rounding half up to the nearest ray\n   *      see https://twitter.com/transmissions11/status/1451131036377571328\n   */\n  function rayMul(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    assembly {\n      // equivalent to `require(b == 0 || a <= (type(uint256).max - HALF_RAY) / b)`\n      if iszero(or(iszero(b), iszero(gt(a, div(sub(not(0), HALF_RAY), b))))) {\n        mstore(0, Panic_ErrorSelector)\n        mstore(Panic_ErrorCodePointer, Panic_Arithmetic)\n        revert(Error_SelectorPointer, Panic_ErrorLength)\n      }\n\n      c := div(add(mul(a, b), HALF_RAY), RAY)\n    }\n  }\n\n  /**\n   * @dev Divide two ray, rounding half up to the nearest ray\n   *      see https://twitter.com/transmissions11/status/1451131036377571328\n   */\n  function rayDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {\n    assembly {\n      // equivalent to `require(b != 0 && a <= (type(uint256).max - halfB) / RAY)`\n      if or(iszero(b), gt(a, div(sub(not(0), div(b, 2)), RAY))) {\n        mstore(0, Panic_ErrorSelector)\n        mstore(Panic_ErrorCodePointer, Panic_Arithmetic)\n        revert(Error_SelectorPointer, Panic_ErrorLength)\n      }\n\n      c := div(add(mul(a, RAY), div(b, 2)), b)\n    }\n  }\n\n  /**\n   * @dev Returns `floor(x * y / d)`.\n   *      Reverts if `x * y` overflows, or `d` is zero.\n   * @custom:author solady/src/utils/FixedPointMathLib.sol\n   */\n  function mulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n    assembly {\n      // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\n      if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\n        // Store the function selector of `MulDivFailed()`.\n        mstore(0x00, 0xad251c27)\n        // Revert with (offset, size).\n        revert(0x1c, 0x04)\n      }\n      z := div(mul(x, y), d)\n    }\n  }\n\n  /**\n   * @dev Returns `ceil(x * y / d)`.\n   *      Reverts if `x * y` overflows, or `d` is zero.\n   * @custom:author solady/src/utils/FixedPointMathLib.sol\n   */\n  function mulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {\n    assembly {\n      // Equivalent to require(d != 0 && (y == 0 || x <= type(uint256).max / y))\n      if iszero(mul(d, iszero(mul(y, gt(x, div(not(0), y)))))) {\n        // Store the function selector of `MulDivFailed()`.\n        mstore(0x00, 0xad251c27)\n        // Revert with (offset, size).\n        revert(0x1c, 0x04)\n      }\n      z := add(iszero(iszero(mod(mul(x, y), d))), div(mul(x, y), d))\n    }\n  }\n}\n"},{"file_path":"src/libraries/StringQuery.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.8.20;\n\nimport { LibBit } from 'solady/utils/LibBit.sol';\n\nusing LibBit for uint256;\n\nuint256 constant OnlyFullWordMask = 0xffffffe0;\n\nfunction bytes32ToString(bytes32 value) pure returns (string memory str) {\n  uint256 size;\n  unchecked {\n    uint256 sizeInBits = 255 - uint256(value).ffs();\n    size = (sizeInBits + 7) / 8;\n  }\n  assembly {\n    str := mload(0x40)\n    mstore(0x40, add(str, 0x40))\n    mstore(str, size)\n    mstore(add(str, 0x20), value)\n  }\n}\n\nfunction queryStringOrBytes32AsString(\n  address target,\n  uint256 leftPaddedFunctionSelector,\n  uint256 leftPaddedGenericErrorSelector\n) view returns (string memory str) {\n  bool isBytes32;\n  assembly {\n    mstore(0, leftPaddedFunctionSelector)\n    let status := staticcall(gas(), target, 0x1c, 0x04, 0, 0)\n    isBytes32 := eq(returndatasize(), 0x20)\n    // If call fails or function returns invalid data, revert.\n    // Strings are always right padded to full words - if the returndata\n    // is not 32 bytes (string encoded as bytes32) or >95 bytes (minimum abi\n    // encoded string) it is an invalid string.\n    if or(iszero(status), iszero(or(isBytes32, gt(returndatasize(), 0x5f)))) {\n      // Check if call failed\n      if iszero(status) {\n        // Check if any revert data was given\n        if returndatasize() {\n          returndatacopy(0, 0, returndatasize())\n          revert(0, returndatasize())\n        }\n        // If not, throw a generic error\n        mstore(0, leftPaddedGenericErrorSelector)\n        revert(0x1c, 0x04)\n      }\n      // If the returndata is the wrong size, `revert InvalidReturnDataString()`\n      mstore(0, 0x4cb9c000)\n      revert(0x1c, 0x04)\n    }\n  }\n  if (isBytes32) {\n    bytes32 value;\n    assembly {\n      returndatacopy(0x00, 0x00, 0x20)\n      value := mload(0)\n    }\n    str = bytes32ToString(value);\n  } else {\n    // If returndata is a string, copy the length and value\n    assembly {\n      str := mload(0x40)\n      // Get allocation size for the string including the length and data.\n      // Rounding down returndatasize to nearest word because the returndata\n      // has an extra offset word.\n      let allocSize := and(sub(returndatasize(), 1), OnlyFullWordMask)\n      mstore(0x40, add(str, allocSize))\n      // Copy returndata after the offset\n      returndatacopy(str, 0x20, sub(returndatasize(), 0x20))\n      let length := mload(str)\n      // Check if the length matches the returndatasize.\n      // The encoded string should have the string length rounded up to the nearest word\n      // as well as two words for length and offset.\n      let expectedReturndataSize := add(allocSize, 0x20)\n      if xor(returndatasize(), expectedReturndataSize) {\n        mstore(0, 0x4cb9c000)\n        revert(0x1c, 0x04)\n      }\n    }\n  }\n}\n"}],"is_verified_via_sourcify":false,"can_be_visualized_via_sol2uml":true,"evm_version":"cancun","language":"solidity","is_verified_via_eth_bytecode_db":false,"is_fully_verified":true,"license_type":"none","is_blueprint":false,"name":"Wildcat4626Wrapper","creation_bytecode":"0x610100604052348015610010575f80fd5b506040516144fd3803806144fd833981810160405281019061003291906104a1565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610097576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250505f60805173ffffffffffffffffffffffffffffffffffffffff16637df1f1b96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610117573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061013b91906104a1565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101a2576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60805173ffffffffffffffffffffffffffffffffffffffff1663f58c251c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101ee573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061021291906104a1565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610279576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff168152505060805173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103509190610502565b60ff1660e08160ff16815250505f8373ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b81526004015f60405180830381865afa1580156103a6573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906103ce9190610669565b9050806040516020016103e1919061071a565b6040516020818303038152906040525f90816103fd9190610942565b508060405160200161040f9190610a37565b6040516020818303038152906040526001908161042c9190610942565b5050505050610a5c565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61047082610447565b9050919050565b61048081610466565b811461048a575f80fd5b50565b5f8151905061049b81610477565b92915050565b5f602082840312156104b6576104b561043f565b5b5f6104c38482850161048d565b91505092915050565b5f60ff82169050919050565b6104e1816104cc565b81146104eb575f80fd5b50565b5f815190506104fc816104d8565b92915050565b5f602082840312156105175761051661043f565b5b5f610524848285016104ee565b91505092915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61057b82610535565b810181811067ffffffffffffffff8211171561059a57610599610545565b5b80604052505050565b5f6105ac610436565b90506105b88282610572565b919050565b5f67ffffffffffffffff8211156105d7576105d6610545565b5b6105e082610535565b9050602081019050919050565b8281835e5f83830152505050565b5f61060d610608846105bd565b6105a3565b90508281526020810184848401111561062957610628610531565b5b6106348482856105ed565b509392505050565b5f82601f8301126106505761064f61052d565b5b81516106608482602086016105fb565b91505092915050565b5f6020828403121561067e5761067d61043f565b5b5f82015167ffffffffffffffff81111561069b5761069a610443565b5b6106a78482850161063c565b91505092915050565b5f81519050919050565b5f81905092915050565b5f6106ce826106b0565b6106d881856106ba565b93506106e88185602086016105ed565b80840191505092915050565b7f205b34363236205661756c74205368617265735d000000000000000000000000815250565b5f61072582846106c4565b9150610730826106f4565b60148201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061078357607f821691505b6020821081036107965761079561073f565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026107f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826107bd565b61080286836107bd565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f61084661084161083c8461081a565b610823565b61081a565b9050919050565b5f819050919050565b61085f8361082c565b61087361086b8261084d565b8484546107c9565b825550505050565b5f90565b61088761087b565b610892818484610856565b505050565b5b818110156108b5576108aa5f8261087f565b600181019050610898565b5050565b601f8211156108fa576108cb8161079c565b6108d4846107ae565b810160208510156108e3578190505b6108f76108ef856107ae565b830182610897565b50505b505050565b5f82821c905092915050565b5f61091a5f19846008026108ff565b1980831691505092915050565b5f610932838361090b565b9150826002028217905092915050565b61094b826106b0565b67ffffffffffffffff81111561096457610963610545565b5b61096e825461076c565b6109798282856108b9565b5f60209050601f8311600181146109aa575f8415610998578287015190505b6109a28582610927565b865550610a09565b601f1984166109b88661079c565b5f5b828110156109df578489015182556001820191506020850194506020810190506109ba565b868310156109fc57848901516109f8601f89168261090b565b8355505b6001600288020188555050505b505050505050565b7f762d000000000000000000000000000000000000000000000000000000000000815250565b5f610a4182610a11565b600282019150610a5182846106c4565b915081905092915050565b60805160a05160c05160e05161396b610b925f395f610c0001525f8181610db60152612b7601525f8181610dda01528181611d3c0152612bb201525f81816107a8015281816108e5015281816109e801528181610a9c01528181610cb701528181610cf501528181610dfe01528181610ec401528181610f9a01528181610fbe015281816110860152818161123e015281816112d60152818161134801528181611522015281816115460152818161160e015281816118b3015281816119aa01528181611abe01528181611b6301528181611bb201528181611e6601528181611eba01528181611fa8015281816120a80152818161231a015281816123ef01528181612494015281816124e301528181612682015281816127360152818161280c01528181612cac0152612d3c015261396b5ff3fe608060405234801561000f575f80fd5b506004361061020f575f3560e01c806370a0823111610123578063b8dc491b116100ab578063ce96cb771161007a578063ce96cb77146106c9578063d505accf146106f9578063d905777e14610715578063dd62ed3e14610745578063ef8b30f7146107755761020f565b8063b8dc491b14610609578063ba08765214610639578063c63d75b614610669578063c6e6f592146106995761020f565b806394bf804d116100f257806394bf804d1461052b57806395d89b411461055b578063a9059cbb14610579578063b3d7f6b9146105a9578063b460af94146105d95761020f565b806370a082311461048f5780637ecebe00146104bf57806380c9697e146104ef57806380f556051461050d5761020f565b8063313ce567116101a65780634272711d116101755780634272711d146103d557806347d90b5c146103f357806348302ce9146104115780634cdad5061461042f5780636e553f651461045f5761020f565b8063313ce5671461034b5780633644e5151461036957806338d52e0f14610387578063402d267d146103a55761020f565b80630a28a477116101e25780630a28a477146102af57806318160ddd146102df5780631c856ef6146102fd57806323b872dd1461031b5761020f565b806301e1d1141461021357806306fdde031461023157806307a2d13a1461024f578063095ea7b31461027f575b5f80fd5b61021b6107a5565b6040516102289190613186565b60405180910390f35b610239610843565b604051610246919061320f565b60405180910390f35b6102696004803603810190610264919061325d565b6108d2565b6040516102769190613186565b60405180910390f35b610299600480360381019061029491906132e2565b610985565b6040516102a6919061333a565b60405180910390f35b6102c960048036038101906102c4919061325d565b6109d5565b6040516102d69190613186565b60405180910390f35b6102e7610a88565b6040516102f49190613186565b60405180910390f35b610305610a99565b6040516103129190613186565b60405180910390f35b61033560048036038101906103309190613353565b610b2c565b604051610342919061333a565b60405180910390f35b610353610bfd565b60405161036091906133be565b60405180910390f35b610371610c24565b60405161037e91906133ef565b60405180910390f35b61038f610cb4565b60405161039c9190613417565b60405180910390f35b6103bf60048036038101906103ba9190613430565b610cdb565b6040516103cc9190613186565b60405180910390f35b6103dd610db4565b6040516103ea91906134b6565b60405180910390f35b6103fb610dd8565b6040516104089190613417565b60405180910390f35b610419610dfc565b60405161042691906134ef565b60405180910390f35b6104496004803603810190610444919061325d565b610e20565b6040516104569190613186565b60405180910390f35b61047960048036038101906104749190613508565b610e31565b6040516104869190613186565b60405180910390f35b6104a960048036038101906104a49190613430565b6111f8565b6040516104b69190613186565b60405180910390f35b6104d960048036038101906104d49190613430565b611211565b6040516104e69190613186565b60405180910390f35b6104f761122a565b6040516105049190613186565b60405180910390f35b6105156112d3565b6040516105229190613417565b60405180910390f35b61054560048036038101906105409190613508565b6112fa565b6040516105529190613186565b60405180910390f35b610563611782565b604051610570919061320f565b60405180910390f35b610593600480360381019061058e91906132e2565b611812565b6040516105a0919061333a565b60405180910390f35b6105c360048036038101906105be919061325d565b6118a0565b6040516105d09190613186565b60405180910390f35b6105f360048036038101906105ee9190613546565b611953565b6040516106009190613186565b60405180910390f35b610623600480360381019061061e9190613596565b611d31565b6040516106309190613186565b60405180910390f35b610653600480360381019061064e9190613546565b612284565b6040516106609190613186565b60405180910390f35b610683600480360381019061067e9190613430565b612662565b6040516106909190613186565b60405180910390f35b6106b360048036038101906106ae919061325d565b612723565b6040516106c09190613186565b60405180910390f35b6106e360048036038101906106de9190613430565b6127d6565b6040516106f09190613186565b60405180910390f35b610713600480360381019061070e9190613628565b6128e9565b005b61072f600480360381019061072a9190613430565b612a85565b60405161073c9190613186565b60405180910390f35b61075f600480360381019061075a9190613596565b612aad565b60405161076c9190613186565b60405180910390f35b61078f600480360381019061078a919061325d565b612acb565b60405161079c9190613186565b60405180910390f35b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107ff9190613417565b602060405180830381865afa15801561081a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083e91906136d9565b905090565b60605f805461085190613731565b80601f016020809104026020016040519081016040528092919081815260200182805461087d90613731565b80156108c85780601f1061089f576101008083540402835291602001916108c8565b820191905f5260205f20905b8154815290600101906020018083116108ab57829003601f168201915b5050505050905090565b5f8082036108e2575f9050610980565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561094c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061097091906136d9565b905061097c8382612adc565b9150505b919050565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b5f8082036109e5575f9050610a83565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a7391906136d9565b9050610a7f8382612afc565b9150505b919050565b5f6805345cdf77eb68f44c54905090565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b03573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2791906136d9565b905090565b5f610b38848484612b1c565b8360601b33602052637f5e9f208117600c526034600c2080546001810115610b755780851115610b6f576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c20805480871115610b9b5763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610bf2848484612b33565b600190509392505050565b5f7f0000000000000000000000000000000000000000000000000000000000000000905090565b5f80610c2e612b38565b90505f801b8103610c4b57610c41610843565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b5f7f0000000000000000000000000000000000000000000000000000000000000000905090565b5f610ce582612b3c565b15610cf2575f9050610daf565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632ab4d0526040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d5c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8091906136d9565b90505f610d8b6107a5565b9050818110610d9e575f92505050610daf565b8082610daa919061378e565b925050505b919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610e2a826108d2565b9050919050565b5f610e3a612c36565b610e4333612c5a565b5f8303610e7c576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610e85612ca8565b905080841115610ec1576040517fa4875a4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f2b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f4f91906136d9565b90505f610f5c8683612df9565b90505f8103610f97576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000090505f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016110159190613417565b602060405180830381865afa158015611030573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061105491906136d9565b905061108333308a8573ffffffffffffffffffffffffffffffffffffffff16612e3c909392919063ffffffff16565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016110dd9190613417565b602060405180830381865afa1580156110f8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061111c91906136d9565b9050818161112a919061378e565b9650838710156111735783876040517fa25a9bfc00000000000000000000000000000000000000000000000000000000815260040161116a9291906137c1565b60405180910390fd5b61117d8888612e96565b8773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78b8a6040516111dc9291906137c1565b60405180910390a35050505050506111f2612f28565b92915050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b5f6112ce6b033b2e3c9fd0803ce8000000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c991906136d9565b612f31565b905090565b5f7f0000000000000000000000000000000000000000000000000000000000000000905090565b5f611303612c36565b61130c33612c5a565b5f8303611345576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113af573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113d391906136d9565b90506113dd612ca8565b91505f8214806113f557506113f28282612df9565b84115b1561142c576040517fa4875a4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818561143991906137e8565b90505f6002836114499190613856565b9050808211611484576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6b033b2e3c9fd0803ce800000060016b033b2e3c9fd0803ce800000083856114ac919061378e565b6114b69190613886565b6114c0919061378e565b6114ca9190613856565b93505f6114d78585612df9565b905086811461151f5786816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016115169291906137c1565b60405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000090505f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b815260040161159d9190613417565b602060405180830381865afa1580156115b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115dc91906136d9565b905061160b3330898573ffffffffffffffffffffffffffffffffffffffff16612e3c909392919063ffffffff16565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016116659190613417565b602060405180830381865afa158015611680573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116a491906136d9565b90505f82826116b3919061378e565b90508a81146116fb578a816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016116f29291906137c1565b60405180910390fd5b6117058a8c612e96565b8973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78b8e6040516117649291906137c1565b60405180910390a3505050505050505061177c612f28565b92915050565b60606001805461179190613731565b80601f01602080910402602001604051908101604052809291908181526020018280546117bd90613731565b80156118085780601f106117df57610100808354040283529160200191611808565b820191905f5260205f20905b8154815290600101906020018083116117eb57829003601f168201915b5050505050905090565b5f61181e338484612b1c565b6387a211a2600c52335f526020600c208054808411156118455763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050611896338484612b33565b6001905092915050565b5f8082036118b0575f905061194e565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561191a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061193e91906136d9565b905061194a8382612f5c565b9150505b919050565b5f61195c612c36565b61196533612c5a565b61196e83612c5a565b5f84036119a7576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a3591906136d9565b9050611a418582612df9565b91505f8203611a7c576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611abb57611aba833384612f7c565b5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611b159190613417565b602060405180830381865afa158015611b30573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b5491906136d9565b9050611b608484612fbd565b5f7f00000000000000000000000000000000000000000000000000000000000000009050611baf86888373ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611c099190613417565b602060405180830381865afa158015611c24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c4891906136d9565b90505f8184611c57919061378e565b9050858114611c9f5785816040517fa25a9bfc000000000000000000000000000000000000000000000000000000008152600401611c969291906137c1565b60405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8c8a604051611d159291906137c1565b60405180910390a45050505050611d2a612f28565b9392505050565b5f611d3a612c36565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dbf576040517f340f44d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611e2457505f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e5b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e6482612c5a565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036121a0575f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611f119190613417565b602060405180830381865afa158015611f2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5091906136d9565b90505f611f5b610a88565b9050808211611f96576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8183611fa3919061378e565b90505f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561200f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061203391906136d9565b905061203f8282613096565b94505f850361207a576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120a586868973ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016120ff9190613417565b602060405180830381865afa15801561211a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061213e91906136d9565b90505f818661214d919061378e565b90508381146121955783816040517fa25a9bfc00000000000000000000000000000000000000000000000000000000815260040161218c9291906137c1565b60405180910390fd5b505050505050612211565b6121aa83306130e5565b90505f81036121e5576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61221082828573ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fd092d7fceb5ea5a962639fcc27a7bb315e7637e699e3b108cd570c38c75843008360405161226e9190613186565b60405180910390a361227e612f28565b92915050565b5f61228d612c36565b61229633612c5a565b61229f83612c5a565b5f84036122d8576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461231757612316823386612f7c565b5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015612381573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123a591906136d9565b90506123b18582613096565b91505f82036123ec576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016124469190613417565b602060405180830381865afa158015612461573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061248591906136d9565b90506124918487612fbd565b5f7f000000000000000000000000000000000000000000000000000000000000000090506124e086858373ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b815260040161253a9190613417565b602060405180830381865afa158015612555573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061257991906136d9565b90505f8184612588919061378e565b90508881146125d05788816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016125c79291906137c1565b60405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db898d6040516126469291906137c1565b60405180910390a4505050505061265b612f28565b9392505050565b5f8061266d83610cdb565b90505f810361267f575f91505061271e565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061270d91906136d9565b90506127198282612df9565b925050505b919050565b5f808203612733575f90506127d1565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561279d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127c191906136d9565b90506127cd838261311b565b9150505b919050565b5f6127e082612b3c565b156127ed575f90506128e4565b5f6127f7836111f8565b90505f8103612809575f9150506128e4565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015612873573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061289791906136d9565b90506b033b2e3c9fd0803ce800000060026001836128b5919061378e565b6128bf9190613856565b82846128cb91906137e8565b6128d59190613886565b6128df9190613856565b925050505b919050565b5f6128f2612b38565b90505f801b810361290f57612905610843565b8051906020012090505b8442111561292457631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d5114612a2c5763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f612a8f82612b3c565b15612a9c575f9050612aa8565b612aa5826111f8565b90505b919050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b5f612ad582612723565b9050919050565b5f612af483836b033b2e3c9fd0803ce8000000612f31565b905092915050565b5f612b14836b033b2e3c9fd0803ce80000008461313b565b905092915050565b612b2583612c5a565b612b2e82612c5a565b505050565b505050565b5f90565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015612c2f57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166306e744447f0000000000000000000000000000000000000000000000000000000000000000846040518363ffffffff1660e01b8152600401612bef9291906138b9565b602060405180830381865afa158015612c0a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c2e919061390a565b5b9050919050565b63929eee145c8015612c4f57637fa8a9875f526004601cfd5b600163929eee145d50565b612c6381612b3c565b15612ca557806040517f2bbe9620000000000000000000000000000000000000000000000000000000008152600401612c9c9190613417565b60405180910390fd5b50565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632ab4d0526040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d3791906136d9565b90505f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612d939190613417565b602060405180830381865afa158015612dae573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612dd291906136d9565b9050818110612de5575f92505050612df6565b8082612df1919061378e565b925050505b90565b5f81600283612e089190613856565b6b033b2e3c9fd0803ce800000085612e2091906137e8565b612e2a9190613886565b612e349190613856565b905092915050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716612e8757637939f4245f526004601cfd5b5f606052806040525050505050565b612ea15f8383612b1c565b6805345cdf77eb68f44c5481810181811015612ec45763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050612f245f8383612b33565b5050565b5f63929eee145d565b5f825f190484118302158202612f4e5763ad251c275f526004601cfd5b818385020490509392505050565b5f612f7483836b033b2e3c9fd0803ce800000061313b565b905092915050565b81602052637f5e9f20600c52825f526034600c2080546001810115612fb65780831115612fb0576313be252b5f526004601cfd5b82810382555b5050505050565b612fc8825f83612b1c565b6387a211a2600c52815f526020600c20805480831115612fef5763f4d678b85f526004601cfd5b8281038255826805345cdf77eb68f44c54036805345cdf77eb68f44c55825f525f8460601b60601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa35050613049825f83612b33565b5050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f5114171661308d576390b8ec185f526004601cfd5b5f603452505050565b5f6b033b2e3c9fd0803ce800000060026b033b2e3c9fd0803ce80000006130bd9190613856565b83856130c991906137e8565b6130d39190613886565b6130dd9190613856565b905092915050565b5f6370a082315f528160205260205f6024601c865afa601f3d111661311157634963f6d55f526004601cfd5b5f51905092915050565b5f613133836b033b2e3c9fd0803ce800000084612f31565b905092915050565b5f825f1904841183021582026131585763ad251c275f526004601cfd5b8183850204828486020615150190509392505050565b5f819050919050565b6131808161316e565b82525050565b5f6020820190506131995f830184613177565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6131e18261319f565b6131eb81856131a9565b93506131fb8185602086016131b9565b613204816131c7565b840191505092915050565b5f6020820190508181035f83015261322781846131d7565b905092915050565b5f80fd5b61323c8161316e565b8114613246575f80fd5b50565b5f8135905061325781613233565b92915050565b5f602082840312156132725761327161322f565b5b5f61327f84828501613249565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6132b182613288565b9050919050565b6132c1816132a7565b81146132cb575f80fd5b50565b5f813590506132dc816132b8565b92915050565b5f80604083850312156132f8576132f761322f565b5b5f613305858286016132ce565b925050602061331685828601613249565b9150509250929050565b5f8115159050919050565b61333481613320565b82525050565b5f60208201905061334d5f83018461332b565b92915050565b5f805f6060848603121561336a5761336961322f565b5b5f613377868287016132ce565b9350506020613388868287016132ce565b925050604061339986828701613249565b9150509250925092565b5f60ff82169050919050565b6133b8816133a3565b82525050565b5f6020820190506133d15f8301846133af565b92915050565b5f819050919050565b6133e9816133d7565b82525050565b5f6020820190506134025f8301846133e0565b92915050565b613411816132a7565b82525050565b5f60208201905061342a5f830184613408565b92915050565b5f602082840312156134455761344461322f565b5b5f613452848285016132ce565b91505092915050565b5f819050919050565b5f61347e61347961347484613288565b61345b565b613288565b9050919050565b5f61348f82613464565b9050919050565b5f6134a082613485565b9050919050565b6134b081613496565b82525050565b5f6020820190506134c95f8301846134a7565b92915050565b5f6134d982613485565b9050919050565b6134e9816134cf565b82525050565b5f6020820190506135025f8301846134e0565b92915050565b5f806040838503121561351e5761351d61322f565b5b5f61352b85828601613249565b925050602061353c858286016132ce565b9150509250929050565b5f805f6060848603121561355d5761355c61322f565b5b5f61356a86828701613249565b935050602061357b868287016132ce565b925050604061358c868287016132ce565b9150509250925092565b5f80604083850312156135ac576135ab61322f565b5b5f6135b9858286016132ce565b92505060206135ca858286016132ce565b9150509250929050565b6135dd816133a3565b81146135e7575f80fd5b50565b5f813590506135f8816135d4565b92915050565b613607816133d7565b8114613611575f80fd5b50565b5f81359050613622816135fe565b92915050565b5f805f805f805f60e0888a0312156136435761364261322f565b5b5f6136508a828b016132ce565b97505060206136618a828b016132ce565b96505060406136728a828b01613249565b95505060606136838a828b01613249565b94505060806136948a828b016135ea565b93505060a06136a58a828b01613614565b92505060c06136b68a828b01613614565b91505092959891949750929550565b5f815190506136d381613233565b92915050565b5f602082840312156136ee576136ed61322f565b5b5f6136fb848285016136c5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061374857607f821691505b60208210810361375b5761375a613704565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6137988261316e565b91506137a38361316e565b92508282039050818111156137bb576137ba613761565b5b92915050565b5f6040820190506137d45f830185613177565b6137e16020830184613177565b9392505050565b5f6137f28261316e565b91506137fd8361316e565b925082820261380b8161316e565b9150828204841483151761382257613821613761565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6138608261316e565b915061386b8361316e565b92508261387b5761387a613829565b5b828204905092915050565b5f6138908261316e565b915061389b8361316e565b92508282019050808211156138b3576138b2613761565b5b92915050565b5f6040820190506138cc5f830185613408565b6138d96020830184613408565b9392505050565b6138e981613320565b81146138f3575f80fd5b50565b5f81519050613904816138e0565b92915050565b5f6020828403121561391f5761391e61322f565b5b5f61392c848285016138f6565b9150509291505056fea2646970667358221220919bf5abd0d10e8228021ec5a8f75fc2863c8d4bb8d6cd69ba235f743d141a8a64736f6c63430008190033000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e2","external_libraries":[],"proxy_type":null,"implementations":[],"verified_at":"2026-04-14T09:23:27.873353Z","is_verified_via_verifier_alliance":false,"compiler_version":"v0.8.25+commit.b61c2a91","decoded_constructor_args":[["0xC9499006a149C553d18171747ED19Aa7C6Dd19E2",{"internalType":"address","name":"marketAddress","type":"address"}]],"sourcify_repo_url":null,"optimization_runs":null,"compiler_settings":{"evmVersion":"cancun","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":false,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["forge-std/=lib/forge-std/src/","ds-test/=lib/ds-test/src/","solmate/=lib/solmate/src/","solady/=lib/solady/src/","openzeppelin/=lib/openzeppelin-contracts/","sol-utils/=lib/sol-utils/src/","ethereum-access-token/=lib/ethereum-access-token/contracts/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","openzeppelin-contracts/=lib/openzeppelin-contracts/","vulcan/=lib/vulcan/src/"],"viaIR":false},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":false,"deployed_bytecode":"0x608060405234801561000f575f80fd5b506004361061020f575f3560e01c806370a0823111610123578063b8dc491b116100ab578063ce96cb771161007a578063ce96cb77146106c9578063d505accf146106f9578063d905777e14610715578063dd62ed3e14610745578063ef8b30f7146107755761020f565b8063b8dc491b14610609578063ba08765214610639578063c63d75b614610669578063c6e6f592146106995761020f565b806394bf804d116100f257806394bf804d1461052b57806395d89b411461055b578063a9059cbb14610579578063b3d7f6b9146105a9578063b460af94146105d95761020f565b806370a082311461048f5780637ecebe00146104bf57806380c9697e146104ef57806380f556051461050d5761020f565b8063313ce567116101a65780634272711d116101755780634272711d146103d557806347d90b5c146103f357806348302ce9146104115780634cdad5061461042f5780636e553f651461045f5761020f565b8063313ce5671461034b5780633644e5151461036957806338d52e0f14610387578063402d267d146103a55761020f565b80630a28a477116101e25780630a28a477146102af57806318160ddd146102df5780631c856ef6146102fd57806323b872dd1461031b5761020f565b806301e1d1141461021357806306fdde031461023157806307a2d13a1461024f578063095ea7b31461027f575b5f80fd5b61021b6107a5565b6040516102289190613186565b60405180910390f35b610239610843565b604051610246919061320f565b60405180910390f35b6102696004803603810190610264919061325d565b6108d2565b6040516102769190613186565b60405180910390f35b610299600480360381019061029491906132e2565b610985565b6040516102a6919061333a565b60405180910390f35b6102c960048036038101906102c4919061325d565b6109d5565b6040516102d69190613186565b60405180910390f35b6102e7610a88565b6040516102f49190613186565b60405180910390f35b610305610a99565b6040516103129190613186565b60405180910390f35b61033560048036038101906103309190613353565b610b2c565b604051610342919061333a565b60405180910390f35b610353610bfd565b60405161036091906133be565b60405180910390f35b610371610c24565b60405161037e91906133ef565b60405180910390f35b61038f610cb4565b60405161039c9190613417565b60405180910390f35b6103bf60048036038101906103ba9190613430565b610cdb565b6040516103cc9190613186565b60405180910390f35b6103dd610db4565b6040516103ea91906134b6565b60405180910390f35b6103fb610dd8565b6040516104089190613417565b60405180910390f35b610419610dfc565b60405161042691906134ef565b60405180910390f35b6104496004803603810190610444919061325d565b610e20565b6040516104569190613186565b60405180910390f35b61047960048036038101906104749190613508565b610e31565b6040516104869190613186565b60405180910390f35b6104a960048036038101906104a49190613430565b6111f8565b6040516104b69190613186565b60405180910390f35b6104d960048036038101906104d49190613430565b611211565b6040516104e69190613186565b60405180910390f35b6104f761122a565b6040516105049190613186565b60405180910390f35b6105156112d3565b6040516105229190613417565b60405180910390f35b61054560048036038101906105409190613508565b6112fa565b6040516105529190613186565b60405180910390f35b610563611782565b604051610570919061320f565b60405180910390f35b610593600480360381019061058e91906132e2565b611812565b6040516105a0919061333a565b60405180910390f35b6105c360048036038101906105be919061325d565b6118a0565b6040516105d09190613186565b60405180910390f35b6105f360048036038101906105ee9190613546565b611953565b6040516106009190613186565b60405180910390f35b610623600480360381019061061e9190613596565b611d31565b6040516106309190613186565b60405180910390f35b610653600480360381019061064e9190613546565b612284565b6040516106609190613186565b60405180910390f35b610683600480360381019061067e9190613430565b612662565b6040516106909190613186565b60405180910390f35b6106b360048036038101906106ae919061325d565b612723565b6040516106c09190613186565b60405180910390f35b6106e360048036038101906106de9190613430565b6127d6565b6040516106f09190613186565b60405180910390f35b610713600480360381019061070e9190613628565b6128e9565b005b61072f600480360381019061072a9190613430565b612a85565b60405161073c9190613186565b60405180910390f35b61075f600480360381019061075a9190613596565b612aad565b60405161076c9190613186565b60405180910390f35b61078f600480360381019061078a919061325d565b612acb565b60405161079c9190613186565b60405180910390f35b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107ff9190613417565b602060405180830381865afa15801561081a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083e91906136d9565b905090565b60605f805461085190613731565b80601f016020809104026020016040519081016040528092919081815260200182805461087d90613731565b80156108c85780601f1061089f576101008083540402835291602001916108c8565b820191905f5260205f20905b8154815290600101906020018083116108ab57829003601f168201915b5050505050905090565b5f8082036108e2575f9050610980565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561094c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061097091906136d9565b905061097c8382612adc565b9150505b919050565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b5f8082036109e5575f9050610a83565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a7391906136d9565b9050610a7f8382612afc565b9150505b919050565b5f6805345cdf77eb68f44c54905090565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b03573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2791906136d9565b905090565b5f610b38848484612b1c565b8360601b33602052637f5e9f208117600c526034600c2080546001810115610b755780851115610b6f576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c20805480871115610b9b5763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610bf2848484612b33565b600190509392505050565b5f7f0000000000000000000000000000000000000000000000000000000000000006905090565b5f80610c2e612b38565b90505f801b8103610c4b57610c41610843565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e2905090565b5f610ce582612b3c565b15610cf2575f9050610daf565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16632ab4d0526040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d5c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8091906136d9565b90505f610d8b6107a5565b9050818110610d9e575f92505050610daf565b8082610daa919061378e565b925050505b919050565b7f000000000000000000000000437e0551892c2c9b06d3ffd248fe60572e08cd1a81565b7f0000000000000000000000005b15f94efc3a6e2c82d7db8efd8d5ba55da11feb81565b7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e281565b5f610e2a826108d2565b9050919050565b5f610e3a612c36565b610e4333612c5a565b5f8303610e7c576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610e85612ca8565b905080841115610ec1576040517fa4875a4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f2b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f4f91906136d9565b90505f610f5c8683612df9565b90505f8103610f97576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e290505f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016110159190613417565b602060405180830381865afa158015611030573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061105491906136d9565b905061108333308a8573ffffffffffffffffffffffffffffffffffffffff16612e3c909392919063ffffffff16565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016110dd9190613417565b602060405180830381865afa1580156110f8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061111c91906136d9565b9050818161112a919061378e565b9650838710156111735783876040517fa25a9bfc00000000000000000000000000000000000000000000000000000000815260040161116a9291906137c1565b60405180910390fd5b61117d8888612e96565b8773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78b8a6040516111dc9291906137c1565b60405180910390a35050505050506111f2612f28565b92915050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b5f6112ce6b033b2e3c9fd0803ce8000000807f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c991906136d9565b612f31565b905090565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e2905090565b5f611303612c36565b61130c33612c5a565b5f8303611345576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113af573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113d391906136d9565b90506113dd612ca8565b91505f8214806113f557506113f28282612df9565b84115b1561142c576040517fa4875a4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818561143991906137e8565b90505f6002836114499190613856565b9050808211611484576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6b033b2e3c9fd0803ce800000060016b033b2e3c9fd0803ce800000083856114ac919061378e565b6114b69190613886565b6114c0919061378e565b6114ca9190613856565b93505f6114d78585612df9565b905086811461151f5786816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016115169291906137c1565b60405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e290505f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b815260040161159d9190613417565b602060405180830381865afa1580156115b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115dc91906136d9565b905061160b3330898573ffffffffffffffffffffffffffffffffffffffff16612e3c909392919063ffffffff16565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016116659190613417565b602060405180830381865afa158015611680573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116a491906136d9565b90505f82826116b3919061378e565b90508a81146116fb578a816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016116f29291906137c1565b60405180910390fd5b6117058a8c612e96565b8973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78b8e6040516117649291906137c1565b60405180910390a3505050505050505061177c612f28565b92915050565b60606001805461179190613731565b80601f01602080910402602001604051908101604052809291908181526020018280546117bd90613731565b80156118085780601f106117df57610100808354040283529160200191611808565b820191905f5260205f20905b8154815290600101906020018083116117eb57829003601f168201915b5050505050905090565b5f61181e338484612b1c565b6387a211a2600c52335f526020600c208054808411156118455763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050611896338484612b33565b6001905092915050565b5f8082036118b0575f905061194e565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561191a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061193e91906136d9565b905061194a8382612f5c565b9150505b919050565b5f61195c612c36565b61196533612c5a565b61196e83612c5a565b5f84036119a7576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a3591906136d9565b9050611a418582612df9565b91505f8203611a7c576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611abb57611aba833384612f7c565b5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611b159190613417565b602060405180830381865afa158015611b30573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b5491906136d9565b9050611b608484612fbd565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e29050611baf86888373ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611c099190613417565b602060405180830381865afa158015611c24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c4891906136d9565b90505f8184611c57919061378e565b9050858114611c9f5785816040517fa25a9bfc000000000000000000000000000000000000000000000000000000008152600401611c969291906137c1565b60405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8c8a604051611d159291906137c1565b60405180910390a45050505050611d2a612f28565b9392505050565b5f611d3a612c36565b7f0000000000000000000000005b15f94efc3a6e2c82d7db8efd8d5ba55da11feb73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dbf576040517f340f44d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611e2457505f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e5b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e6482612c5a565b7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036121a0575f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b8152600401611f119190613417565b602060405180830381865afa158015611f2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5091906136d9565b90505f611f5b610a88565b9050808211611f96576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8183611fa3919061378e565b90505f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561200f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061203391906136d9565b905061203f8282613096565b94505f850361207a576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120a586868973ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016120ff9190613417565b602060405180830381865afa15801561211a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061213e91906136d9565b90505f818661214d919061378e565b90508381146121955783816040517fa25a9bfc00000000000000000000000000000000000000000000000000000000815260040161218c9291906137c1565b60405180910390fd5b505050505050612211565b6121aa83306130e5565b90505f81036121e5576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61221082828573ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fd092d7fceb5ea5a962639fcc27a7bb315e7637e699e3b108cd570c38c75843008360405161226e9190613186565b60405180910390a361227e612f28565b92915050565b5f61228d612c36565b61229633612c5a565b61229f83612c5a565b5f84036122d8576040517f9811e0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461231757612316823386612f7c565b5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015612381573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123a591906136d9565b90506123b18582613096565b91505f82036123ec576040517f32d971dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b81526004016124469190613417565b602060405180830381865afa158015612461573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061248591906136d9565b90506124918487612fbd565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e290506124e086858373ffffffffffffffffffffffffffffffffffffffff1661304d9092919063ffffffff16565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16631da24f3e306040518263ffffffff1660e01b815260040161253a9190613417565b602060405180830381865afa158015612555573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061257991906136d9565b90505f8184612588919061378e565b90508881146125d05788816040517fa25a9bfc0000000000000000000000000000000000000000000000000000000081526004016125c79291906137c1565b60405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db898d6040516126469291906137c1565b60405180910390a4505050505061265b612f28565b9392505050565b5f8061266d83610cdb565b90505f810361267f575f91505061271e565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061270d91906136d9565b90506127198282612df9565b925050505b919050565b5f808203612733575f90506127d1565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa15801561279d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127c191906136d9565b90506127cd838261311b565b9150505b919050565b5f6127e082612b3c565b156127ed575f90506128e4565b5f6127f7836111f8565b90505f8103612809575f9150506128e4565b5f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff1663683dd1916040518163ffffffff1660e01b8152600401602060405180830381865afa158015612873573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061289791906136d9565b90506b033b2e3c9fd0803ce800000060026001836128b5919061378e565b6128bf9190613856565b82846128cb91906137e8565b6128d59190613886565b6128df9190613856565b925050505b919050565b5f6128f2612b38565b90505f801b810361290f57612905610843565b8051906020012090505b8442111561292457631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d5114612a2c5763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f612a8f82612b3c565b15612a9c575f9050612aa8565b612aa5826111f8565b90505b919050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b5f612ad582612723565b9050919050565b5f612af483836b033b2e3c9fd0803ce8000000612f31565b905092915050565b5f612b14836b033b2e3c9fd0803ce80000008461313b565b905092915050565b612b2583612c5a565b612b2e82612c5a565b505050565b505050565b5f90565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015612c2f57507f000000000000000000000000437e0551892c2c9b06d3ffd248fe60572e08cd1a73ffffffffffffffffffffffffffffffffffffffff166306e744447f0000000000000000000000005b15f94efc3a6e2c82d7db8efd8d5ba55da11feb846040518363ffffffff1660e01b8152600401612bef9291906138b9565b602060405180830381865afa158015612c0a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c2e919061390a565b5b9050919050565b63929eee145c8015612c4f57637fa8a9875f526004601cfd5b600163929eee145d50565b612c6381612b3c565b15612ca557806040517f2bbe9620000000000000000000000000000000000000000000000000000000008152600401612c9c9190613417565b60405180910390fd5b50565b5f807f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff16632ab4d0526040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d3791906136d9565b90505f7f000000000000000000000000c9499006a149c553d18171747ed19aa7c6dd19e273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612d939190613417565b602060405180830381865afa158015612dae573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612dd291906136d9565b9050818110612de5575f92505050612df6565b8082612df1919061378e565b925050505b90565b5f81600283612e089190613856565b6b033b2e3c9fd0803ce800000085612e2091906137e8565b612e2a9190613886565b612e349190613856565b905092915050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716612e8757637939f4245f526004601cfd5b5f606052806040525050505050565b612ea15f8383612b1c565b6805345cdf77eb68f44c5481810181811015612ec45763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050612f245f8383612b33565b5050565b5f63929eee145d565b5f825f190484118302158202612f4e5763ad251c275f526004601cfd5b818385020490509392505050565b5f612f7483836b033b2e3c9fd0803ce800000061313b565b905092915050565b81602052637f5e9f20600c52825f526034600c2080546001810115612fb65780831115612fb0576313be252b5f526004601cfd5b82810382555b5050505050565b612fc8825f83612b1c565b6387a211a2600c52815f526020600c20805480831115612fef5763f4d678b85f526004601cfd5b8281038255826805345cdf77eb68f44c54036805345cdf77eb68f44c55825f525f8460601b60601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa35050613049825f83612b33565b5050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f5114171661308d576390b8ec185f526004601cfd5b5f603452505050565b5f6b033b2e3c9fd0803ce800000060026b033b2e3c9fd0803ce80000006130bd9190613856565b83856130c991906137e8565b6130d39190613886565b6130dd9190613856565b905092915050565b5f6370a082315f528160205260205f6024601c865afa601f3d111661311157634963f6d55f526004601cfd5b5f51905092915050565b5f613133836b033b2e3c9fd0803ce800000084612f31565b905092915050565b5f825f1904841183021582026131585763ad251c275f526004601cfd5b8183850204828486020615150190509392505050565b5f819050919050565b6131808161316e565b82525050565b5f6020820190506131995f830184613177565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6131e18261319f565b6131eb81856131a9565b93506131fb8185602086016131b9565b613204816131c7565b840191505092915050565b5f6020820190508181035f83015261322781846131d7565b905092915050565b5f80fd5b61323c8161316e565b8114613246575f80fd5b50565b5f8135905061325781613233565b92915050565b5f602082840312156132725761327161322f565b5b5f61327f84828501613249565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6132b182613288565b9050919050565b6132c1816132a7565b81146132cb575f80fd5b50565b5f813590506132dc816132b8565b92915050565b5f80604083850312156132f8576132f761322f565b5b5f613305858286016132ce565b925050602061331685828601613249565b9150509250929050565b5f8115159050919050565b61333481613320565b82525050565b5f60208201905061334d5f83018461332b565b92915050565b5f805f6060848603121561336a5761336961322f565b5b5f613377868287016132ce565b9350506020613388868287016132ce565b925050604061339986828701613249565b9150509250925092565b5f60ff82169050919050565b6133b8816133a3565b82525050565b5f6020820190506133d15f8301846133af565b92915050565b5f819050919050565b6133e9816133d7565b82525050565b5f6020820190506134025f8301846133e0565b92915050565b613411816132a7565b82525050565b5f60208201905061342a5f830184613408565b92915050565b5f602082840312156134455761344461322f565b5b5f613452848285016132ce565b91505092915050565b5f819050919050565b5f61347e61347961347484613288565b61345b565b613288565b9050919050565b5f61348f82613464565b9050919050565b5f6134a082613485565b9050919050565b6134b081613496565b82525050565b5f6020820190506134c95f8301846134a7565b92915050565b5f6134d982613485565b9050919050565b6134e9816134cf565b82525050565b5f6020820190506135025f8301846134e0565b92915050565b5f806040838503121561351e5761351d61322f565b5b5f61352b85828601613249565b925050602061353c858286016132ce565b9150509250929050565b5f805f6060848603121561355d5761355c61322f565b5b5f61356a86828701613249565b935050602061357b868287016132ce565b925050604061358c868287016132ce565b9150509250925092565b5f80604083850312156135ac576135ab61322f565b5b5f6135b9858286016132ce565b92505060206135ca858286016132ce565b9150509250929050565b6135dd816133a3565b81146135e7575f80fd5b50565b5f813590506135f8816135d4565b92915050565b613607816133d7565b8114613611575f80fd5b50565b5f81359050613622816135fe565b92915050565b5f805f805f805f60e0888a0312156136435761364261322f565b5b5f6136508a828b016132ce565b97505060206136618a828b016132ce565b96505060406136728a828b01613249565b95505060606136838a828b01613249565b94505060806136948a828b016135ea565b93505060a06136a58a828b01613614565b92505060c06136b68a828b01613614565b91505092959891949750929550565b5f815190506136d381613233565b92915050565b5f602082840312156136ee576136ed61322f565b5b5f6136fb848285016136c5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061374857607f821691505b60208210810361375b5761375a613704565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6137988261316e565b91506137a38361316e565b92508282039050818111156137bb576137ba613761565b5b92915050565b5f6040820190506137d45f830185613177565b6137e16020830184613177565b9392505050565b5f6137f28261316e565b91506137fd8361316e565b925082820261380b8161316e565b9150828204841483151761382257613821613761565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6138608261316e565b915061386b8361316e565b92508261387b5761387a613829565b5b828204905092915050565b5f6138908261316e565b915061389b8361316e565b92508282019050808211156138b3576138b2613761565b5b92915050565b5f6040820190506138cc5f830185613408565b6138d96020830184613408565b9392505050565b6138e981613320565b81146138f3575f80fd5b50565b5f81519050613904816138e0565b92915050565b5f6020828403121561391f5761391e61322f565b5b5f61392c848285016138f6565b9150509291505056fea2646970667358221220919bf5abd0d10e8228021ec5a8f75fc2863c8d4bb8d6cd69ba235f743d141a8a64736f6c63430008190033","source_code":"// SPDX-License-Identifier: Apache-2.0 WITH LicenseRef-Commons-Clause-1.0\npragma solidity >=0.8.20;\n\nimport { ERC4626 } from 'solady/tokens/ERC4626.sol';\nimport { IERC20Metadata } from 'openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol';\nimport { IWildcatSanctionsSentinel } from '../interfaces/IWildcatSanctionsSentinel.sol';\nimport { ReentrancyGuard } from '../ReentrancyGuard.sol';\nimport { MathUtils, RAY } from '../libraries/MathUtils.sol';\nimport { LibERC20 } from '../libraries/LibERC20.sol';\n\ninterface IWildcatMarketToken is IERC20Metadata {\n  function scaleFactor() external view returns (uint256);\n\n  function scaledBalanceOf(address account) external view returns (uint256);\n\n  function borrower() external view returns (address);\n\n  function maxTotalSupply() external view returns (uint256);\n\n  function sentinel() external view returns (address);\n}\n\n/**\n * @title Wildcat4626Wrapper\n * @notice Wraps a debt token with an erc-4626 non-rebasing share token.\n *  Shares mirror the market's scaled balance.\n */\ncontract Wildcat4626Wrapper is ERC4626, ReentrancyGuard {\n  using MathUtils for uint256;\n  using LibERC20 for address;\n\n  error ZeroAddress();\n  error ZeroAssets();\n  error ZeroShares();\n  error CapExceeded();\n  error SharesMismatch(uint256 expected, uint256 actual);\n  error NotMarketOwner();\n  error SanctionedAccount(address account);\n\n  IWildcatMarketToken public immutable wrappedMarket;\n  address public immutable marketOwner;\n  IWildcatSanctionsSentinel public immutable sanctionsSentinel;\n\n  uint8 private immutable _decimals;\n  string private _name;\n  string private _symbol;\n\n  /**\n   * @param marketAddress the wildcat market (debt token) address to wrap\n   */\n  constructor(address marketAddress) {\n    if (marketAddress == address(0)) revert ZeroAddress();\n\n    wrappedMarket = IWildcatMarketToken(marketAddress);\n    address owner = wrappedMarket.borrower();\n    if (owner == address(0)) revert ZeroAddress();\n    address sentinel = wrappedMarket.sentinel();\n    if (sentinel == address(0)) revert ZeroAddress();\n    marketOwner = owner;\n    sanctionsSentinel = IWildcatSanctionsSentinel(sentinel);\n    _decimals = wrappedMarket.decimals();\n\n    string memory marketSymbol = IERC20Metadata(marketAddress).symbol();\n    _name = string.concat(marketSymbol, ' [4626 Vault Shares]');\n    _symbol = string.concat('v-', marketSymbol);\n  }\n\n  // -------------------------------------------------------------------------\n  // ERC20 Metadata\n  // -------------------------------------------------------------------------\n\n  function name() public view override returns (string memory) {\n    return _name;\n  }\n\n  function symbol() public view override returns (string memory) {\n    return _symbol;\n  }\n\n  function decimals() public view override returns (uint8) {\n    return _decimals;\n  }\n\n  // -------------------------------------------------------------------------\n  // ERC4626 Configuration Overrides\n  // -------------------------------------------------------------------------\n\n  /// @dev disabled virtual shares since we use the market's scale factor for conversions\n  function _useVirtualShares() internal pure override returns (bool) {\n    return false;\n  }\n\n  function _underlyingDecimals() internal view override returns (uint8) {\n    return _decimals;\n  }\n\n  // -------------------------------------------------------------------------\n  // Events\n  // -------------------------------------------------------------------------\n\n  event TokensSwept(address indexed token, address indexed to, uint256 amount);\n\n  // -------------------------------------------------------------------------\n  // ERC4626 View Interface\n  // -------------------------------------------------------------------------\n\n  /// @notice Address of the wrapped Wildcat market token.\n  function market() public view returns (address) {\n    return address(wrappedMarket);\n  }\n\n  /// @notice Alias for the wrapped market so integrators can treat it as the ERC-4626 asset.\n  function asset() public view override returns (address) {\n    return address(wrappedMarket);\n  }\n\n  /// @notice Total normalized market tokens the wrapper currently custodies.\n  function totalAssets() public view override returns (uint256) {\n    return wrappedMarket.balanceOf(address(this));\n  }\n\n  /// @notice Preview how many shares a deposit of `assets` would mint (rounded down per erc4626)\n  function convertToShares(uint256 assets) public view override returns (uint256) {\n    if (assets == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    return _convertToSharesDown(assets, scaleFactor);\n  }\n\n  /// @notice Preview how many assets burning `shares` yields (rounded down per ERC-4626)\n  function convertToAssets(uint256 shares) public view override returns (uint256) {\n    if (shares == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    return _convertToAssetsDown(shares, scaleFactor);\n  }\n\n  /// @notice Remaining normalized assets the wrapper can accept before hitting the market's maxTotalSupply\n  /// @dev Returns 0 for sanctioned receivers per erc4626 (deposit would revert)\n  function maxDeposit(address receiver) public view override returns (uint256) {\n    if (_isSanctioned(receiver)) return 0;\n    uint256 marketCap = wrappedMarket.maxTotalSupply();\n    uint256 held = totalAssets();\n    if (held >= marketCap) return 0;\n    return marketCap - held;\n  }\n\n  /// @notice Shares minted for depositing `assets`, rounded down per spec.\n  function previewDeposit(uint256 assets) public view override returns (uint256) {\n    return convertToShares(assets);\n  }\n\n  /// @notice Remaining shares that could be minted without violating the market's maxTotalSupply\n  /// @dev Returns 0 for sanctioned receivers per erc4626 (mint would revert)\n  function maxMint(address receiver) public view override returns (uint256) {\n    uint256 capAssets = maxDeposit(receiver);\n    if (capAssets == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    return _convertToSharesHalfUp(capAssets, scaleFactor);\n  }\n\n  /// @notice Assets required to mint `shares`, rounded up (ceiling) per ERC4626\n  function previewMint(uint256 shares) public view override returns (uint256) {\n    if (shares == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    return _convertToAssetsUp(shares, scaleFactor);\n  }\n\n  /// @notice Maximum assets `owner_` can pull via `withdraw`, using half-up rounding\n  /// @dev Returns 0 for sanctioned owners per erc 4626 (withdraw would revert)\n  function maxWithdraw(address owner_) public view override returns (uint256) {\n    if (_isSanctioned(owner_)) return 0;\n    uint256 shares = balanceOf(owner_);\n    if (shares == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    // Inverse of half-up rounding used by withdraw: largest assets that still round to <= shares.\n    return (shares * scaleFactor + (scaleFactor - 1) / 2) / RAY;\n  }\n\n  /// @notice Shares that would be burned to withdraw `assets`, rounded up (ceiling) per ERC-4626\n  function previewWithdraw(uint256 assets) public view override returns (uint256) {\n    if (assets == 0) return 0;\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    return _convertToSharesUp(assets, scaleFactor);\n  }\n\n  /// @notice All shares `owner_` currently holds.\n  /// @dev Returns 0 for sanctioned owners per ERC-4626 (redeem would revert)\n  function maxRedeem(address owner_) public view override returns (uint256) {\n    if (_isSanctioned(owner_)) return 0;\n    return balanceOf(owner_);\n  }\n\n  /// @notice Assets returned when redeeming `shares`, rounded down per spec\n  function previewRedeem(uint256 shares) public view override returns (uint256) {\n    return convertToAssets(shares);\n  }\n\n  /// @notice Returns the current exchange rate of assets per share, scaled by RAY (1e27)\n  /// @dev This is equivalent to the market's scale factor. Useful for integrators to see\n  ///      the exchange rate without needing to pick a sample share size.\n  function assetsPerShareRay() external view returns (uint256) {\n    return wrappedMarket.scaleFactor();\n  }\n\n  /// @notice Returns the current exchange rate of shares per asset, scaled by RAY (1e27).\n  /// @dev This is the inverse of the scale factor to see\n  ///      how many shares a given asset amount would yield.\n  function sharesPerAssetRay() external view returns (uint256) {\n    return MathUtils.mulDiv(RAY, RAY, wrappedMarket.scaleFactor());\n  }\n\n  // -------------------------------------------------------------------------\n  // Mutating Interface\n  // -------------------------------------------------------------------------\n\n  /// @notice Pull `assets` from the caller and mint the resulting shares to `receiver`.\n  function deposit(\n    uint256 assets,\n    address receiver\n  ) public override nonReentrant returns (uint256 shares) {\n    _checkNotSanctioned(msg.sender);\n    if (assets == 0) revert ZeroAssets();\n\n    uint256 limit = _remainingCapacityAssets();\n    if (assets > limit) revert CapExceeded();\n\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    uint256 expectedShares = _convertToSharesHalfUp(assets, scaleFactor);\n    if (expectedShares == 0) revert ZeroShares();\n\n    address assetAddress = address(wrappedMarket);\n    uint256 scaledBefore = wrappedMarket.scaledBalanceOf(address(this));\n    assetAddress.safeTransferFrom(msg.sender, address(this), assets);\n    uint256 scaledAfter = wrappedMarket.scaledBalanceOf(address(this));\n\n    shares = scaledAfter - scaledBefore;\n    if (shares < expectedShares) revert SharesMismatch(expectedShares, shares);\n\n    _mint(receiver, shares);\n    emit Deposit(msg.sender, receiver, assets, shares);\n    return shares;\n  }\n\n  /// @notice Mint exactly `shares` to `receiver`, pulling the minimum required assets from caller\n  function mint(\n    uint256 shares,\n    address receiver\n  ) public override nonReentrant returns (uint256 assets) {\n    _checkNotSanctioned(msg.sender);\n    if (shares == 0) revert ZeroShares();\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    // Reuse the `assets` return variable to hold remaining capacity for the cap check.\n    assets = _remainingCapacityAssets();\n    if (assets == 0 || shares > _convertToSharesHalfUp(assets, scaleFactor)) {\n      revert CapExceeded();\n    }\n  \n    //  minimum assets for half-up rounding to yield `shares`\n    uint256 numerator = shares * scaleFactor;\n    uint256 halfSf = scaleFactor / 2;\n    if (numerator <= halfSf) revert ZeroAssets();\n    assets = (numerator - halfSf + RAY - 1) / RAY; // ceiling\n  \n    // Verify the formula produced the correct result\n    uint256 expectedShares = _convertToSharesHalfUp(assets, scaleFactor);\n    if (expectedShares != shares) revert SharesMismatch(shares, expectedShares);\n  \n    address assetAddress = address(wrappedMarket);\n    uint256 scaledBefore = wrappedMarket.scaledBalanceOf(address(this));\n    assetAddress.safeTransferFrom(msg.sender, address(this), assets);\n    uint256 scaledAfter = wrappedMarket.scaledBalanceOf(address(this));\n  \n    uint256 mintedShares = scaledAfter - scaledBefore;\n    if (mintedShares != shares) revert SharesMismatch(shares, mintedShares);\n  \n    _mint(receiver, shares);\n    emit Deposit(msg.sender, receiver, assets, shares);\n  }\n\n  /// @notice Withdraw `assets` to `receiver`, burning shares from `owner_` using half-up rounding\n  function withdraw(\n    uint256 assets,\n    address receiver,\n    address owner_\n  ) public override nonReentrant returns (uint256 shares) {\n    _checkNotSanctioned(msg.sender);\n    _checkNotSanctioned(receiver);\n    if (assets == 0) revert ZeroAssets();\n\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    shares = _convertToSharesHalfUp(assets, scaleFactor);\n    if (shares == 0) revert ZeroShares();\n\n    if (msg.sender != owner_) {\n      _spendAllowance(owner_, msg.sender, shares);\n    }\n\n    uint256 scaledBefore = wrappedMarket.scaledBalanceOf(address(this));\n\n    _burn(owner_, shares);\n    address assetAddress = address(wrappedMarket);\n    assetAddress.safeTransfer(receiver, assets);\n    uint256 scaledAfter = wrappedMarket.scaledBalanceOf(address(this));\n\n    uint256 burnedShares = scaledBefore - scaledAfter;\n    if (burnedShares != shares) revert SharesMismatch(shares, burnedShares);\n    emit Withdraw(msg.sender, receiver, owner_, assets, shares);\n  }\n\n  /// @notice Redeem exactly `shares` from `owner_` and send the corresponding assets to `receiver` half-up rounding\n  /// @dev Uses half-up rounding for assets to match the market behavior\n  function redeem(\n    uint256 shares,\n    address receiver,\n    address owner_\n  ) public override nonReentrant returns (uint256 assets) {\n    _checkNotSanctioned(msg.sender);\n    _checkNotSanctioned(receiver);\n    if (shares == 0) revert ZeroShares();\n\n    if (msg.sender != owner_) {\n      _spendAllowance(owner_, msg.sender, shares);\n    }\n\n    uint256 scaleFactor = wrappedMarket.scaleFactor();\n    assets = _convertToAssetsHalfUp(shares, scaleFactor);\n    if (assets == 0) revert ZeroAssets();\n\n    uint256 scaledBefore = wrappedMarket.scaledBalanceOf(address(this));\n\n    _burn(owner_, shares);\n    address assetAddress = address(wrappedMarket);\n    assetAddress.safeTransfer(receiver, assets);\n    uint256 scaledAfter = wrappedMarket.scaledBalanceOf(address(this));\n\n    uint256 burnedShares = scaledBefore - scaledAfter;\n    if (burnedShares != shares) revert SharesMismatch(shares, burnedShares);\n\n    emit Withdraw(msg.sender, receiver, owner_, assets, shares);\n  }\n\n  /// @notice Sweep arbitrary ERC20 balances and any stranded wrapped market tokens.\n  /// @dev For wrapped market sweeps, only the surplus over total supply is sweepable.\n  function sweep(address token, address to) external nonReentrant returns (uint256 amount) {\n    if (msg.sender != marketOwner) revert NotMarketOwner();\n    if (token == address(0) || to == address(0)) revert ZeroAddress();\n    _checkNotSanctioned(to);\n\n    if (token == address(wrappedMarket)) {\n      uint256 scaledBefore = wrappedMarket.scaledBalanceOf(address(this));\n      uint256 expectedScaled = totalSupply();\n      if (scaledBefore <= expectedScaled) revert ZeroAssets();\n\n      uint256 strandedScaled = scaledBefore - expectedScaled;\n      uint256 scaleFactor = wrappedMarket.scaleFactor();\n      amount = _convertToAssetsHalfUp(strandedScaled, scaleFactor);\n      if (amount == 0) revert ZeroAssets();\n\n      token.safeTransfer(to, amount);\n\n      uint256 scaledAfter = wrappedMarket.scaledBalanceOf(address(this));\n      uint256 sweptScaled = scaledBefore - scaledAfter;\n      if (sweptScaled != strandedScaled) revert SharesMismatch(strandedScaled, sweptScaled);\n    } else {\n      amount = LibERC20.balanceOf(token, address(this));\n      if (amount == 0) revert ZeroAssets();\n\n      token.safeTransfer(to, amount);\n    }\n\n    emit TokensSwept(token, to, amount);\n  }\n\n  // -------------------------------------------------------------------------\n  // Internal helpers\n  // -------------------------------------------------------------------------\n\n  /// @dev Remaining normalized assets before reaching the market's maxTotalSupply,\n  ///      without sanctions checks (execution paths already enforce them).\n  function _remainingCapacityAssets() internal view returns (uint256) {\n    uint256 marketCap = wrappedMarket.maxTotalSupply();\n    uint256 held = wrappedMarket.balanceOf(address(this));\n    if (held >= marketCap) return 0;\n    return marketCap - held;\n  }\n\n  /// @dev floor rounding for spec-compliant previews.\n  function _convertToSharesDown(\n    uint256 assets,\n    uint256 scaleFactor\n  ) internal pure returns (uint256) {\n    return MathUtils.mulDiv(assets, RAY, scaleFactor);\n  }\n\n  /// @dev half-up rounding to match the market's rayDiv behavior in transfers\n  function _convertToSharesHalfUp(\n    uint256 assets,\n    uint256 scaleFactor\n  ) internal pure returns (uint256) {\n    return (assets * RAY + scaleFactor / 2) / scaleFactor;\n  }\n\n  /// @dev floor rounding for spec-compliant previews.\n  function _convertToAssetsDown(\n    uint256 shares,\n    uint256 scaleFactor\n  ) internal pure returns (uint256) {\n    return MathUtils.mulDiv(shares, scaleFactor, RAY);\n  }\n\n  /// @dev half-up rounding to match the market's rayMul behavior in transfers\n  function _convertToAssetsHalfUp(\n    uint256 shares,\n    uint256 scaleFactor\n  ) internal pure returns (uint256) {\n    return (shares * scaleFactor + RAY / 2) / RAY;\n  }\n\n  /// @dev ceiling rounding for ERC-4626 compliant previews (previewMint).\n  function _convertToAssetsUp(uint256 shares, uint256 scaleFactor) internal pure returns (uint256) {\n    return MathUtils.mulDivUp(shares, scaleFactor, RAY);\n  }\n\n  /// @dev ceiling rounding for ERC-4626 compliant previews (previewWithdraw).\n  function _convertToSharesUp(uint256 assets, uint256 scaleFactor) internal pure returns (uint256) {\n    return MathUtils.mulDivUp(assets, RAY, scaleFactor);\n  }\n\n  function _isSanctioned(address account) internal view returns (bool) {\n    return account != address(0) && sanctionsSentinel.isSanctioned(marketOwner, account);\n  }\n\n  function _checkNotSanctioned(address account) internal view {\n    if (_isSanctioned(account)) {\n      revert SanctionedAccount(account);\n    }\n  }\n\n  function _beforeTokenTransfer(address from, address to, uint256 amount) internal override {\n    _checkNotSanctioned(from);\n    _checkNotSanctioned(to);\n    if (amount == 0) {\n      return;\n    }\n  }\n}\n","creation_status":"success","file_path":"src/vault/Wildcat4626Wrapper.sol"}