diff --git a/deploy/deploy-NativeOrderFactory.js b/deploy/deploy-NativeOrderFactory.js new file mode 100644 index 00000000..a9376157 --- /dev/null +++ b/deploy/deploy-NativeOrderFactory.js @@ -0,0 +1,30 @@ +const hre = require('hardhat'); +const { getChainId, network } = hre; +const { deployAndGetContract } = require('@1inch/solidity-utils'); + +const wethByNetwork = { + mainnet: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', +}; + +const ROUTER_V6_ADDR = '0x111111125421ca6dc452d289314280a0f8842a65'; +const ACCESS_TOKEN_ADDR = '0xAcce5500000f71A32B5E5514D1577E14b7aacC4a'; + +module.exports = async ({ getNamedAccounts, deployments }) => { + console.log('running deploy script'); + console.log('network id ', await getChainId()); + + const { deployer } = await getNamedAccounts(); + + const nativeOrderFactory = await deployAndGetContract({ + contractName: 'NativeOrderFactory', + constructorArgs: [wethByNetwork[network.name], ROUTER_V6_ADDR, ACCESS_TOKEN_ADDR, 60, '1inch Aggregation Router', '6'], + deployments, + deployer, + skipVerify: true, + }); + console.log('NativeOrderFactory deployed to:', await nativeOrderFactory.getAddress()); + + console.log('NativeOrderImpl deployed to:', await nativeOrderFactory.IMPLEMENTATION()); +}; + +module.exports.skip = async () => true; diff --git a/deployments/mainnet/NativeOrderFactory.json b/deployments/mainnet/NativeOrderFactory.json new file mode 100644 index 00000000..3b0e32ee --- /dev/null +++ b/deployments/mainnet/NativeOrderFactory.json @@ -0,0 +1,417 @@ +{ + "address": "0x54aEab62304D1d135291054726786949A7e73E8F", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IWETH", + "name": "weth", + "type": "address" + }, + { + "internalType": "address", + "name": "limitOrderProtocol", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "accessToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cancellationDelay", + "type": "uint256" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FailedDeployment", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expected", + "type": "address" + }, + { + "internalType": "address", + "name": "actual", + "type": "address" + } + ], + "name": "OrderMakerShouldBeMsgSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "OrderMakingAmountShouldBeEqualToMsgValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "OrderReceiverShouldBeSetCorrectly", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "clone", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "NativeOrderCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "IMPLEMENTATION", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "Address", + "name": "maker", + "type": "uint256" + }, + { + "internalType": "Address", + "name": "receiver", + "type": "uint256" + }, + { + "internalType": "Address", + "name": "makerAsset", + "type": "uint256" + }, + { + "internalType": "Address", + "name": "takerAsset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "makingAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takingAmount", + "type": "uint256" + }, + { + "internalType": "MakerTraits", + "name": "makerTraits", + "type": "uint256" + } + ], + "internalType": "struct IOrderMixin.Order", + "name": "makerOrder", + "type": "tuple" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "clone", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "rescueFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x52ea4b9779951a36c2ccf7fd1b1521751e74bf7b2c90c76feec397d305ab8949", + "receipt": { + "to": null, + "from": "0xaA2FAbBC1463D6F74b5EF7AA9501bE814Bb85773", + "contractAddress": "0x54aEab62304D1d135291054726786949A7e73E8F", + "transactionIndex": 18, + "gasUsed": "1722493", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000020000000000000000000800000000000000000004000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000800000000000420000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbbd635552803fe1e904bd90eca720a489b1beee0eb84fd90f5561178286041d2", + "transactionHash": "0x52ea4b9779951a36c2ccf7fd1b1521751e74bf7b2c90c76feec397d305ab8949", + "logs": [ + { + "transactionIndex": 18, + "blockNumber": 23318563, + "transactionHash": "0x52ea4b9779951a36c2ccf7fd1b1521751e74bf7b2c90c76feec397d305ab8949", + "address": "0x54aEab62304D1d135291054726786949A7e73E8F", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000aa2fabbc1463d6f74b5ef7aa9501be814bb85773" + ], + "data": "0x", + "logIndex": 394, + "blockHash": "0xbbd635552803fe1e904bd90eca720a489b1beee0eb84fd90f5561178286041d2" + } + ], + "blockNumber": 23318563, + "cumulativeGasUsed": "13244451", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "0x111111125421cA6dc452d289314280a0f8842A65", + "0xAccE550000863572B867E661647CD7D97b72C507", + 60, + "1inch Aggregation Router", + "6" + ], + "numDeployments": 1, + "solcInputHash": "dd6975d42c48d77d4c411efbc6149738", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"weth\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"limitOrderProtocol\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"accessToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cancellationDelay\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedDeployment\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expected\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"OrderMakerShouldBeMsgSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"OrderMakingAmountShouldBeEqualToMsgValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"OrderReceiverShouldBeSetCorrectly\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SafeTransferFailed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"clone\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"NativeOrderCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"Address\",\"name\":\"maker\",\"type\":\"uint256\"},{\"internalType\":\"Address\",\"name\":\"receiver\",\"type\":\"uint256\"},{\"internalType\":\"Address\",\"name\":\"makerAsset\",\"type\":\"uint256\"},{\"internalType\":\"Address\",\"name\":\"takerAsset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makingAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takingAmount\",\"type\":\"uint256\"},{\"internalType\":\"MakerTraits\",\"name\":\"makerTraits\",\"type\":\"uint256\"}],\"internalType\":\"struct IOrderMixin.Order\",\"name\":\"makerOrder\",\"type\":\"tuple\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"clone\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"rescueFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"FailedDeployment()\":[{\"details\":\"The deployment failed.\"}],\"InsufficientBalance(uint256,uint256)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/extensions/NativeOrderFactory.sol\":\"NativeOrderFactory\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@1inch/solidity-utils/contracts/interfaces/IDaiLikePermit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title IDaiLikePermit\\n * @dev Interface for Dai-like permit function allowing token spending via signatures.\\n */\\ninterface IDaiLikePermit {\\n /**\\n * @notice Approves spending of tokens via off-chain signatures.\\n * @param holder Token holder's address.\\n * @param spender Spender's address.\\n * @param nonce Current nonce of the holder.\\n * @param expiry Time when the permit expires.\\n * @param allowed True to allow, false to disallow spending.\\n * @param v, r, s Signature components.\\n */\\n function permit(\\n address holder,\\n address spender,\\n uint256 nonce,\\n uint256 expiry,\\n bool allowed,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0xf8636c1c4631641c7b40ac65cd69e6ae04a99cf3358426c642dec02c6c774c82\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/interfaces/IERC7597Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title IERC7597Permit\\n * @dev A new extension for ERC-2612 permit, which has already been added to USDC v2.2.\\n */\\ninterface IERC7597Permit {\\n /**\\n * @notice Update allowance with a signed permit.\\n * @dev Signature bytes can be used for both EOA wallets and contract wallets.\\n * @param owner Token owner's address (Authorizer).\\n * @param spender Spender's address.\\n * @param value Amount of allowance.\\n * @param deadline The time at which the signature expires (unixtime).\\n * @param signature Unstructured bytes signature signed by an EOA wallet or a contract wallet.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n bytes memory signature\\n ) external;\\n}\\n\",\"keccak256\":\"0xaf148ecd4db0f44989a7417f6945bcfd18273c5096bc2b364e314e42c85c78cd\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/interfaces/IPermit2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title IPermit2\\n * @dev Interface for a flexible permit system that extends ERC20 tokens to support permits in tokens lacking native permit functionality.\\n */\\ninterface IPermit2 {\\n /**\\n * @dev Struct for holding permit details.\\n * @param token ERC20 token address for which the permit is issued.\\n * @param amount The maximum amount allowed to spend.\\n * @param expiration Timestamp until which the permit is valid.\\n * @param nonce An incrementing value for each signature, unique per owner, token, and spender.\\n */\\n struct PermitDetails {\\n address token;\\n uint160 amount;\\n uint48 expiration;\\n uint48 nonce;\\n }\\n\\n /**\\n * @dev Struct for a single token allowance permit.\\n * @param details Permit details including token, amount, expiration, and nonce.\\n * @param spender Address authorized to spend the tokens.\\n * @param sigDeadline Deadline for the permit signature, ensuring timeliness of the permit.\\n */\\n struct PermitSingle {\\n PermitDetails details;\\n address spender;\\n uint256 sigDeadline;\\n }\\n\\n /**\\n * @dev Struct for packed allowance data to optimize storage.\\n * @param amount Amount allowed.\\n * @param expiration Permission expiry timestamp.\\n * @param nonce Unique incrementing value for tracking allowances.\\n */\\n struct PackedAllowance {\\n uint160 amount;\\n uint48 expiration;\\n uint48 nonce;\\n }\\n\\n /**\\n * @notice Executes a token transfer from one address to another.\\n * @param user The token owner's address.\\n * @param spender The address authorized to spend the tokens.\\n * @param amount The amount of tokens to transfer.\\n * @param token The address of the token being transferred.\\n */\\n function transferFrom(address user, address spender, uint160 amount, address token) external;\\n\\n /**\\n * @notice Issues a permit for spending tokens via a signed authorization.\\n * @param owner The token owner's address.\\n * @param permitSingle Struct containing the permit details.\\n * @param signature The signature proving the owner authorized the permit.\\n */\\n function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external;\\n\\n /**\\n * @notice Retrieves the allowance details between a token owner and spender.\\n * @param user The token owner's address.\\n * @param token The token address.\\n * @param spender The spender's address.\\n * @return The packed allowance details.\\n */\\n function allowance(address user, address token, address spender) external view returns (PackedAllowance memory);\\n\\n /**\\n * @notice Approves the spender to use up to amount of the specified token up until the expiration\\n * @param token The token to approve\\n * @param spender The spender address to approve\\n * @param amount The approved amount of the token\\n * @param expiration The timestamp at which the approval is no longer valid\\n * @dev The packed allowance also holds a nonce, which will stay unchanged in approve\\n * @dev Setting amount to type(uint160).max sets an unlimited approval\\n */\\n function approve(address token, address spender, uint160 amount, uint48 expiration) external;\\n}\\n\",\"keccak256\":\"0x2ac37c62bb4a4941c1d353df6ac08750542c540234aa24409ac67373651a478a\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @title IWETH\\n * @dev Interface for wrapper as WETH-like token.\\n */\\ninterface IWETH is IERC20 {\\n /**\\n * @notice Emitted when Ether is deposited to get wrapper tokens.\\n */\\n event Deposit(address indexed dst, uint256 wad);\\n\\n /**\\n * @notice Emitted when wrapper tokens is withdrawn as Ether.\\n */\\n event Withdrawal(address indexed src, uint256 wad);\\n\\n /**\\n * @notice Deposit Ether to get wrapper tokens.\\n */\\n function deposit() external payable;\\n\\n /**\\n * @notice Withdraw wrapped tokens as Ether.\\n * @param amount Amount of wrapped tokens to withdraw.\\n */\\n function withdraw(uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x32989b79850e8a1ac6aab74878de2883f9537656ca06910dc0ae76833cc446e2\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/libraries/AddressLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ntype Address is uint256;\\n\\n/**\\n* @notice AddressLib\\n* @notice Library for working with addresses encoded as uint256 values, which can include flags in the highest bits.\\n*/\\nlibrary AddressLib {\\n uint256 private constant _LOW_160_BIT_MASK = (1 << 160) - 1;\\n\\n /**\\n * @notice Returns the address representation of a uint256.\\n * @param a The uint256 value to convert to an address.\\n * @return The address representation of the provided uint256 value.\\n */\\n function get(Address a) internal pure returns (address) {\\n return address(uint160(Address.unwrap(a) & _LOW_160_BIT_MASK));\\n }\\n\\n /**\\n * @notice Checks if a given flag is set for the provided address.\\n * @param a The address to check for the flag.\\n * @param flag The flag to check for in the provided address.\\n * @return True if the provided flag is set in the address, false otherwise.\\n */\\n function getFlag(Address a, uint256 flag) internal pure returns (bool) {\\n return (Address.unwrap(a) & flag) != 0;\\n }\\n\\n /**\\n * @notice Returns a uint32 value stored at a specific bit offset in the provided address.\\n * @param a The address containing the uint32 value.\\n * @param offset The bit offset at which the uint32 value is stored.\\n * @return The uint32 value stored in the address at the specified bit offset.\\n */\\n function getUint32(Address a, uint256 offset) internal pure returns (uint32) {\\n return uint32(Address.unwrap(a) >> offset);\\n }\\n\\n /**\\n * @notice Returns a uint64 value stored at a specific bit offset in the provided address.\\n * @param a The address containing the uint64 value.\\n * @param offset The bit offset at which the uint64 value is stored.\\n * @return The uint64 value stored in the address at the specified bit offset.\\n */\\n function getUint64(Address a, uint256 offset) internal pure returns (uint64) {\\n return uint64(Address.unwrap(a) >> offset);\\n }\\n}\\n\",\"keccak256\":\"0xe860b410ed5371b9732daab80982eef0a42ae48474716a89725ca744e27b7d75\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/libraries/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @title ECDSA signature operations\\n * @notice Provides functions for recovering addresses from signatures and verifying signatures, including support for EIP-2098 compact signatures.\\n */\\nlibrary ECDSA {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n uint256 private constant _S_BOUNDARY = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0 + 1;\\n uint256 private constant _COMPACT_S_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\\n uint256 private constant _COMPACT_V_SHIFT = 255;\\n\\n /**\\n * @notice Recovers the signer's address from the signature.\\n * @dev Recovers the address that has signed a hash with `(v, r, s)` signature.\\n * @param hash The keccak256 hash of the data signed.\\n * @param v The recovery byte of the signature.\\n * @param r The first 32 bytes of the signature.\\n * @param s The second 32 bytes of the signature.\\n * @return signer The address of the signer.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal view returns (address signer) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n if lt(s, _S_BOUNDARY) {\\n let ptr := mload(0x40)\\n\\n mstore(ptr, hash)\\n mstore(add(ptr, 0x20), v)\\n mstore(add(ptr, 0x40), r)\\n mstore(add(ptr, 0x60), s)\\n mstore(0, 0)\\n pop(staticcall(gas(), 0x1, ptr, 0x80, 0, 0x20))\\n signer := mload(0)\\n }\\n }\\n }\\n\\n /**\\n * @notice Recovers the signer's address from the signature using `r` and `vs` components.\\n * @dev Recovers the address that has signed a hash with `r` and `vs`, where `vs` combines `v` and `s`.\\n * @param hash The keccak256 hash of the data signed.\\n * @param r The first 32 bytes of the signature.\\n * @param vs The combined `v` and `s` values of the signature.\\n * @return signer The address of the signer.\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal view returns (address signer) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let s := and(vs, _COMPACT_S_MASK)\\n if lt(s, _S_BOUNDARY) {\\n let ptr := mload(0x40)\\n\\n mstore(ptr, hash)\\n mstore(add(ptr, 0x20), add(27, shr(_COMPACT_V_SHIFT, vs)))\\n mstore(add(ptr, 0x40), r)\\n mstore(add(ptr, 0x60), s)\\n mstore(0, 0)\\n pop(staticcall(gas(), 0x1, ptr, 0x80, 0, 0x20))\\n signer := mload(0)\\n }\\n }\\n }\\n\\n /**\\n * @notice Recovers the signer's address from a hash and a signature.\\n * @param hash The keccak256 hash of the signed data.\\n * @param signature The full signature from which the signer will be recovered.\\n * @return signer The address of the signer.\\n */\\n /// @dev WARNING!!!\\n /// There is a known signature malleability issue with two representations of signatures!\\n /// Even though this function is able to verify both standard 65-byte and compact 64-byte EIP-2098 signatures\\n /// one should never use raw signatures for any kind of invalidation logic in their code.\\n /// As the standard and compact representations are interchangeable any invalidation logic that relies on\\n /// signature uniqueness will get rekt.\\n /// More info: https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-4h98-2769-gh6h\\n function recover(bytes32 hash, bytes calldata signature) internal view returns (address signer) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n // memory[ptr:ptr+0x80] = (hash, v, r, s)\\n switch signature.length\\n case 65 {\\n // memory[ptr+0x20:ptr+0x80] = (v, r, s)\\n mstore(add(ptr, 0x20), byte(0, calldataload(add(signature.offset, 0x40))))\\n calldatacopy(add(ptr, 0x40), signature.offset, 0x40)\\n }\\n case 64 {\\n // memory[ptr+0x20:ptr+0x80] = (v, r, s)\\n let vs := calldataload(add(signature.offset, 0x20))\\n mstore(add(ptr, 0x20), add(27, shr(_COMPACT_V_SHIFT, vs)))\\n calldatacopy(add(ptr, 0x40), signature.offset, 0x20)\\n mstore(add(ptr, 0x60), and(vs, _COMPACT_S_MASK))\\n }\\n default {\\n ptr := 0\\n }\\n\\n if ptr {\\n if lt(mload(add(ptr, 0x60)), _S_BOUNDARY) {\\n // memory[ptr:ptr+0x20] = (hash)\\n mstore(ptr, hash)\\n\\n mstore(0, 0)\\n pop(staticcall(gas(), 0x1, ptr, 0x80, 0, 0x20))\\n signer := mload(0)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @notice Verifies the signature for a hash, either by recovering the signer or using EIP-1271's `isValidSignature` function.\\n * @dev Attempts to recover the signer's address from the signature; if the address is non-zero, checks if it's valid according to EIP-1271.\\n * @param signer The address to validate the signature against.\\n * @param hash The hash of the signed data.\\n * @param signature The signature to verify.\\n * @return success True if the signature is verified, false otherwise.\\n */\\n function recoverOrIsValidSignature(\\n address signer,\\n bytes32 hash,\\n bytes calldata signature\\n ) internal view returns (bool success) {\\n if (signer == address(0)) return false;\\n if ((signature.length == 64 || signature.length == 65) && recover(hash, signature) == signer) {\\n return true;\\n }\\n return isValidSignature(signer, hash, signature);\\n }\\n\\n /**\\n * @notice Verifies the signature for a hash, either by recovering the signer or using EIP-1271's `isValidSignature` function.\\n * @dev Attempts to recover the signer's address from the signature; if the address is non-zero, checks if it's valid according to EIP-1271.\\n * @param signer The address to validate the signature against.\\n * @param hash The hash of the signed data.\\n * @param v The recovery byte of the signature.\\n * @param r The first 32 bytes of the signature.\\n * @param s The second 32 bytes of the signature.\\n * @return success True if the signature is verified, false otherwise.\\n */\\n function recoverOrIsValidSignature(\\n address signer,\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal view returns (bool success) {\\n if (signer == address(0)) return false;\\n if (recover(hash, v, r, s) == signer) {\\n return true;\\n }\\n return isValidSignature(signer, hash, v, r, s);\\n }\\n\\n /**\\n * @notice Verifies the signature for a hash, either by recovering the signer or using EIP-1271's `isValidSignature` function.\\n * @dev Attempts to recover the signer's address from the signature; if the address is non-zero, checks if it's valid according to EIP-1271.\\n * @param signer The address to validate the signature against.\\n * @param hash The hash of the signed data.\\n * @param r The first 32 bytes of the signature.\\n * @param vs The combined `v` and `s` values of the signature.\\n * @return success True if the signature is verified, false otherwise.\\n */\\n function recoverOrIsValidSignature(\\n address signer,\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal view returns (bool success) {\\n if (signer == address(0)) return false;\\n if (recover(hash, r, vs) == signer) {\\n return true;\\n }\\n return isValidSignature(signer, hash, r, vs);\\n }\\n\\n /**\\n * @notice Verifies the signature for a given hash, attempting to recover the signer's address or validates it using EIP-1271 for 65-byte signatures.\\n * @dev Attempts to recover the signer's address from the signature. If the address is a contract, checks if the signature is valid according to EIP-1271.\\n * @param signer The expected signer's address.\\n * @param hash The keccak256 hash of the signed data.\\n * @param r The first 32 bytes of the signature.\\n * @param vs The last 32 bytes of the signature, with the last byte being the recovery id.\\n * @return success True if the signature is valid, false otherwise.\\n */\\n function recoverOrIsValidSignature65(\\n address signer,\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal view returns (bool success) {\\n if (signer == address(0)) return false;\\n if (recover(hash, r, vs) == signer) {\\n return true;\\n }\\n return isValidSignature65(signer, hash, r, vs);\\n }\\n\\n /**\\n * @notice Validates a signature for a hash using EIP-1271, if `signer` is a contract.\\n * @dev Makes a static call to `signer` with `isValidSignature` function selector from EIP-1271.\\n * @param signer The address of the signer to validate against, which could be an EOA or a contract.\\n * @param hash The hash of the signed data.\\n * @param signature The signature to validate.\\n * @return success True if the signature is valid according to EIP-1271, false otherwise.\\n */\\n function isValidSignature(\\n address signer,\\n bytes32 hash,\\n bytes calldata signature\\n ) internal view returns (bool success) {\\n // (bool success, bytes memory data) = signer.staticcall(abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature));\\n // return success && data.length == 32 && abi.decode(data, (bytes4)) == IERC1271.isValidSignature.selector;\\n bytes4 selector = IERC1271.isValidSignature.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n mstore(ptr, selector)\\n mstore(add(ptr, 0x04), hash)\\n mstore(add(ptr, 0x24), 0x40)\\n mstore(add(ptr, 0x44), signature.length)\\n calldatacopy(add(ptr, 0x64), signature.offset, signature.length)\\n if staticcall(gas(), signer, ptr, add(0x64, signature.length), 0, 0x20) {\\n success := and(eq(selector, mload(0)), eq(returndatasize(), 0x20))\\n }\\n }\\n }\\n\\n /**\\n * @notice Validates a signature for a hash using EIP-1271, if `signer` is a contract.\\n * @dev Makes a static call to `signer` with `isValidSignature` function selector from EIP-1271.\\n * @param signer The address of the signer to validate against, which could be an EOA or a contract.\\n * @param hash The hash of the signed data.\\n * @param v The recovery byte of the signature.\\n * @param r The first 32 bytes of the signature.\\n * @param s The second 32 bytes of the signature.\\n * @return success True if the signature is valid according to EIP-1271, false otherwise.\\n */\\n function isValidSignature(\\n address signer,\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal view returns (bool success) {\\n bytes4 selector = IERC1271.isValidSignature.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n mstore(ptr, selector)\\n mstore(add(ptr, 0x04), hash)\\n mstore(add(ptr, 0x24), 0x40)\\n mstore(add(ptr, 0x44), 65)\\n mstore(add(ptr, 0x64), r)\\n mstore(add(ptr, 0x84), s)\\n mstore8(add(ptr, 0xa4), v)\\n if staticcall(gas(), signer, ptr, 0xa5, 0, 0x20) {\\n success := and(eq(selector, mload(0)), eq(returndatasize(), 0x20))\\n }\\n }\\n }\\n\\n /**\\n * @notice Validates a signature for a hash using EIP-1271, if `signer` is a contract.\\n * @dev Makes a static call to `signer` with `isValidSignature` function selector from EIP-1271.\\n * @param signer The address of the signer to validate against, which could be an EOA or a contract.\\n * @param hash The hash of the signed data.\\n * @param r The first 32 bytes of the signature.\\n * @param vs The last 32 bytes of the signature, with the last byte being the recovery id.\\n * @return success True if the signature is valid according to EIP-1271, false otherwise.\\n */\\n function isValidSignature(\\n address signer,\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal view returns (bool success) {\\n // (bool success, bytes memory data) = signer.staticcall(abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, abi.encodePacked(r, vs)));\\n // return success && data.length == 32 && abi.decode(data, (bytes4)) == IERC1271.isValidSignature.selector;\\n bytes4 selector = IERC1271.isValidSignature.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n mstore(ptr, selector)\\n mstore(add(ptr, 0x04), hash)\\n mstore(add(ptr, 0x24), 0x40)\\n mstore(add(ptr, 0x44), 64)\\n mstore(add(ptr, 0x64), r)\\n mstore(add(ptr, 0x84), vs)\\n if staticcall(gas(), signer, ptr, 0xa4, 0, 0x20) {\\n success := and(eq(selector, mload(0)), eq(returndatasize(), 0x20))\\n }\\n }\\n }\\n\\n /**\\n * @notice Verifies if a 65-byte signature is valid for a given hash, according to EIP-1271.\\n * @param signer The address of the signer to validate against, which could be an EOA or a contract.\\n * @param hash The hash of the signed data.\\n * @param r The first 32 bytes of the signature.\\n * @param vs The combined `v` (recovery id) and `s` component of the signature, packed into the last 32 bytes.\\n * @return success True if the signature is valid according to EIP-1271, false otherwise.\\n */\\n function isValidSignature65(\\n address signer,\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal view returns (bool success) {\\n // (bool success, bytes memory data) = signer.staticcall(abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, abi.encodePacked(r, vs & ~uint256(1 << 255), uint8(vs >> 255))));\\n // return success && data.length == 32 && abi.decode(data, (bytes4)) == IERC1271.isValidSignature.selector;\\n bytes4 selector = IERC1271.isValidSignature.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n mstore(ptr, selector)\\n mstore(add(ptr, 0x04), hash)\\n mstore(add(ptr, 0x24), 0x40)\\n mstore(add(ptr, 0x44), 65)\\n mstore(add(ptr, 0x64), r)\\n mstore(add(ptr, 0x84), and(vs, _COMPACT_S_MASK))\\n mstore8(add(ptr, 0xa4), add(27, shr(_COMPACT_V_SHIFT, vs)))\\n if staticcall(gas(), signer, ptr, 0xa5, 0, 0x20) {\\n success := and(eq(selector, mload(0)), eq(returndatasize(), 0x20))\\n }\\n }\\n }\\n\\n /**\\n * @notice Generates a hash compatible with Ethereum's signed message format.\\n * @dev Prepends the hash with Ethereum's message prefix before hashing it.\\n * @param hash The hash of the data to sign.\\n * @return res The Ethereum signed message hash.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 res) {\\n // 32 is the length in bytes of hash, enforced by the type signature above\\n // return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n mstore(0, 0x19457468657265756d205369676e6564204d6573736167653a0a333200000000) // \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"\\n mstore(28, hash)\\n res := keccak256(0, 60)\\n }\\n }\\n\\n /**\\n * @notice Generates an EIP-712 compliant hash.\\n * @dev Encodes the domain separator and the struct hash according to EIP-712.\\n * @param domainSeparator The EIP-712 domain separator.\\n * @param structHash The EIP-712 struct hash.\\n * @return res The EIP-712 compliant hash.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 res) {\\n // return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n mstore(ptr, 0x1901000000000000000000000000000000000000000000000000000000000000) // \\\"\\\\x19\\\\x01\\\"\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n res := keccak256(ptr, 66)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x501b8b300cf98af055d4bb26eb936ec8cb8aac7cde5caae9c2d045a43d15c5e5\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/libraries/RevertReasonForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title RevertReasonForwarder\\n * @notice Provides utilities for forwarding and retrieving revert reasons from failed external calls.\\n */\\nlibrary RevertReasonForwarder {\\n /**\\n * @dev Forwards the revert reason from the latest external call.\\n * This method allows propagating the revert reason of a failed external call to the caller.\\n */\\n function reRevert() internal pure {\\n // bubble up revert reason from latest external call\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n }\\n\\n /**\\n * @dev Retrieves the revert reason from the latest external call.\\n * This method enables capturing the revert reason of a failed external call for inspection or processing.\\n * @return reason The latest external call revert reason.\\n */\\n function reReason() internal pure returns (bytes memory reason) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n reason := mload(0x40)\\n let length := returndatasize()\\n mstore(reason, length)\\n returndatacopy(add(reason, 0x20), 0, length)\\n mstore(0x40, add(reason, add(0x20, length)))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x97d8c950981f4da44ae1b01d9e597c4f99377797ec7ff7b1ef9648e4ecc1baa4\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\\\";\\nimport \\\"../interfaces/IDaiLikePermit.sol\\\";\\nimport \\\"../interfaces/IPermit2.sol\\\";\\nimport \\\"../interfaces/IERC7597Permit.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\nimport \\\"../libraries/RevertReasonForwarder.sol\\\";\\n\\n/**\\n * @title Implements efficient safe methods for ERC20 interface.\\n * @notice Compared to the standard ERC20, this implementation offers several enhancements:\\n * 1. more gas-efficient, providing significant savings in transaction costs.\\n * 2. support for different permit implementations\\n * 3. forceApprove functionality\\n * 4. support for WETH deposit and withdraw\\n */\\nlibrary SafeERC20 {\\n error SafeTransferFailed();\\n error SafeTransferFromFailed();\\n error ForceApproveFailed();\\n error SafeIncreaseAllowanceFailed();\\n error SafeDecreaseAllowanceFailed();\\n error SafePermitBadLength();\\n error Permit2TransferAmountTooHigh();\\n\\n // Uniswap Permit2 address\\n address private constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\n address private constant _PERMIT2_ZKSYNC = 0x0000000000225e31D15943971F47aD3022F714Fa;\\n bytes4 private constant _PERMIT_LENGTH_ERROR = 0x68275857; // SafePermitBadLength.selector\\n\\n /**\\n * @notice Fetches the balance of a specific ERC20 token held by an account.\\n * Consumes less gas then regular `ERC20.balanceOf`.\\n * @dev Note that the implementation does not perform dirty bits cleaning, so it is the\\n * responsibility of the caller to make sure that the higher 96 bits of the `account` parameter are clean.\\n * @param token The IERC20 token contract for which the balance will be fetched.\\n * @param account The address of the account whose token balance will be fetched.\\n * @return tokenBalance The balance of the specified ERC20 token held by the account.\\n */\\n function safeBalanceOf(\\n IERC20 token,\\n address account\\n ) internal view returns(uint256 tokenBalance) {\\n bytes4 selector = IERC20.balanceOf.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n mstore(0x00, selector)\\n mstore(0x04, account)\\n let success := staticcall(gas(), token, 0x00, 0x24, 0x00, 0x20)\\n tokenBalance := mload(0)\\n\\n if or(iszero(success), lt(returndatasize(), 0x20)) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @notice Attempts to safely transfer tokens from one address to another.\\n * @dev If permit2 is true, uses the Permit2 standard; otherwise uses the standard ERC20 transferFrom.\\n * Either requires `true` in return data, or requires target to be smart-contract and empty return data.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.\\n * @param token The IERC20 token contract from which the tokens will be transferred.\\n * @param from The address from which the tokens will be transferred.\\n * @param to The address to which the tokens will be transferred.\\n * @param amount The amount of tokens to transfer.\\n * @param permit2 If true, uses the Permit2 standard for the transfer; otherwise uses the standard ERC20 transferFrom.\\n */\\n function safeTransferFromUniversal(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 amount,\\n bool permit2\\n ) internal {\\n if (permit2) {\\n safeTransferFromPermit2(token, from, to, amount);\\n } else {\\n safeTransferFrom(token, from, to, amount);\\n }\\n }\\n\\n /**\\n * @notice Attempts to safely transfer tokens from one address to another using the ERC20 standard.\\n * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.\\n * @param token The IERC20 token contract from which the tokens will be transferred.\\n * @param from The address from which the tokens will be transferred.\\n * @param to The address to which the tokens will be transferred.\\n * @param amount The amount of tokens to transfer.\\n */\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bytes4 selector = token.transferFrom.selector;\\n bool success;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let data := mload(0x40)\\n\\n mstore(data, selector)\\n mstore(add(data, 0x04), from)\\n mstore(add(data, 0x24), to)\\n mstore(add(data, 0x44), amount)\\n success := call(gas(), token, 0, data, 0x64, 0x0, 0x20)\\n if success {\\n switch returndatasize()\\n case 0 {\\n success := gt(extcodesize(token), 0)\\n }\\n default {\\n success := and(gt(returndatasize(), 31), eq(mload(0), 1))\\n }\\n }\\n }\\n if (!success) revert SafeTransferFromFailed();\\n }\\n\\n /**\\n * @notice Attempts to safely transfer tokens from one address to another using the Permit2 standard.\\n * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.\\n * @param token The IERC20 token contract from which the tokens will be transferred.\\n * @param from The address from which the tokens will be transferred.\\n * @param to The address to which the tokens will be transferred.\\n * @param amount The amount of tokens to transfer.\\n */\\n function safeTransferFromPermit2(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n if (amount > type(uint160).max) revert Permit2TransferAmountTooHigh();\\n address permit2 = _getPermit2Address();\\n bytes4 selector = IPermit2.transferFrom.selector;\\n bool success;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let data := mload(0x40)\\n\\n mstore(data, selector)\\n mstore(add(data, 0x04), from)\\n mstore(add(data, 0x24), to)\\n mstore(add(data, 0x44), amount)\\n mstore(add(data, 0x64), token)\\n success := call(gas(), permit2, 0, data, 0x84, 0x0, 0x0)\\n if success {\\n success := gt(extcodesize(permit2), 0)\\n }\\n }\\n if (!success) revert SafeTransferFromFailed();\\n }\\n\\n /**\\n * @notice Attempts to safely transfer tokens to another address.\\n * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `to` parameter are clean.\\n * @param token The IERC20 token contract from which the tokens will be transferred.\\n * @param to The address to which the tokens will be transferred.\\n * @param amount The amount of tokens to transfer.\\n */\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n if (!_makeCall(token, token.transfer.selector, to, amount)) {\\n revert SafeTransferFailed();\\n }\\n }\\n\\n /**\\n * @notice Attempts to approve a spender to spend a certain amount of tokens.\\n * @dev If `approve(from, to, amount)` fails, it tries to set the allowance to zero, and retries the `approve` call.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.\\n * @param token The IERC20 token contract on which the call will be made.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n */\\n function forceApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n if (!_makeCall(token, token.approve.selector, spender, value)) {\\n if (\\n !_makeCall(token, token.approve.selector, spender, 0) ||\\n !_makeCall(token, token.approve.selector, spender, value)\\n ) {\\n revert ForceApproveFailed();\\n }\\n }\\n }\\n\\n /**\\n * @notice Safely increases the allowance of a spender.\\n * @dev Increases with safe math check. Checks if the increased allowance will overflow, if yes, then it reverts the transaction.\\n * Then uses `forceApprove` to increase the allowance.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.\\n * @param token The IERC20 token contract on which the call will be made.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to increase the allowance by.\\n */\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 allowance = token.allowance(address(this), spender);\\n if (value > type(uint256).max - allowance) revert SafeIncreaseAllowanceFailed();\\n forceApprove(token, spender, allowance + value);\\n }\\n\\n /**\\n * @notice Safely decreases the allowance of a spender.\\n * @dev Decreases with safe math check. Checks if the decreased allowance will underflow, if yes, then it reverts the transaction.\\n * Then uses `forceApprove` to increase the allowance.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.\\n * @param token The IERC20 token contract on which the call will be made.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to decrease the allowance by.\\n */\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 allowance = token.allowance(address(this), spender);\\n if (value > allowance) revert SafeDecreaseAllowanceFailed();\\n forceApprove(token, spender, allowance - value);\\n }\\n\\n /**\\n * @notice Attempts to execute the `permit` function on the provided token with the sender and contract as parameters.\\n * Permit type is determined automatically based on permit calldata (IERC20Permit, IDaiLikePermit, and IPermit2).\\n * @dev Wraps `tryPermit` function and forwards revert reason if permit fails.\\n * @param token The IERC20 token to execute the permit function on.\\n * @param permit The permit data to be used in the function call.\\n */\\n function safePermit(IERC20 token, bytes calldata permit) internal {\\n if (!tryPermit(token, msg.sender, address(this), permit)) RevertReasonForwarder.reRevert();\\n }\\n\\n /**\\n * @notice Attempts to execute the `permit` function on the provided token with custom owner and spender parameters.\\n * Permit type is determined automatically based on permit calldata (IERC20Permit, IDaiLikePermit, and IPermit2).\\n * @dev Wraps `tryPermit` function and forwards revert reason if permit fails.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `owner` and `spender` parameters are clean.\\n * @param token The IERC20 token to execute the permit function on.\\n * @param owner The owner of the tokens for which the permit is made.\\n * @param spender The spender allowed to spend the tokens by the permit.\\n * @param permit The permit data to be used in the function call.\\n */\\n function safePermit(IERC20 token, address owner, address spender, bytes calldata permit) internal {\\n if (!tryPermit(token, owner, spender, permit)) RevertReasonForwarder.reRevert();\\n }\\n\\n /**\\n * @notice Attempts to execute the `permit` function on the provided token with the sender and contract as parameters.\\n * @dev Invokes `tryPermit` with sender as owner and contract as spender.\\n * @param token The IERC20 token to execute the permit function on.\\n * @param permit The permit data to be used in the function call.\\n * @return success Returns true if the permit function was successfully executed, false otherwise.\\n */\\n function tryPermit(IERC20 token, bytes calldata permit) internal returns(bool success) {\\n return tryPermit(token, msg.sender, address(this), permit);\\n }\\n\\n /**\\n * @notice The function attempts to call the permit function on a given ERC20 token.\\n * @dev The function is designed to support a variety of permit functions, namely: IERC20Permit, IDaiLikePermit, IERC7597Permit and IPermit2.\\n * It accommodates both Compact and Full formats of these permit types.\\n * Please note, it is expected that the `expiration` parameter for the compact Permit2 and the `deadline` parameter\\n * for the compact Permit are to be incremented by one before invoking this function. This approach is motivated by\\n * gas efficiency considerations; as the unlimited expiration period is likely to be the most common scenario, and\\n * zeros are cheaper to pass in terms of gas cost. Thus, callers should increment the expiration or deadline by one\\n * before invocation for optimized performance.\\n * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of\\n * the caller to make sure that the higher 96 bits of the `owner` and `spender` parameters are clean.\\n * @param token The address of the ERC20 token on which to call the permit function.\\n * @param owner The owner of the tokens. This address should have signed the off-chain permit.\\n * @param spender The address which will be approved for transfer of tokens.\\n * @param permit The off-chain permit data, containing different fields depending on the type of permit function.\\n * @return success A boolean indicating whether the permit call was successful.\\n */\\n function tryPermit(IERC20 token, address owner, address spender, bytes calldata permit) internal returns(bool success) {\\n address permit2 = _getPermit2Address();\\n // load function selectors for different permit standards\\n bytes4 permitSelector = IERC20Permit.permit.selector;\\n bytes4 daiPermitSelector = IDaiLikePermit.permit.selector;\\n bytes4 permit2Selector = IPermit2.permit.selector;\\n bytes4 erc7597PermitSelector = IERC7597Permit.permit.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n // Switch case for different permit lengths, indicating different permit standards\\n switch permit.length\\n // Compact IERC20Permit\\n case 100 {\\n mstore(ptr, permitSelector) // store selector\\n mstore(add(ptr, 0x04), owner) // store owner\\n mstore(add(ptr, 0x24), spender) // store spender\\n\\n // Compact IERC20Permit.permit(uint256 value, uint32 deadline, uint256 r, uint256 vs)\\n { // stack too deep\\n let deadline := shr(224, calldataload(add(permit.offset, 0x20))) // loads permit.offset 0x20..0x23\\n let vs := calldataload(add(permit.offset, 0x44)) // loads permit.offset 0x44..0x63\\n\\n calldatacopy(add(ptr, 0x44), permit.offset, 0x20) // store value = copy permit.offset 0x00..0x19\\n mstore(add(ptr, 0x64), sub(deadline, 1)) // store deadline = deadline - 1\\n mstore(add(ptr, 0x84), add(27, shr(255, vs))) // store v = most significant bit of vs + 27 (27 or 28)\\n calldatacopy(add(ptr, 0xa4), add(permit.offset, 0x24), 0x20) // store r = copy permit.offset 0x24..0x43\\n mstore(add(ptr, 0xc4), shr(1, shl(1, vs))) // store s = vs without most significant bit\\n }\\n // IERC20Permit.permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)\\n success := call(gas(), token, 0, ptr, 0xe4, 0, 0)\\n }\\n // Compact IDaiLikePermit\\n case 72 {\\n mstore(ptr, daiPermitSelector) // store selector\\n mstore(add(ptr, 0x04), owner) // store owner\\n mstore(add(ptr, 0x24), spender) // store spender\\n\\n // Compact IDaiLikePermit.permit(uint32 nonce, uint32 expiry, uint256 r, uint256 vs)\\n { // stack too deep\\n let expiry := shr(224, calldataload(add(permit.offset, 0x04))) // loads permit.offset 0x04..0x07\\n let vs := calldataload(add(permit.offset, 0x28)) // loads permit.offset 0x28..0x47\\n\\n mstore(add(ptr, 0x44), shr(224, calldataload(permit.offset))) // store nonce = copy permit.offset 0x00..0x03\\n mstore(add(ptr, 0x64), sub(expiry, 1)) // store expiry = expiry - 1\\n mstore(add(ptr, 0x84), true) // store allowed = true\\n mstore(add(ptr, 0xa4), add(27, shr(255, vs))) // store v = most significant bit of vs + 27 (27 or 28)\\n calldatacopy(add(ptr, 0xc4), add(permit.offset, 0x08), 0x20) // store r = copy permit.offset 0x08..0x27\\n mstore(add(ptr, 0xe4), shr(1, shl(1, vs))) // store s = vs without most significant bit\\n }\\n // IDaiLikePermit.permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s)\\n success := call(gas(), token, 0, ptr, 0x104, 0, 0)\\n }\\n // IERC20Permit\\n case 224 {\\n mstore(ptr, permitSelector)\\n calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata\\n // IERC20Permit.permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)\\n success := call(gas(), token, 0, ptr, 0xe4, 0, 0)\\n }\\n // IDaiLikePermit\\n case 256 {\\n mstore(ptr, daiPermitSelector)\\n calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata\\n // IDaiLikePermit.permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s)\\n success := call(gas(), token, 0, ptr, 0x104, 0, 0)\\n }\\n // Compact IPermit2\\n case 96 {\\n // Compact IPermit2.permit(uint160 amount, uint32 expiration, uint32 nonce, uint32 sigDeadline, uint256 r, uint256 vs)\\n mstore(ptr, permit2Selector) // store selector\\n mstore(add(ptr, 0x04), owner) // store owner\\n mstore(add(ptr, 0x24), token) // store token\\n\\n calldatacopy(add(ptr, 0x50), permit.offset, 0x14) // store amount = copy permit.offset 0x00..0x13\\n // and(0xffffffffffff, ...) - conversion to uint48\\n mstore(add(ptr, 0x64), and(0xffffffffffff, sub(shr(224, calldataload(add(permit.offset, 0x14))), 1))) // store expiration = ((permit.offset 0x14..0x17 - 1) & 0xffffffffffff)\\n mstore(add(ptr, 0x84), shr(224, calldataload(add(permit.offset, 0x18)))) // store nonce = copy permit.offset 0x18..0x1b\\n mstore(add(ptr, 0xa4), spender) // store spender\\n // and(0xffffffffffff, ...) - conversion to uint48\\n mstore(add(ptr, 0xc4), and(0xffffffffffff, sub(shr(224, calldataload(add(permit.offset, 0x1c))), 1))) // store sigDeadline = ((permit.offset 0x1c..0x1f - 1) & 0xffffffffffff)\\n mstore(add(ptr, 0xe4), 0x100) // store offset = 256\\n mstore(add(ptr, 0x104), 0x40) // store length = 64\\n calldatacopy(add(ptr, 0x124), add(permit.offset, 0x20), 0x20) // store r = copy permit.offset 0x20..0x3f\\n calldatacopy(add(ptr, 0x144), add(permit.offset, 0x40), 0x20) // store vs = copy permit.offset 0x40..0x5f\\n // IPermit2.permit(address owner, PermitSingle calldata permitSingle, bytes calldata signature)\\n success := call(gas(), permit2, 0, ptr, 0x164, 0, 0)\\n }\\n // IPermit2\\n case 352 {\\n mstore(ptr, permit2Selector)\\n calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata\\n // IPermit2.permit(address owner, PermitSingle calldata permitSingle, bytes calldata signature)\\n success := call(gas(), permit2, 0, ptr, 0x164, 0, 0)\\n }\\n // Dynamic length\\n default {\\n mstore(ptr, erc7597PermitSelector)\\n calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata\\n // IERC7597Permit.permit(address owner, address spender, uint256 value, uint256 deadline, bytes memory signature)\\n success := call(gas(), token, 0, ptr, add(permit.length, 4), 0, 0)\\n }\\n }\\n }\\n\\n /**\\n * @dev Executes a low level call to a token contract, making it resistant to reversion and erroneous boolean returns.\\n * @param token The IERC20 token contract on which the call will be made.\\n * @param selector The function signature that is to be called on the token contract.\\n * @param to The address to which the token amount will be transferred.\\n * @param amount The token amount to be transferred.\\n * @return success A boolean indicating if the call was successful. Returns 'true' on success and 'false' on failure.\\n * In case of success but no returned data, validates that the contract code exists.\\n * In case of returned data, ensures that it's a boolean `true`.\\n */\\n function _makeCall(\\n IERC20 token,\\n bytes4 selector,\\n address to,\\n uint256 amount\\n ) private returns (bool success) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let data := mload(0x40)\\n\\n mstore(data, selector)\\n mstore(add(data, 0x04), to)\\n mstore(add(data, 0x24), amount)\\n success := call(gas(), token, 0, data, 0x44, 0x0, 0x20)\\n if success {\\n switch returndatasize()\\n case 0 {\\n success := gt(extcodesize(token), 0)\\n }\\n default {\\n success := and(gt(returndatasize(), 31), eq(mload(0), 1))\\n }\\n }\\n }\\n }\\n\\n /**\\n * @notice Safely deposits a specified amount of Ether into the IWETH contract. Consumes less gas then regular `IWETH.deposit`.\\n * @param weth The IWETH token contract.\\n * @param amount The amount of Ether to deposit into the IWETH contract.\\n */\\n function safeDeposit(IWETH weth, uint256 amount) internal {\\n bytes4 selector = IWETH.deposit.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n mstore(0, selector)\\n if iszero(call(gas(), weth, amount, 0, 4, 0, 0)) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @notice Safely withdraws a specified amount of wrapped Ether from the IWETH contract. Consumes less gas then regular `IWETH.withdraw`.\\n * @dev Uses inline assembly to interact with the IWETH contract.\\n * @param weth The IWETH token contract.\\n * @param amount The amount of wrapped Ether to withdraw from the IWETH contract.\\n */\\n function safeWithdraw(IWETH weth, uint256 amount) internal {\\n bytes4 selector = IWETH.withdraw.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n mstore(0, selector)\\n mstore(4, amount)\\n if iszero(call(gas(), weth, 0, 0, 0x24, 0, 0)) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @notice Safely withdraws a specified amount of wrapped Ether from the IWETH contract to a specified recipient.\\n * Consumes less gas then regular `IWETH.withdraw`.\\n * @param weth The IWETH token contract.\\n * @param amount The amount of wrapped Ether to withdraw from the IWETH contract.\\n * @param to The recipient of the withdrawn Ether.\\n */\\n function safeWithdrawTo(IWETH weth, uint256 amount, address to) internal {\\n safeWithdraw(weth, amount);\\n if (to != address(this)) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n if iszero(call(gas(), to, amount, 0, 0, 0, 0)) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n }\\n }\\n }\\n\\n function _getPermit2Address() private view returns (address permit2) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n switch chainid()\\n case 324 { // zksync mainnet\\n permit2 := _PERMIT2_ZKSYNC\\n }\\n case 300 { // zksync testnet\\n permit2 := _PERMIT2_ZKSYNC\\n }\\n case 260 { // zksync fork network\\n permit2 := _PERMIT2_ZKSYNC\\n }\\n default {\\n permit2 := _PERMIT2\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc756a120ac3a0271cdfd89db133335deaf31523a06a91ff00eb2be8656e9f85a\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/mixins/EthReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title EthReceiver\\n * @dev Abstract contract for rejecting direct ETH transfers from EOAs.\\n * Implements a custom error and logic to reject ETH deposits from non-contract addresses.\\n */\\nabstract contract EthReceiver {\\n /// @dev Error thrown when an ETH deposit from an EOA is attempted.\\n error EthDepositRejected();\\n\\n /// @dev External payable function to receive ETH, automatically rejects deposits from EOAs.\\n receive() external payable {\\n _receive();\\n }\\n\\n /**\\n * @dev Internal function containing the logic to reject ETH deposits.\\n * Can be overridden by derived contracts for specific behaviors while maintaining the base rejection mechanism.\\n */\\n function _receive() internal virtual {\\n // solhint-disable-next-line avoid-tx-origin\\n if (msg.sender == tx.origin) revert EthDepositRejected();\\n }\\n}\\n\",\"keccak256\":\"0x02ff3d1cf523bd8c8dc3caf93844ec09223ff9609f5896ef46fa41d5b00c2e03\",\"license\":\"MIT\"},\"@1inch/solidity-utils/contracts/mixins/OnlyWethReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./EthReceiver.sol\\\";\\n\\n/**\\n * @title OnlyWethReceiver\\n * @dev Abstract contract extending EthReceiver to accept only ETH deposits from a specified WETH contract.\\n * This contract ensures that only wrapped ETH (WETH) can be deposited, rejecting all other direct ETH transfers.\\n */\\nabstract contract OnlyWethReceiver is EthReceiver {\\n /// @notice Address of the WETH contract allowed to deposit ETH.\\n address private immutable _WETH; // solhint-disable-line var-name-mixedcase\\n\\n /**\\n * @dev Sets the WETH contract address during construction.\\n * @param weth Address of the WETH contract.\\n */\\n constructor(address weth) {\\n _WETH = address(weth);\\n }\\n\\n /**\\n * @dev Overrides _receive to restrict ETH transfers solely to the WETH contract.\\n * Reverts with EthDepositRejected if ETH is sent from any other address.\\n */\\n function _receive() internal virtual override {\\n if (msg.sender != _WETH) revert EthDepositRejected();\\n }\\n}\\n\",\"keccak256\":\"0x15aecbd7d3ff25452851d8c21ef7a9c6559b1f787701faf642513af84a35fdaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Clones.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/Clones.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"../utils/Errors.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-1167[ERC-1167] is a standard for\\n * deploying minimal proxy contracts, also known as \\\"clones\\\".\\n *\\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\\n *\\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\\n * deterministic method.\\n */\\nlibrary Clones {\\n /**\\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\\n *\\n * This function uses the create opcode, which should never revert.\\n */\\n function clone(address implementation) internal returns (address instance) {\\n return clone(implementation, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Clones-clone-address-}[clone], but with a `value` parameter to send native currency\\n * to the new contract.\\n *\\n * NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)\\n * to always have enough balance for new deployments. Consider exposing this function under a payable method.\\n */\\n function clone(address implementation, uint256 value) internal returns (address instance) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n assembly (\\\"memory-safe\\\") {\\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\\n // of the `implementation` address with the bytecode before the address.\\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\\n instance := create(value, 0x09, 0x37)\\n }\\n if (instance == address(0)) {\\n revert Errors.FailedDeployment();\\n }\\n }\\n\\n /**\\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\\n *\\n * This function uses the create2 opcode and a `salt` to deterministically deploy\\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\\n * the clones cannot be deployed twice at the same address.\\n */\\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\\n return cloneDeterministic(implementation, salt, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Clones-cloneDeterministic-address-bytes32-}[cloneDeterministic], but with\\n * a `value` parameter to send native currency to the new contract.\\n *\\n * NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)\\n * to always have enough balance for new deployments. Consider exposing this function under a payable method.\\n */\\n function cloneDeterministic(\\n address implementation,\\n bytes32 salt,\\n uint256 value\\n ) internal returns (address instance) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n assembly (\\\"memory-safe\\\") {\\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\\n // of the `implementation` address with the bytecode before the address.\\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\\n instance := create2(value, 0x09, 0x37, salt)\\n }\\n if (instance == address(0)) {\\n revert Errors.FailedDeployment();\\n }\\n }\\n\\n /**\\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\\n */\\n function predictDeterministicAddress(\\n address implementation,\\n bytes32 salt,\\n address deployer\\n ) internal pure returns (address predicted) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(add(ptr, 0x38), deployer)\\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\\n mstore(add(ptr, 0x14), implementation)\\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\\n mstore(add(ptr, 0x58), salt)\\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\\n predicted := and(keccak256(add(ptr, 0x43), 0x55), 0xffffffffffffffffffffffffffffffffffffffff)\\n }\\n }\\n\\n /**\\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\\n */\\n function predictDeterministicAddress(\\n address implementation,\\n bytes32 salt\\n ) internal view returns (address predicted) {\\n return predictDeterministicAddress(implementation, salt, address(this));\\n }\\n}\\n\",\"keccak256\":\"0xf55d01dac75cffdabec6833a79bf3be0c108fc0db10e273daf7adfd3e9e59dae\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\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 ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x27dbc90e5136ffe46c04f7596fc2dbcc3acebd8d504da3d93fdb8496e6de04f6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value)));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n uint256 localValue = value;\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\\n * representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS\\n }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n assembly (\\\"memory-safe\\\") {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS, s);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"contracts/OrderLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"@1inch/solidity-utils/contracts/libraries/ECDSA.sol\\\";\\nimport \\\"@1inch/solidity-utils/contracts/libraries/AddressLib.sol\\\";\\n\\nimport \\\"./interfaces/IOrderMixin.sol\\\";\\nimport \\\"./libraries/MakerTraitsLib.sol\\\";\\nimport \\\"./libraries/ExtensionLib.sol\\\";\\nimport \\\"./libraries/AmountCalculatorLib.sol\\\";\\nimport \\\"./interfaces/IAmountGetter.sol\\\";\\n\\n/**\\n * @title OrderLib\\n * @dev The library provides common functionality for processing and manipulating limit orders.\\n * It provides functionality to calculate and verify order hashes, calculate trade amounts, and validate\\n * extension data associated with orders. The library also contains helper methods to get the receiver of\\n * an order and call getter functions.\\n */\\n library OrderLib {\\n using AddressLib for Address;\\n using MakerTraitsLib for MakerTraits;\\n using ExtensionLib for bytes;\\n\\n /// @dev Error to be thrown when the extension data of an order is missing.\\n error MissingOrderExtension();\\n /// @dev Error to be thrown when the order has an unexpected extension.\\n error UnexpectedOrderExtension();\\n /// @dev Error to be thrown when the order extension hash is invalid.\\n error InvalidExtensionHash();\\n\\n /// @dev The typehash of the order struct.\\n bytes32 constant internal _LIMIT_ORDER_TYPEHASH = keccak256(\\n \\\"Order(\\\"\\n \\\"uint256 salt,\\\"\\n \\\"address maker,\\\"\\n \\\"address receiver,\\\"\\n \\\"address makerAsset,\\\"\\n \\\"address takerAsset,\\\"\\n \\\"uint256 makingAmount,\\\"\\n \\\"uint256 takingAmount,\\\"\\n \\\"uint256 makerTraits\\\"\\n \\\")\\\"\\n );\\n uint256 constant internal _ORDER_STRUCT_SIZE = 0x100;\\n uint256 constant internal _DATA_HASH_SIZE = 0x120;\\n\\n /**\\n * @notice Calculates the hash of an order.\\n * @param order The order to be hashed.\\n * @param domainSeparator The domain separator to be used for the EIP-712 hashing.\\n * @return result The EIP-712 hash of the order data.\\n */\\n function hash(IOrderMixin.Order calldata order, bytes32 domainSeparator) internal pure returns(bytes32 result) {\\n bytes32 typehash = _LIMIT_ORDER_TYPEHASH;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(0x40)\\n\\n // keccak256(abi.encode(_LIMIT_ORDER_TYPEHASH, order));\\n mstore(ptr, typehash)\\n calldatacopy(add(ptr, 0x20), order, _ORDER_STRUCT_SIZE)\\n result := keccak256(ptr, _DATA_HASH_SIZE)\\n }\\n result = ECDSA.toTypedDataHash(domainSeparator, result);\\n }\\n\\n /**\\n * @notice Calculates the hash of an order in memory.\\n * @param order The order to be hashed.\\n * @param domainSeparator The domain separator to be used for the EIP-712 hashing.\\n * @return result The EIP-712 hash of the order data.\\n */\\n function hashMemory(IOrderMixin.Order memory order, bytes32 domainSeparator) internal pure returns(bytes32 result) {\\n bytes32 typehash = OrderLib._LIMIT_ORDER_TYPEHASH;\\n uint256 dataHashSize = OrderLib._DATA_HASH_SIZE;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := sub(order, 0x20)\\n let backup := mload(ptr)\\n mstore(ptr, typehash)\\n\\n // keccak256(abi.encode(OrderLib._LIMIT_ORDER_TYPEHASH, order))\\n result := keccak256(ptr, dataHashSize)\\n\\n mstore(ptr, backup)\\n }\\n result = ECDSA.toTypedDataHash(domainSeparator, result);\\n }\\n\\n /**\\n * @notice Returns the receiver address for an order.\\n * @param order The order.\\n * @return receiver The address of the receiver, either explicitly defined in the order or the maker's address if not specified.\\n */\\n function getReceiver(IOrderMixin.Order calldata order) internal pure returns(address /*receiver*/) {\\n address receiver = order.receiver.get();\\n return receiver != address(0) ? receiver : order.maker.get();\\n }\\n\\n /**\\n * @notice Calculates the making amount based on the requested taking amount.\\n * @dev If getter is specified in the extension data, the getter is called to calculate the making amount,\\n * otherwise the making amount is calculated linearly.\\n * @param order The order.\\n * @param extension The extension data associated with the order.\\n * @param requestedTakingAmount The amount the taker wants to take.\\n * @param remainingMakingAmount The remaining amount of the asset left to fill.\\n * @param orderHash The hash of the order.\\n * @return makingAmount The amount of the asset the maker receives.\\n */\\n function calculateMakingAmount(\\n IOrderMixin.Order calldata order,\\n bytes calldata extension,\\n uint256 requestedTakingAmount,\\n uint256 remainingMakingAmount,\\n bytes32 orderHash\\n ) internal view returns(uint256) {\\n bytes calldata data = extension.makingAmountData();\\n if (data.length == 0) {\\n // Linear proportion\\n return AmountCalculatorLib.getMakingAmount(order.makingAmount, order.takingAmount, requestedTakingAmount);\\n }\\n return IAmountGetter(address(bytes20(data))).getMakingAmount(\\n order,\\n extension,\\n orderHash,\\n msg.sender,\\n requestedTakingAmount,\\n remainingMakingAmount,\\n data[20:]\\n );\\n }\\n\\n /**\\n * @notice Calculates the taking amount based on the requested making amount.\\n * @dev If getter is specified in the extension data, the getter is called to calculate the taking amount,\\n * otherwise the taking amount is calculated linearly.\\n * @param order The order.\\n * @param extension The extension data associated with the order.\\n * @param requestedMakingAmount The amount the maker wants to receive.\\n * @param remainingMakingAmount The remaining amount of the asset left to be filled.\\n * @param orderHash The hash of the order.\\n * @return takingAmount The amount of the asset the taker takes.\\n */\\n function calculateTakingAmount(\\n IOrderMixin.Order calldata order,\\n bytes calldata extension,\\n uint256 requestedMakingAmount,\\n uint256 remainingMakingAmount,\\n bytes32 orderHash\\n ) internal view returns(uint256) {\\n bytes calldata data = extension.takingAmountData();\\n if (data.length == 0) {\\n // Linear proportion\\n return AmountCalculatorLib.getTakingAmount(order.makingAmount, order.takingAmount, requestedMakingAmount);\\n }\\n return IAmountGetter(address(bytes20(data))).getTakingAmount(\\n order,\\n extension,\\n orderHash,\\n msg.sender,\\n requestedMakingAmount,\\n remainingMakingAmount,\\n data[20:]\\n );\\n }\\n\\n /**\\n * @dev Validates the extension associated with an order.\\n * @param order The order to validate against.\\n * @param extension The extension associated with the order.\\n * @return valid True if the extension is valid, false otherwise.\\n * @return errorSelector The error selector if the extension is invalid, 0x00000000 otherwise.\\n */\\n function isValidExtension(IOrderMixin.Order calldata order, bytes calldata extension) internal pure returns(bool, bytes4) {\\n if (order.makerTraits.hasExtension()) {\\n if (extension.length == 0) return (false, MissingOrderExtension.selector);\\n // Lowest 160 bits of the order salt must be equal to the lowest 160 bits of the extension hash\\n if (uint256(keccak256(extension)) & type(uint160).max != order.salt & type(uint160).max) return (false, InvalidExtensionHash.selector);\\n } else {\\n if (extension.length > 0) return (false, UnexpectedOrderExtension.selector);\\n }\\n return (true, 0x00000000);\\n }\\n}\\n\",\"keccak256\":\"0x342c28a3b70ebfe5b49392ce4e710dfbe29f599c064eedf392a3d48e823924c1\",\"license\":\"MIT\"},\"contracts/extensions/NativeOrderFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport { Clones } from \\\"@openzeppelin/contracts/proxy/Clones.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { Address, AddressLib } from \\\"@1inch/solidity-utils/contracts/libraries/AddressLib.sol\\\";\\nimport { SafeERC20, IERC20, IWETH } from \\\"@1inch/solidity-utils/contracts/libraries/SafeERC20.sol\\\";\\n\\nimport { IOrderMixin } from \\\"../interfaces/IOrderMixin.sol\\\";\\nimport { MakerTraits, MakerTraitsLib } from \\\"../libraries/MakerTraitsLib.sol\\\";\\nimport { EIP712Alien } from \\\"../mocks/EIP712Alien.sol\\\";\\nimport { OrderLib, IOrderMixin } from \\\"../OrderLib.sol\\\";\\nimport { NativeOrderImpl } from \\\"./NativeOrderImpl.sol\\\";\\n\\ncontract NativeOrderFactory is Ownable, EIP712Alien {\\n using Clones for address;\\n using AddressLib for Address;\\n using SafeERC20 for IERC20;\\n using OrderLib for IOrderMixin.Order;\\n using MakerTraitsLib for MakerTraits;\\n\\n event NativeOrderCreated(address maker, bytes32 orderHash, address clone, uint256 value);\\n\\n error OrderReceiverShouldBeSetCorrectly(address receiver);\\n error OrderMakerShouldBeMsgSender(address expected, address actual);\\n error OrderMakingAmountShouldBeEqualToMsgValue(uint256 expected, uint256 actual);\\n\\n address public immutable IMPLEMENTATION;\\n\\n constructor(\\n IWETH weth,\\n address limitOrderProtocol,\\n IERC20 accessToken,\\n uint256 cancellationDelay, // Recommended 60 seconds delay after order expiration for rewardable cancellation\\n string memory name,\\n string memory version\\n )\\n Ownable(msg.sender)\\n EIP712Alien(limitOrderProtocol, name, version)\\n {\\n IMPLEMENTATION = address(new NativeOrderImpl(\\n weth,\\n address(this),\\n limitOrderProtocol,\\n accessToken,\\n cancellationDelay,\\n name,\\n version\\n ));\\n }\\n\\n function create(IOrderMixin.Order calldata makerOrder) external payable returns (address clone) {\\n // Validate main order parameters\\n if (makerOrder.maker.get() != msg.sender) revert OrderMakerShouldBeMsgSender(msg.sender, makerOrder.maker.get());\\n address receiver = makerOrder.receiver.get();\\n if (receiver == address(0) || receiver == address(this)) revert OrderReceiverShouldBeSetCorrectly(receiver);\\n if (msg.value != makerOrder.makingAmount) revert OrderMakingAmountShouldBeEqualToMsgValue(makerOrder.makingAmount, msg.value);\\n\\n bytes32 makerOrderHash = makerOrder.hash(_domainSeparatorV4());\\n clone = IMPLEMENTATION.cloneDeterministic(makerOrderHash);\\n NativeOrderImpl(payable(clone)).depositAndApprove{ value: msg.value }();\\n\\n IOrderMixin.Order memory order = makerOrder;\\n order.maker = Address.wrap(uint160(clone));\\n bytes32 orderHash = order.hashMemory(_domainSeparatorV4());\\n emit NativeOrderCreated(msg.sender, orderHash, clone, msg.value);\\n }\\n\\n function rescueFunds(address token, address to, uint256 amount) external onlyOwner {\\n if (token == address(0)) {\\n payable(to).transfer(amount);\\n } else {\\n IERC20(token).safeTransfer(to, amount);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3449bad02a696176236b3a31e641505831af195faf9123456f2943bb3b08c664\",\"license\":\"MIT\"},\"contracts/extensions/NativeOrderImpl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { Clones } from \\\"@openzeppelin/contracts/proxy/Clones.sol\\\";\\nimport { IERC1271 } from \\\"@openzeppelin/contracts/interfaces/IERC1271.sol\\\";\\nimport { Address, AddressLib } from \\\"@1inch/solidity-utils/contracts/libraries/AddressLib.sol\\\";\\nimport { SafeERC20, IERC20, IWETH } from \\\"@1inch/solidity-utils/contracts/libraries/SafeERC20.sol\\\";\\nimport { OnlyWethReceiver } from \\\"@1inch/solidity-utils/contracts/mixins/OnlyWethReceiver.sol\\\";\\n\\nimport { MakerTraits, MakerTraitsLib } from \\\"../libraries/MakerTraitsLib.sol\\\";\\nimport { EIP712Alien } from \\\"../mocks/EIP712Alien.sol\\\";\\nimport { OrderLib, IOrderMixin } from \\\"../OrderLib.sol\\\";\\n\\ncontract NativeOrderImpl is IERC1271, EIP712Alien, OnlyWethReceiver {\\n using Clones for address;\\n using AddressLib for Address;\\n using SafeERC20 for IERC20;\\n using SafeERC20 for IWETH;\\n using OrderLib for IOrderMixin.Order;\\n using MakerTraitsLib for MakerTraits;\\n\\n event NativeOrderCancelled(bytes32 orderHash, uint256 balance);\\n event NativeOrderCancelledByResolver(bytes32 orderHash, uint256 balance, uint256 resolverReward);\\n\\n error OnlyLimitOrderProtocolViolation(address sender, address limitOrderProtocol);\\n error OnlyFactoryViolation(address sender, address factory);\\n error ResolverAccessTokenMissing(address resolver, address accessToken);\\n error OrderIsIncorrect(address expected, address actual);\\n error OrderShouldBeExpired(uint256 currentTime, uint256 expirationTime);\\n error CanNotCancelForZeroBalance();\\n error RescueFundsTooMuch(uint256 requested, uint256 available);\\n error CancellationDelayViolation(uint256 timePassedSinceExpiration, uint256 requiredDelay);\\n\\n uint256 private constant _CANCEL_GAS_LOWER_BOUND = 30_000;\\n\\n IWETH private immutable _WETH;\\n address private immutable _LOP;\\n address private immutable _IMPLEMENTATION = address(this);\\n address private immutable _FACTORY;\\n IERC20 private immutable _ACCESS_TOKEN;\\n uint256 private immutable _CANCELLATION_DELAY;\\n\\n modifier onlyFactory {\\n if (msg.sender != _FACTORY) revert OnlyFactoryViolation(msg.sender, _FACTORY);\\n _;\\n }\\n\\n modifier onlyResolver {\\n if (_ACCESS_TOKEN.balanceOf(msg.sender) == 0) revert ResolverAccessTokenMissing(msg.sender, address(_ACCESS_TOKEN));\\n _;\\n }\\n\\n constructor(\\n IWETH weth,\\n address nativeOrderFactory,\\n address limitOrderProtocol,\\n IERC20 accessToken,\\n uint256 cancellationDelay, // Recommended 60 seconds delay after order expiration for rewardable cancellation\\n string memory name,\\n string memory version\\n )\\n OnlyWethReceiver(address(weth))\\n EIP712Alien(limitOrderProtocol, name, version)\\n {\\n _WETH = weth;\\n _LOP = limitOrderProtocol;\\n _FACTORY = nativeOrderFactory;\\n _ACCESS_TOKEN = accessToken;\\n _CANCELLATION_DELAY = cancellationDelay;\\n }\\n\\n function depositAndApprove() external payable onlyFactory {\\n _WETH.safeDeposit(msg.value);\\n _WETH.forceApprove(_LOP, msg.value);\\n }\\n\\n function isValidSignature(bytes32 hash, bytes calldata signature) external view returns(bytes4) {\\n // Extract order from signature via calldata type casting\\n IOrderMixin.Order calldata makerOrder;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n makerOrder := signature.offset\\n }\\n\\n // Check order args by CREATE2 salt validation\\n bytes32 makerOrderHash = makerOrder.hash(_domainSeparatorV4());\\n address clone = _FACTORY.predictDeterministicAddress(makerOrderHash, _FACTORY);\\n if (clone != address(this)) {\\n return bytes4(0);\\n }\\n\\n // Check if patched order from signature matches LOP filling order\\n bytes32 orderHash = _patchOrderMakerAndHash(makerOrder);\\n if (orderHash != hash) {\\n return bytes4(0);\\n }\\n\\n return this.isValidSignature.selector;\\n }\\n\\n function cancelOrder(IOrderMixin.Order calldata makerOrder) external {\\n uint256 balance = _cancelOrder(makerOrder, 0);\\n bytes32 orderHash = _patchOrderMakerAndHash(makerOrder);\\n emit NativeOrderCancelled(orderHash, balance);\\n }\\n\\n function cancelExpiredOrderByResolver(IOrderMixin.Order calldata makerOrder, uint256 rewardLimit) external onlyResolver {\\n uint256 orderExpiration = makerOrder.makerTraits.getExpirationTime();\\n if (orderExpiration > 0 && block.timestamp < orderExpiration) revert OrderShouldBeExpired(block.timestamp, orderExpiration);\\n\\n uint256 resolverReward = 0;\\n if (rewardLimit > 0) {\\n if (block.timestamp - orderExpiration < _CANCELLATION_DELAY) revert CancellationDelayViolation(block.timestamp - orderExpiration, _CANCELLATION_DELAY);\\n resolverReward = Math.min(rewardLimit, block.basefee * _CANCEL_GAS_LOWER_BOUND * 1.1e18 / 1e18);\\n }\\n uint256 balance = _cancelOrder(makerOrder, resolverReward);\\n bytes32 orderHash = _patchOrderMakerAndHash(makerOrder);\\n emit NativeOrderCancelledByResolver(orderHash, balance, resolverReward);\\n }\\n\\n function _cancelOrder(IOrderMixin.Order calldata makerOrder, uint256 resolverReward) private returns(uint256 balance) {\\n bytes32 makerOrderHash = makerOrder.hash(_domainSeparatorV4());\\n address clone = _FACTORY.predictDeterministicAddress(makerOrderHash, _FACTORY);\\n if (clone != address(this)) revert OrderIsIncorrect(clone, address(this));\\n\\n balance = _WETH.safeBalanceOf(address(this));\\n if (balance == 0) revert CanNotCancelForZeroBalance();\\n\\n _WETH.safeWithdraw(balance);\\n if (resolverReward > 0) {\\n balance -= resolverReward;\\n payable(msg.sender).transfer(resolverReward);\\n }\\n if (balance > 0) {\\n payable(makerOrder.maker.get()).transfer(balance);\\n }\\n }\\n\\n function rescueFunds(address token, address to, uint256 amount) external onlyResolver {\\n if (token == address(0)) {\\n payable(to).transfer(amount);\\n } else if (IWETH(token) == _WETH) {\\n uint256 remainingOrderAmount = _WETH.allowance(address(this), _LOP);\\n uint256 extraAmount = _WETH.safeBalanceOf(address(this)) - remainingOrderAmount;\\n if (amount > extraAmount) revert RescueFundsTooMuch(amount, extraAmount);\\n _WETH.safeTransfer(to, amount);\\n } else {\\n IERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n function _patchOrderMakerAndHash(IOrderMixin.Order memory order) private view returns(bytes32) {\\n order.maker = Address.wrap(uint160(address(this)));\\n return order.hashMemory(_domainSeparatorV4());\\n }\\n}\\n\",\"keccak256\":\"0x20e4897b9adc986b4cb05932b3f4999eb0e54433941e245af66c4392db5cfcb5\",\"license\":\"MIT\"},\"contracts/interfaces/IAmountGetter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOrderMixin.sol\\\";\\n\\n/**\\n * @title IAmountGetter\\n * @notice Interface for external logic to determine actual making and taking amounts for orders.\\n */\\ninterface IAmountGetter {\\n /**\\n * @notice View method that gets called to determine the actual making amount\\n * @param order Order being processed\\n * @param extension Order extension data\\n * @param orderHash Hash of the order being processed\\n * @param taker Taker address\\n * @param takingAmount Actual taking amount\\n * @param remainingMakingAmount Order remaining making amount\\n * @param extraData Extra data\\n * @return makingAmount Actual making amount that should be used for the order\\n */\\n function getMakingAmount(\\n IOrderMixin.Order calldata order,\\n bytes calldata extension,\\n bytes32 orderHash,\\n address taker,\\n uint256 takingAmount,\\n uint256 remainingMakingAmount,\\n bytes calldata extraData\\n ) external view returns (uint256);\\n\\n /**\\n * @notice View method that gets called to determine the actual taking amount\\n * @param order Order being processed\\n * @param extension Order extension data\\n * @param orderHash Hash of the order being processed\\n * @param taker Taker address\\n * @param makingAmount Actual taking amount\\n * @param remainingMakingAmount Order remaining making amount\\n * @param extraData Extra data\\n * @return takingAmount Actual taking amount that should be used for the order\\n */\\n function getTakingAmount(\\n IOrderMixin.Order calldata order,\\n bytes calldata extension,\\n bytes32 orderHash,\\n address taker,\\n uint256 makingAmount,\\n uint256 remainingMakingAmount,\\n bytes calldata extraData\\n ) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xd2f5f477d812411a2eee26d645cd096b256221862fcf4a004128f7bdd43a6e08\",\"license\":\"MIT\"},\"contracts/interfaces/IOrderMixin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@1inch/solidity-utils/contracts/libraries/AddressLib.sol\\\";\\nimport \\\"../libraries/MakerTraitsLib.sol\\\";\\nimport \\\"../libraries/TakerTraitsLib.sol\\\";\\n\\n/**\\n * @title IOrderMixin\\n * @notice Interface for order processing logic in the 1inch Limit Order Protocol.\\n */\\ninterface IOrderMixin {\\n struct Order {\\n uint256 salt;\\n Address maker;\\n Address receiver;\\n Address makerAsset;\\n Address takerAsset;\\n uint256 makingAmount;\\n uint256 takingAmount;\\n MakerTraits makerTraits;\\n }\\n\\n error InvalidatedOrder();\\n error TakingAmountExceeded();\\n error PrivateOrder();\\n error BadSignature();\\n error OrderExpired();\\n error WrongSeriesNonce();\\n error SwapWithZeroAmount();\\n error PartialFillNotAllowed();\\n error OrderIsNotSuitableForMassInvalidation();\\n error EpochManagerAndBitInvalidatorsAreIncompatible();\\n error ReentrancyDetected();\\n error PredicateIsNotTrue();\\n error TakingAmountTooHigh();\\n error MakingAmountTooLow();\\n error TransferFromMakerToTakerFailed();\\n error TransferFromTakerToMakerFailed();\\n error MismatchArraysLengths();\\n error InvalidPermit2Transfer();\\n error SimulationResults(bool success, bytes res);\\n\\n /**\\n * @notice Emitted when order gets filled\\n * @param orderHash Hash of the order\\n * @param remainingAmount Amount of the maker asset that remains to be filled\\n */\\n event OrderFilled(\\n bytes32 orderHash,\\n uint256 remainingAmount\\n );\\n\\n /**\\n * @notice Emitted when order without `useBitInvalidator` gets cancelled\\n * @param orderHash Hash of the order\\n */\\n event OrderCancelled(\\n bytes32 orderHash\\n );\\n\\n /**\\n * @notice Emitted when order with `useBitInvalidator` gets cancelled\\n * @param maker Maker address\\n * @param slotIndex Slot index that was updated\\n * @param slotValue New slot value\\n */\\n event BitInvalidatorUpdated(\\n address indexed maker,\\n uint256 slotIndex,\\n uint256 slotValue\\n );\\n\\n /**\\n * @notice Delegates execution to custom implementation. Could be used to validate if `transferFrom` works properly\\n * @dev The function always reverts and returns the simulation results in revert data.\\n * @param target Addresses that will be delegated\\n * @param data Data that will be passed to delegatee\\n */\\n function simulate(address target, bytes calldata data) external;\\n\\n /**\\n * @notice Cancels order's quote\\n * @param makerTraits Order makerTraits\\n * @param orderHash Hash of the order to cancel\\n */\\n function cancelOrder(MakerTraits makerTraits, bytes32 orderHash) external;\\n\\n /**\\n * @notice Cancels orders' quotes\\n * @param makerTraits Orders makerTraits\\n * @param orderHashes Hashes of the orders to cancel\\n */\\n function cancelOrders(MakerTraits[] calldata makerTraits, bytes32[] calldata orderHashes) external;\\n\\n /**\\n * @notice Cancels all quotes of the maker (works for bit-invalidating orders only)\\n * @param makerTraits Order makerTraits\\n * @param additionalMask Additional bitmask to invalidate orders\\n */\\n function bitsInvalidateForOrder(MakerTraits makerTraits, uint256 additionalMask) external;\\n\\n /**\\n * @notice Fills order's quote, fully or partially (whichever is possible).\\n * @param order Order quote to fill\\n * @param r R component of signature\\n * @param vs VS component of signature\\n * @param amount Taker amount to fill\\n * @param takerTraits Specifies threshold as maximum allowed takingAmount when takingAmount is zero, otherwise specifies\\n * minimum allowed makingAmount. The 2nd (0 based index) highest bit specifies whether taker wants to skip maker's permit.\\n * @return makingAmount Actual amount transferred from maker to taker\\n * @return takingAmount Actual amount transferred from taker to maker\\n * @return orderHash Hash of the filled order\\n */\\n function fillOrder(\\n Order calldata order,\\n bytes32 r,\\n bytes32 vs,\\n uint256 amount,\\n TakerTraits takerTraits\\n ) external payable returns(uint256 makingAmount, uint256 takingAmount, bytes32 orderHash);\\n\\n /**\\n * @notice Same as `fillOrder` but allows to specify arguments that are used by the taker.\\n * @param order Order quote to fill\\n * @param r R component of signature\\n * @param vs VS component of signature\\n * @param amount Taker amount to fill\\n * @param takerTraits Specifies threshold as maximum allowed takingAmount when takingAmount is zero, otherwise specifies\\n * minimum allowed makingAmount. The 2nd (0 based index) highest bit specifies whether taker wants to skip maker's permit.\\n * @param args Arguments that are used by the taker (target, extension, interaction, permit)\\n * @return makingAmount Actual amount transferred from maker to taker\\n * @return takingAmount Actual amount transferred from taker to maker\\n * @return orderHash Hash of the filled order\\n */\\n function fillOrderArgs(\\n IOrderMixin.Order calldata order,\\n bytes32 r,\\n bytes32 vs,\\n uint256 amount,\\n TakerTraits takerTraits,\\n bytes calldata args\\n ) external payable returns(uint256 makingAmount, uint256 takingAmount, bytes32 orderHash);\\n\\n /**\\n * @notice Same as `fillOrder` but uses contract-based signatures.\\n * @param order Order quote to fill\\n * @param signature Signature to confirm quote ownership\\n * @param amount Taker amount to fill\\n * @param takerTraits Specifies threshold as maximum allowed takingAmount when takingAmount is zero, otherwise specifies\\n * minimum allowed makingAmount. The 2nd (0 based index) highest bit specifies whether taker wants to skip maker's permit.\\n * @return makingAmount Actual amount transferred from maker to taker\\n * @return takingAmount Actual amount transferred from taker to maker\\n * @return orderHash Hash of the filled order\\n * @dev See tests for examples\\n */\\n function fillContractOrder(\\n Order calldata order,\\n bytes calldata signature,\\n uint256 amount,\\n TakerTraits takerTraits\\n ) external returns(uint256 makingAmount, uint256 takingAmount, bytes32 orderHash);\\n\\n /**\\n * @notice Same as `fillContractOrder` but allows to specify arguments that are used by the taker.\\n * @param order Order quote to fill\\n * @param signature Signature to confirm quote ownership\\n * @param amount Taker amount to fill\\n * @param takerTraits Specifies threshold as maximum allowed takingAmount when takingAmount is zero, otherwise specifies\\n * minimum allowed makingAmount. The 2nd (0 based index) highest bit specifies whether taker wants to skip maker's permit.\\n * @param args Arguments that are used by the taker (target, extension, interaction, permit)\\n * @return makingAmount Actual amount transferred from maker to taker\\n * @return takingAmount Actual amount transferred from taker to maker\\n * @return orderHash Hash of the filled order\\n * @dev See tests for examples\\n */\\n function fillContractOrderArgs(\\n Order calldata order,\\n bytes calldata signature,\\n uint256 amount,\\n TakerTraits takerTraits,\\n bytes calldata args\\n ) external returns(uint256 makingAmount, uint256 takingAmount, bytes32 orderHash);\\n\\n /**\\n * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes\\n * @param maker Maker address\\n * @param slot Slot number to return bitmask for\\n * @return result Each bit represents whether corresponding was already invalidated\\n */\\n function bitInvalidatorForOrder(address maker, uint256 slot) external view returns(uint256 result);\\n\\n /**\\n * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes\\n * @param orderHash Hash of the order\\n * @return remaining Remaining amount of the order\\n */\\n function remainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remaining);\\n\\n /**\\n * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes\\n * @param orderHash Hash of the order\\n * @return remainingRaw Inverse of the remaining amount of the order if order was filled at least once, otherwise 0\\n */\\n function rawRemainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remainingRaw);\\n\\n /**\\n * @notice Returns order hash, hashed with limit order protocol contract EIP712\\n * @param order Order\\n * @return orderHash Hash of the order\\n */\\n function hashOrder(IOrderMixin.Order calldata order) external view returns(bytes32 orderHash);\\n}\\n\",\"keccak256\":\"0x39cfb84ae74a276eae63d7b3be898104045f98163405190227ddae3e85f6dd11\",\"license\":\"MIT\"},\"contracts/libraries/AmountCalculatorLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n/// @title The helper library to calculate linearly taker amount from maker amount and vice versa.\\nlibrary AmountCalculatorLib {\\n /// @notice Calculates maker amount\\n /// @return Result Floored maker amount\\n function getMakingAmount(uint256 orderMakerAmount, uint256 orderTakerAmount, uint256 swapTakerAmount) internal pure returns(uint256) {\\n if ((swapTakerAmount | orderMakerAmount) >> 128 == 0) {\\n unchecked {\\n return (swapTakerAmount * orderMakerAmount) / orderTakerAmount;\\n }\\n }\\n return swapTakerAmount * orderMakerAmount / orderTakerAmount;\\n }\\n\\n /// @notice Calculates taker amount\\n /// @return Result Ceiled taker amount\\n function getTakingAmount(uint256 orderMakerAmount, uint256 orderTakerAmount, uint256 swapMakerAmount) internal pure returns(uint256) {\\n if ((swapMakerAmount | orderTakerAmount) >> 128 == 0) {\\n unchecked {\\n return (swapMakerAmount * orderTakerAmount + orderMakerAmount - 1) / orderMakerAmount;\\n }\\n }\\n return (swapMakerAmount * orderTakerAmount + orderMakerAmount - 1) / orderMakerAmount;\\n }\\n}\\n\",\"keccak256\":\"0x1c7cf84e7c9ffb482edb56ab755567d718d29dd5149aaa1469fa290001cb5b24\",\"license\":\"MIT\"},\"contracts/libraries/ExtensionLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interfaces/IOrderMixin.sol\\\";\\nimport \\\"./OffsetsLib.sol\\\";\\n\\n/**\\n * @title ExtensionLib\\n * @notice Library for retrieving extensions information for the IOrderMixin Interface.\\n */\\nlibrary ExtensionLib {\\n using AddressLib for Address;\\n using OffsetsLib for Offsets;\\n\\n enum DynamicField {\\n MakerAssetSuffix,\\n TakerAssetSuffix,\\n MakingAmountData,\\n TakingAmountData,\\n Predicate,\\n MakerPermit,\\n PreInteractionData,\\n PostInteractionData,\\n CustomData\\n }\\n\\n /**\\n * @notice Returns the MakerAssetSuffix from the provided extension calldata.\\n * @param extension The calldata from which the MakerAssetSuffix is to be retrieved.\\n * @return calldata Bytes representing the MakerAssetSuffix.\\n */\\n function makerAssetSuffix(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.MakerAssetSuffix);\\n }\\n\\n /**\\n * @notice Returns the TakerAssetSuffix from the provided extension calldata.\\n * @param extension The calldata from which the TakerAssetSuffix is to be retrieved.\\n * @return calldata Bytes representing the TakerAssetSuffix.\\n */\\n function takerAssetSuffix(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.TakerAssetSuffix);\\n }\\n\\n /**\\n * @notice Returns the MakingAmountData from the provided extension calldata.\\n * @param extension The calldata from which the MakingAmountData is to be retrieved.\\n * @return calldata Bytes representing the MakingAmountData.\\n */\\n function makingAmountData(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.MakingAmountData);\\n }\\n\\n /**\\n * @notice Returns the TakingAmountData from the provided extension calldata.\\n * @param extension The calldata from which the TakingAmountData is to be retrieved.\\n * @return calldata Bytes representing the TakingAmountData.\\n */\\n function takingAmountData(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.TakingAmountData);\\n }\\n\\n /**\\n * @notice Returns the order's predicate from the provided extension calldata.\\n * @param extension The calldata from which the predicate is to be retrieved.\\n * @return calldata Bytes representing the predicate.\\n */\\n function predicate(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.Predicate);\\n }\\n\\n /**\\n * @notice Returns the maker's permit from the provided extension calldata.\\n * @param extension The calldata from which the maker's permit is to be retrieved.\\n * @return calldata Bytes representing the maker's permit.\\n */\\n function makerPermit(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.MakerPermit);\\n }\\n\\n\\n /**\\n * @notice Returns the pre-interaction from the provided extension calldata.\\n * @param extension The calldata from which the pre-interaction is to be retrieved.\\n * @return calldata Bytes representing the pre-interaction.\\n */\\n function preInteractionTargetAndData(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.PreInteractionData);\\n }\\n\\n /**\\n * @notice Returns the post-interaction from the provided extension calldata.\\n * @param extension The calldata from which the post-interaction is to be retrieved.\\n * @return calldata Bytes representing the post-interaction.\\n */\\n function postInteractionTargetAndData(bytes calldata extension) internal pure returns(bytes calldata) {\\n return _get(extension, DynamicField.PostInteractionData);\\n }\\n\\n /**\\n * @notice Returns extra suffix data from the provided extension calldata.\\n * @param extension The calldata from which the extra suffix data is to be retrieved.\\n * @return calldata Bytes representing the extra suffix data.\\n */\\n function customData(bytes calldata extension) internal pure returns(bytes calldata) {\\n if (extension.length < 0x20) return msg.data[:0];\\n uint256 offsets = uint256(bytes32(extension));\\n unchecked {\\n return extension[0x20 + (offsets >> 224):];\\n }\\n }\\n\\n /**\\n * @notice Retrieves a specific field from the provided extension calldata.\\n * @dev The first 32 bytes of an extension calldata contain offsets to the end of each field within the calldata.\\n * @param extension The calldata from which the field is to be retrieved.\\n * @param field The specific dynamic field to retrieve from the extension.\\n * @return calldata Bytes representing the requested field.\\n */\\n function _get(bytes calldata extension, DynamicField field) private pure returns(bytes calldata) {\\n if (extension.length < 0x20) return msg.data[:0];\\n\\n Offsets offsets;\\n bytes calldata concat;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n offsets := calldataload(extension.offset)\\n concat.offset := add(extension.offset, 0x20)\\n concat.length := sub(extension.length, 0x20)\\n }\\n\\n return offsets.get(concat, uint256(field));\\n }\\n}\\n\",\"keccak256\":\"0x0e1ef5b959f77126f61c10e11fcd6043832baf9260cfb2bcf9bff8e446bae65d\",\"license\":\"MIT\"},\"contracts/libraries/MakerTraitsLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ntype MakerTraits is uint256;\\n\\n/**\\n * @title MakerTraitsLib\\n * @notice A library to manage and check MakerTraits, which are used to encode the maker's preferences for an order in a single uint256.\\n * @dev\\n * The MakerTraits type is a uint256 and different parts of the number are used to encode different traits.\\n * High bits are used for flags\\n * 255 bit `NO_PARTIAL_FILLS_FLAG` - if set, the order does not allow partial fills\\n * 254 bit `ALLOW_MULTIPLE_FILLS_FLAG` - if set, the order permits multiple fills\\n * 253 bit - unused\\n * 252 bit `PRE_INTERACTION_CALL_FLAG` - if set, the order requires pre-interaction call\\n * 251 bit `POST_INTERACTION_CALL_FLAG` - if set, the order requires post-interaction call\\n * 250 bit `NEED_CHECK_EPOCH_MANAGER_FLAG` - if set, the order requires to check the epoch manager\\n * 249 bit `HAS_EXTENSION_FLAG` - if set, the order has extension(s)\\n * 248 bit `USE_PERMIT2_FLAG` - if set, the order uses permit2\\n * 247 bit `UNWRAP_WETH_FLAG` - if set, the order requires to unwrap WETH\\n\\n * Low 200 bits are used for allowed sender, expiration, nonceOrEpoch, and series\\n * uint80 last 10 bytes of allowed sender address (0 if any)\\n * uint40 expiration timestamp (0 if none)\\n * uint40 nonce or epoch\\n * uint40 series\\n */\\nlibrary MakerTraitsLib {\\n // Low 200 bits are used for allowed sender, expiration, nonceOrEpoch, and series\\n uint256 private constant _ALLOWED_SENDER_MASK = type(uint80).max;\\n uint256 private constant _EXPIRATION_OFFSET = 80;\\n uint256 private constant _EXPIRATION_MASK = type(uint40).max;\\n uint256 private constant _NONCE_OR_EPOCH_OFFSET = 120;\\n uint256 private constant _NONCE_OR_EPOCH_MASK = type(uint40).max;\\n uint256 private constant _SERIES_OFFSET = 160;\\n uint256 private constant _SERIES_MASK = type(uint40).max;\\n\\n uint256 private constant _NO_PARTIAL_FILLS_FLAG = 1 << 255;\\n uint256 private constant _ALLOW_MULTIPLE_FILLS_FLAG = 1 << 254;\\n uint256 private constant _PRE_INTERACTION_CALL_FLAG = 1 << 252;\\n uint256 private constant _POST_INTERACTION_CALL_FLAG = 1 << 251;\\n uint256 private constant _NEED_CHECK_EPOCH_MANAGER_FLAG = 1 << 250;\\n uint256 private constant _HAS_EXTENSION_FLAG = 1 << 249;\\n uint256 private constant _USE_PERMIT2_FLAG = 1 << 248;\\n uint256 private constant _UNWRAP_WETH_FLAG = 1 << 247;\\n\\n /**\\n * @notice Checks if the order has the extension flag set.\\n * @dev If the `HAS_EXTENSION_FLAG` is set in the makerTraits, then the protocol expects that the order has extension(s).\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the flag is set.\\n */\\n function hasExtension(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _HAS_EXTENSION_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the maker allows a specific taker to fill the order.\\n * @param makerTraits The traits of the maker.\\n * @param sender The address of the taker to be checked.\\n * @return result A boolean indicating whether the taker is allowed.\\n */\\n function isAllowedSender(MakerTraits makerTraits, address sender) internal pure returns (bool) {\\n uint160 allowedSender = uint160(MakerTraits.unwrap(makerTraits) & _ALLOWED_SENDER_MASK);\\n return allowedSender == 0 || allowedSender == uint160(sender) & _ALLOWED_SENDER_MASK;\\n }\\n\\n /**\\n * @notice Returns the expiration time of the order.\\n * @param makerTraits The traits of the maker.\\n * @return result The expiration timestamp of the order.\\n */\\n function getExpirationTime(MakerTraits makerTraits) internal pure returns (uint256) {\\n return (MakerTraits.unwrap(makerTraits) >> _EXPIRATION_OFFSET) & _EXPIRATION_MASK;\\n }\\n\\n /**\\n * @notice Checks if the order has expired.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the order has expired.\\n */\\n function isExpired(MakerTraits makerTraits) internal view returns (bool) {\\n uint256 expiration = getExpirationTime(makerTraits);\\n return expiration != 0 && expiration < block.timestamp; // solhint-disable-line not-rely-on-time\\n }\\n\\n /**\\n * @notice Returns the nonce or epoch of the order.\\n * @param makerTraits The traits of the maker.\\n * @return result The nonce or epoch of the order.\\n */\\n function nonceOrEpoch(MakerTraits makerTraits) internal pure returns (uint256) {\\n return (MakerTraits.unwrap(makerTraits) >> _NONCE_OR_EPOCH_OFFSET) & _NONCE_OR_EPOCH_MASK;\\n }\\n\\n /**\\n * @notice Returns the series of the order.\\n * @param makerTraits The traits of the maker.\\n * @return result The series of the order.\\n */\\n function series(MakerTraits makerTraits) internal pure returns (uint256) {\\n return (MakerTraits.unwrap(makerTraits) >> _SERIES_OFFSET) & _SERIES_MASK;\\n }\\n\\n /**\\n * @notice Determines if the order allows partial fills.\\n * @dev If the _NO_PARTIAL_FILLS_FLAG is not set in the makerTraits, then the order allows partial fills.\\n * @param makerTraits The traits of the maker, determining their preferences for the order.\\n * @return result A boolean indicating whether the maker allows partial fills.\\n */\\n function allowPartialFills(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _NO_PARTIAL_FILLS_FLAG) == 0;\\n }\\n\\n /**\\n * @notice Checks if the maker needs pre-interaction call.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the maker needs a pre-interaction call.\\n */\\n function needPreInteractionCall(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _PRE_INTERACTION_CALL_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the maker needs post-interaction call.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the maker needs a post-interaction call.\\n */\\n function needPostInteractionCall(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _POST_INTERACTION_CALL_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Determines if the order allows multiple fills.\\n * @dev If the _ALLOW_MULTIPLE_FILLS_FLAG is set in the makerTraits, then the maker allows multiple fills.\\n * @param makerTraits The traits of the maker, determining their preferences for the order.\\n * @return result A boolean indicating whether the maker allows multiple fills.\\n */\\n function allowMultipleFills(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _ALLOW_MULTIPLE_FILLS_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Determines if an order should use the bit invalidator or remaining amount validator.\\n * @dev The bit invalidator can be used if the order does not allow partial or multiple fills.\\n * @param makerTraits The traits of the maker, determining their preferences for the order.\\n * @return result A boolean indicating whether the bit invalidator should be used.\\n * True if the order requires the use of the bit invalidator.\\n */\\n function useBitInvalidator(MakerTraits makerTraits) internal pure returns (bool) {\\n return !allowPartialFills(makerTraits) || !allowMultipleFills(makerTraits);\\n }\\n\\n /**\\n * @notice Checks if the maker needs to check the epoch.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the maker needs to check the epoch manager.\\n */\\n function needCheckEpochManager(MakerTraits makerTraits) internal pure returns (bool) {\\n return (MakerTraits.unwrap(makerTraits) & _NEED_CHECK_EPOCH_MANAGER_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the maker uses permit2.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the maker uses permit2.\\n */\\n function usePermit2(MakerTraits makerTraits) internal pure returns (bool) {\\n return MakerTraits.unwrap(makerTraits) & _USE_PERMIT2_FLAG != 0;\\n }\\n\\n /**\\n * @notice Checks if the maker needs to unwraps WETH.\\n * @param makerTraits The traits of the maker.\\n * @return result A boolean indicating whether the maker needs to unwrap WETH.\\n */\\n function unwrapWeth(MakerTraits makerTraits) internal pure returns (bool) {\\n return MakerTraits.unwrap(makerTraits) & _UNWRAP_WETH_FLAG != 0;\\n }\\n}\\n\",\"keccak256\":\"0x9506febc99293a286356a03cb150ad82ccb88be1b4c908183e1273b41fcb902c\",\"license\":\"MIT\"},\"contracts/libraries/OffsetsLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ntype Offsets is uint256;\\n\\n/// @title OffsetsLib\\n/// @dev A library for retrieving values by offsets from a concatenated calldata.\\nlibrary OffsetsLib {\\n\\n /// @dev Error to be thrown when the offset is out of bounds.\\n error OffsetOutOfBounds();\\n\\n /**\\n * @notice Retrieves the field value calldata corresponding to the provided field index from the concatenated calldata.\\n * @dev \\n * The function performs the following steps:\\n * 1. Retrieve the start and end of the segment corresponding to the provided index from the offsets array.\\n * 2. Get the value from segment using offset and length calculated based on the start and end of the segment.\\n * 3. Throw `OffsetOutOfBounds` error if the length of the segment is greater than the length of the concatenated data.\\n * @param offsets The offsets encoding the start and end of each segment within the concatenated calldata.\\n * @param concat The concatenated calldata.\\n * @param index The index of the segment to retrieve. The field index 0 corresponds to the lowest bytes of the offsets array.\\n * @return result The calldata from a segment of the concatenated calldata corresponding to the provided index.\\n */\\n function get(Offsets offsets, bytes calldata concat, uint256 index) internal pure returns(bytes calldata result) {\\n bytes4 exception = OffsetOutOfBounds.selector;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let bitShift := shl(5, index) // bitShift = index * 32\\n let begin := and(0xffffffff, shr(bitShift, shl(32, offsets))) // begin = offsets[ bitShift : bitShift + 32 ]\\n let end := and(0xffffffff, shr(bitShift, offsets)) // end = offsets[ bitShift + 32 : bitShift + 64 ]\\n result.offset := add(concat.offset, begin)\\n result.length := sub(end, begin)\\n if gt(end, concat.length) {\\n mstore(0, exception)\\n revert(0, 4)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb28030050b4c7b78e0ab596a98d3f437c1fce386b8de0a56a557209e0754636b\",\"license\":\"MIT\"},\"contracts/libraries/TakerTraitsLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ntype TakerTraits is uint256;\\n\\n/**\\n * @title TakerTraitsLib\\n * @notice This library to manage and check TakerTraits, which are used to encode the taker's preferences for an order in a single uint256.\\n * @dev The TakerTraits are structured as follows:\\n * High bits are used for flags\\n * 255 bit `_MAKER_AMOUNT_FLAG` - If set, the taking amount is calculated based on making amount, otherwise making amount is calculated based on taking amount.\\n * 254 bit `_UNWRAP_WETH_FLAG` - If set, the WETH will be unwrapped into ETH before sending to taker.\\n * 253 bit `_SKIP_ORDER_PERMIT_FLAG` - If set, the order skips maker's permit execution.\\n * 252 bit `_USE_PERMIT2_FLAG` - If set, the order uses the permit2 function for authorization.\\n * 251 bit `_ARGS_HAS_TARGET` - If set, then first 20 bytes of args are treated as target address for maker\\u2019s funds transfer.\\n * 224-247 bits `ARGS_EXTENSION_LENGTH` - The length of the extension calldata in the args.\\n * 200-223 bits `ARGS_INTERACTION_LENGTH` - The length of the interaction calldata in the args.\\n * 0-184 bits - The threshold amount (the maximum amount a taker agrees to give in exchange for a making amount).\\n */\\nlibrary TakerTraitsLib {\\n uint256 private constant _MAKER_AMOUNT_FLAG = 1 << 255;\\n uint256 private constant _UNWRAP_WETH_FLAG = 1 << 254;\\n uint256 private constant _SKIP_ORDER_PERMIT_FLAG = 1 << 253;\\n uint256 private constant _USE_PERMIT2_FLAG = 1 << 252;\\n uint256 private constant _ARGS_HAS_TARGET = 1 << 251;\\n\\n uint256 private constant _ARGS_EXTENSION_LENGTH_OFFSET = 224;\\n uint256 private constant _ARGS_EXTENSION_LENGTH_MASK = 0xffffff;\\n uint256 private constant _ARGS_INTERACTION_LENGTH_OFFSET = 200;\\n uint256 private constant _ARGS_INTERACTION_LENGTH_MASK = 0xffffff;\\n\\n uint256 private constant _AMOUNT_MASK = 0x000000000000000000ffffffffffffffffffffffffffffffffffffffffffffff;\\n\\n /**\\n * @notice Checks if the args should contain target address.\\n * @param takerTraits The traits of the taker.\\n * @return result A boolean indicating whether the args should contain target address.\\n */\\n function argsHasTarget(TakerTraits takerTraits) internal pure returns (bool) {\\n return (TakerTraits.unwrap(takerTraits) & _ARGS_HAS_TARGET) != 0;\\n }\\n\\n /**\\n * @notice Retrieves the length of the extension calldata from the takerTraits.\\n * @param takerTraits The traits of the taker.\\n * @return result The length of the extension calldata encoded in the takerTraits.\\n */\\n function argsExtensionLength(TakerTraits takerTraits) internal pure returns (uint256) {\\n return (TakerTraits.unwrap(takerTraits) >> _ARGS_EXTENSION_LENGTH_OFFSET) & _ARGS_EXTENSION_LENGTH_MASK;\\n }\\n\\n /**\\n * @notice Retrieves the length of the interaction calldata from the takerTraits.\\n * @param takerTraits The traits of the taker.\\n * @return result The length of the interaction calldata encoded in the takerTraits.\\n */\\n function argsInteractionLength(TakerTraits takerTraits) internal pure returns (uint256) {\\n return (TakerTraits.unwrap(takerTraits) >> _ARGS_INTERACTION_LENGTH_OFFSET) & _ARGS_INTERACTION_LENGTH_MASK;\\n }\\n\\n /**\\n * @notice Checks if the taking amount should be calculated based on making amount.\\n * @param takerTraits The traits of the taker.\\n * @return result A boolean indicating whether the taking amount should be calculated based on making amount.\\n */\\n function isMakingAmount(TakerTraits takerTraits) internal pure returns (bool) {\\n return (TakerTraits.unwrap(takerTraits) & _MAKER_AMOUNT_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the order should unwrap WETH and send ETH to taker.\\n * @param takerTraits The traits of the taker.\\n * @return result A boolean indicating whether the order should unwrap WETH.\\n */\\n function unwrapWeth(TakerTraits takerTraits) internal pure returns (bool) {\\n return (TakerTraits.unwrap(takerTraits) & _UNWRAP_WETH_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the order should skip maker's permit execution.\\n * @param takerTraits The traits of the taker.\\n * @return result A boolean indicating whether the order don't apply permit.\\n */\\n function skipMakerPermit(TakerTraits takerTraits) internal pure returns (bool) {\\n return (TakerTraits.unwrap(takerTraits) & _SKIP_ORDER_PERMIT_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Checks if the order uses the permit2 instead of permit.\\n * @param takerTraits The traits of the taker.\\n * @return result A boolean indicating whether the order uses the permit2.\\n */\\n function usePermit2(TakerTraits takerTraits) internal pure returns (bool) {\\n return (TakerTraits.unwrap(takerTraits) & _USE_PERMIT2_FLAG) != 0;\\n }\\n\\n /**\\n * @notice Retrieves the threshold amount from the takerTraits.\\n * The maximum amount a taker agrees to give in exchange for a making amount.\\n * @param takerTraits The traits of the taker.\\n * @return result The threshold amount encoded in the takerTraits.\\n */\\n function threshold(TakerTraits takerTraits) internal pure returns (uint256) {\\n return TakerTraits.unwrap(takerTraits) & _AMOUNT_MASK;\\n }\\n}\\n\",\"keccak256\":\"0x144f154a46e8daa0fec5b8215f1d8d3b694cb939236aa7bf89976b27965c2837\",\"license\":\"MIT\"},\"contracts/mocks/EIP712Alien.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712Alien {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n address private immutable _ALIEN_ADDRESS;\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(address alien, string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n _ALIEN_ADDRESS = alien;\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion, alien);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION, _ALIEN_ADDRESS);\\n }\\n }\\n\\n function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version, address alien) private view returns (bytes32) {\\n return keccak256(\\n abi.encode(\\n typeHash,\\n name,\\n version,\\n block.chainid,\\n alien\\n )\\n );\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0xe9488aa6b1b184370251fff0c378a09313dc1670b4c626a76ab6e3b7a3ecfe97\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101606040818152346200027a576200232180380380916200002282866200027e565b843982019160c0818403126200027a5780516001600160a01b0380821693918490036200027a57602083015193818516908186036200027a5783850151918383168093036200027a576060860151608087015190966001600160401b03918281116200027a578a62000096918301620002c5565b9960a08201518381116200027a57620000b09201620002c5565b331562000263575f8054336001600160a01b03198216811783558951959290918916907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a38a5160208c01209a82516020840120966101209b8c528c60c0528760e0524660a05260208601977f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f9d8e8a528b88015260608701524660808701528260a087015260a0865260c0860197868910868a11176200024f57888b52865190206080526101009c8d52611634928387019760c08901968a8810908811176200024f57620001e796620001d19562000ced8c39523060e08901528d8801528b870152610140998a87015260e06101608701526101a086019062000320565b9060bf1994610180868285030191015262000320565b0301905ff08015620002455716825251916109a5938462000348853960805184610843015260a0518461081d015260c05184610892015260e051846108b80152518361086f015251826108f901525181818161029501526107830152f35b82513d5f823e3d90fd5b634e487b7160e01b5f52604160045260245ffd5b8651631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b601f909101601f19168101906001600160401b038211908210176200024f57604052565b5f5b838110620002b45750505f910152565b8181015183820152602001620002a4565b81601f820112156200027a5780516001600160401b0381116200024f5760405192620002fc601f8301601f1916602001856200027e565b818452602082840101116200027a576200031d9160208085019101620002a2565b90565b906020916200033b81518092818552858086019101620002a2565b601f01601f191601019056fe608060409080825260049081361015610016575f80fd5b5f3560e01c9081633a4741bd1461073b575080636ccae0541461060a578063715018a6146105705780638c72b608146101975780638da5cb5b146101465763f2fde38b14610062575f80fd5b346101425760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576100996107a7565b906100a26107ca565b73ffffffffffffffffffffffffffffffffffffffff8092169283156101135750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b8234610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5061010091827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425773ffffffffffffffffffffffffffffffffffffffff926024928484351633810361053b575060443585811680158015610532575b610504575060a435908134036104cf5761021161081a565b928551976102837f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c95868b52878460208d0137610120809b2090604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b6e5af43d82803e903d91602b57fd5bf37f0000000000000000000000000000000000000000000000000000000000000000763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff8260881c16175f5260781b17602052603760095ff5169687156104a757873b156101425786517f501016d50000000000000000000000000000000000000000000000000000000081525f818481348d5af1801561049d5761045b575b5086519586019086821067ffffffffffffffff83111761043157509361041593602099937f283d7294adf3707552a0898f20486ec8259aa76a7911d7e12229462afe5d326897936080978a523584528884015260643560608401526084358684015260a083015260c43560c083015260e43560e083015287898301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06103d161081a565b920192835191845283209252604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b835190338252868201528484820152346060820152a151908152f35b6041837f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b67ffffffffffffffff81116104725787525f61032c565b506041827f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b88513d5f823e3d90fd5b5085517fb06ebf3d000000000000000000000000000000000000000000000000000000008152fd5b60448387848851927fa48641520000000000000000000000000000000000000000000000000000000084528301523490820152fd5b9250509151917ffa4f3704000000000000000000000000000000000000000000000000000000008352820152fd5b503081146101f9565b60449250848451927f8b022b830000000000000000000000000000000000000000000000000000000084523390840152820152fd5b34610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576105a66107ca565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b50346101425760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576106426107a7565b9073ffffffffffffffffffffffffffffffffffffffff602435818116929183820361014257604435946106736107ca565b1690816106a5575050505f808093819382821561069c575bf11561069357005b513d5f823e3d90fd5b506108fc61068b565b5f91935060449060209396958651917fa9059cbb00000000000000000000000000000000000000000000000000000000835288830152602482015282855af19081610719575b50156106f357005b517ffb7f5079000000000000000000000000000000000000000000000000000000008152fd5b90503d15610733575060015f5114601f3d11165b5f6106eb565b3b151561072d565b34610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361014257565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107ea57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b467f000000000000000000000000000000000000000000000000000000000000000003610865577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f000000000000000000000000000000000000000000000000000000000000000082527f000000000000000000000000000000000000000000000000000000000000000060408201527f0000000000000000000000000000000000000000000000000000000000000000606082015246608082015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660a082015260a0815260c0810181811067ffffffffffffffff8211176109425760405251902090565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea2646970667358221220a5b05225c7e065476bba6209375e06b35943f7ec353584bb7fc046b2831ef78f64736f6c6343000817003361022080604052346200021e5762001634803803809162000021828562000222565b833981019060e0818303126200021e5780516001600160a01b0380821691908282036200021e57620000566020850162000246565b90620000656040860162000246565b60608601519382851685036200021e57608087015160a08801516001600160401b0398919791908981116200021e578a620000a29183016200025b565b9960c08201518a81116200021e57620000bc92016200025b565b98602081519101209860208151910120610120948486528a60c0528160e0524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f9c8d855260408401526060830152466080830152851660a082015260a0815260c0810199818b10908b11176200020a57896040525190206080526101009889526101409081526101a0933085526101609283526101809384526101c09586526101e0968752610200978852611364998a620002d08b396080518a61104b015260a0518a611025015260c0518a61109a015260e0518a6110c001525189611077015251886111010152518760320152518681816101cb0152818161041c0152818161070501526109b5015251858181610239015261046e015251845050518381816103f1015261065401525182818161015001526108a001525181610b6c0152f35b634e487b7160e01b5f52604160045260245ffd5b5f80fd5b601f909101601f19168101906001600160401b038211908210176200020a57604052565b51906001600160a01b03821682036200021e57565b919080601f840112156200021e5782516001600160401b0381116200020a57602090604051926200029683601f19601f850116018562000222565b8184528282870101116200021e575f5b818110620002bb5750825f9394955001015290565b8581018301518482018401528201620002a656fe60406080815260049081361015610080575b361561001b575f80fd5b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016330361005a57005b517f1b10b0f9000000000000000000000000000000000000000000000000000000008152fd5b5f3560e01c80631626ba7e14610d115780631b75972c146108435780633a091853146105a6578063501016d5146103b057636ccae054036100115790346103035760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103035780359073ffffffffffffffffffffffffffffffffffffffff918281168091036103035760243590838216928383036103035785517f70a082310000000000000000000000000000000000000000000000000000000081523382820152604435956020917f00000000000000000000000000000000000000000000000000000000000000008216908381602481855afa9081156103a6575f91610379575b50156103265750836101c35750505050505f80809381938282156101ba575bf1156101b157505b005b513d5f823e3d90fd5b506108fc6101a7565b9091929394507f000000000000000000000000000000000000000000000000000000000000000016928381145f14610318575085517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523083820190815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660208201529091908190839081906040010381875afa90811561030e575f916102da575b50610292915061028d308561127f565b610fe8565b8085116102a55750506101af93506111e7565b60449250848651927fec2ecfde0000000000000000000000000000000000000000000000000000000084528301526024820152fd5b905081813d8311610307575b6102f08183610dfa565b810103126103035761029290515f61027d565b5f80fd5b503d6102e6565b87513d5f823e3d90fd5b925050506101af93506111e7565b88517fd3445e800000000000000000000000000000000000000000000000000000000081523381860190815273ffffffffffffffffffffffffffffffffffffffff90921660208301529081906040010390fd5b90508381813d831161039f575b6103908183610dfa565b8101031261030357515f610188565b503d610386565b8a513d5f823e3d90fd5b505f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103035773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000818116330361055357507f00000000000000000000000000000000000000000000000000000000000000007fd0e30db0000000000000000000000000000000000000000000000000000000005f525f80858134855af11561054957167f0000000000000000000000000000000000000000000000000000000000000000906104993483836112ca565b156104a057005b60205f604485517f095ea7b3000000000000000000000000000000000000000000000000000000008152858882015282602482015282855af18061052a575b15918215610516575b50506104f057005b517f19be9a90000000000000000000000000000000000000000000000000000000008152fd5b610522925034916112ca565b155f806104e8565b503d156105405760015f5114601f3d11166104df565b803b15156104df565b82513d5f823e3d90fd5b82517f1f71d67d0000000000000000000000000000000000000000000000000000000081523381860190815273ffffffffffffffffffffffffffffffffffffffff90921660208301529081906040010390fd5b50903461030357610100807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610303576106526106e3916101206105eb611022565b918651907f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c82528660208301372090604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b7f0000000000000000000000000000000000000000000000000000000000000000908173ffffffffffffffffffffffffffffffffffffffff926055926043926040519260388401526f5af43d82803e903d91602b57fd5bf3ff60248401526014830152733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c820120607882015201201690565b73ffffffffffffffffffffffffffffffffffffffff9030828216036107ef57507f00000000000000000000000000000000000000000000000000000000000000006107303083831661127f565b9283156107c85760245f8080948782957f2e1a7d4d000000000000000000000000000000000000000000000000000000008452525af115610549575f80808481946024351682f1156107be57907f84d669b9ea8666709ee6bd1b617534aac0106acfa94c9364a322a36b5a6362eb916107b06107ab36610e3b565b61114a565b9082519182526020820152a1005b50513d5f823e3d90fd5b84517fce268e60000000000000000000000000000000000000000000000000000000008152fd5b83517f41b9adfc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116928101928352306020840152918291506040010390fd5b509034610303577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360190610120908183126103035761010080931261030357610104359173ffffffffffffffffffffffffffffffffffffffff807f000000000000000000000000000000000000000000000000000000000000000016948651927f70a08231000000000000000000000000000000000000000000000000000000008452338585015260209660249488818781855afa9081156103a6575f91610ce4575b5015610c91575064ffffffffff60e43560501c169586151580610c88575b610c53575f9681610b5b575b50506109a99161065291610943611022565b918a51907f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c8252888b8301372090604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b3082821603610b0957507f00000000000000000000000000000000000000000000000000000000000000006109e03083831661127f565b938415610ae257835f8080948882957f2e1a7d4d000000000000000000000000000000000000000000000000000000008452525af115610acf578315848115610aa6575b50508215918215610a72575b7f22770c588cf5c5f476664dc9b7c78816ad26f3d653e290d5a4f0053f015ae9ea606087878a88610a636107ab36610e3b565b938251948552840152820152a1005b5f848194829483948492610a9c575b351690f115610a92575f8080610a30565b83513d5f823e3d90fd5b6108fc9250610a81565b909381610ab291610fe8565b935f90610ad9575b5f80809381933390f115610acf575f84610a24565b85513d5f823e3d90fd5b506108fc610aba565b87517fce268e60000000000000000000000000000000000000000000000000000000008152fd5b86517f41b9adfc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911681850190815230602082015281906040010390fd5b90919650610b698142610fe8565b907f0000000000000000000000000000000000000000000000000000000000000000809210610c15575050617530804802904882041448151715610bea576906fceeff6681b2a00000480290808204670f43fc2c04ee00001490151715610bea57670de0b6b3a7640000900480821891811191909102189481610652610931565b846011877f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b604491868b610c258a9442610fe8565b9051937f2e00a366000000000000000000000000000000000000000000000000000000008552840152820152fd5b60448688878c51927ff0c82d230000000000000000000000000000000000000000000000000000000084524290840152820152fd5b50864210610925565b88517fd3445e800000000000000000000000000000000000000000000000000000000081523381880190815273ffffffffffffffffffffffffffffffffffffffff90921660208301529081906040010390fd5b90508881813d8311610d0a575b610cfb8183610dfa565b8101031261030357515f610907565b503d610cf1565b503461030357807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610303576024359167ffffffffffffffff8084116103035736602385011215610303578382013590811161030357602436918501011161030357610da87fffffffff00000000000000000000000000000000000000000000000000000000916024602095019035610eb2565b915191168152f35b610100810190811067ffffffffffffffff821117610dcd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610dcd57604052565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6101009101126103035760405190610e7382610db0565b6004358252602435602083015260443560408301526064356060830152608435608083015260a43560a083015260c43560c083015260e43560e0830152565b90610ebb611022565b610f30610652604051927f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c845261012061010094858760208301372090604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b73ffffffffffffffffffffffffffffffffffffffff30911603610fe1578136031261030357610fb49060e060405191610f6883610db0565b803583526020810135602084015260408101356040840152606081013560608401526080810135608084015260a081013560a084015260c081013560c0840152013560e082015261114a565b03610fdd577f1626ba7e0000000000000000000000000000000000000000000000000000000090565b5f90565b5050505f90565b91908203918211610ff557565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b467f00000000000000000000000000000000000000000000000000000000000000000361106d577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f000000000000000000000000000000000000000000000000000000000000000082527f000000000000000000000000000000000000000000000000000000000000000060408201527f0000000000000000000000000000000000000000000000000000000000000000606082015246608082015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660a082015260a0815260c0810181811067ffffffffffffffff821117610dcd5760405251902090565b6111e4903060208201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061117d611022565b91019081517f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c835261012083209252604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b90565b9160446020925f92604051917fa9059cbb0000000000000000000000000000000000000000000000000000000083526004830152602482015282855af1908161125d575b501561123357565b60046040517ffb7f5079000000000000000000000000000000000000000000000000000000008152fd5b90503d15611277575060015f5114601f3d11165b5f61122b565b3b1515611271565b60245f80926020947f70a082310000000000000000000000000000000000000000000000000000000083526004525afa5f5191901560203d10176112bf57565b6040513d5f823e3d90fd5b929160446020925f92604051917f095ea7b30000000000000000000000000000000000000000000000000000000083526004830152602482015282865af191826113115750565b9091503d15611328575060015f5114601f3d111690565b3b15159056fea2646970667358221220e90c6dff7030273ff57c2c9864d907806cfa3ad927741bdf6469fbe4c094ae7e64736f6c63430008170033", + "deployedBytecode": "0x608060409080825260049081361015610016575f80fd5b5f3560e01c9081633a4741bd1461073b575080636ccae0541461060a578063715018a6146105705780638c72b608146101975780638da5cb5b146101465763f2fde38b14610062575f80fd5b346101425760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576100996107a7565b906100a26107ca565b73ffffffffffffffffffffffffffffffffffffffff8092169283156101135750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b8234610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5061010091827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425773ffffffffffffffffffffffffffffffffffffffff926024928484351633810361053b575060443585811680158015610532575b610504575060a435908134036104cf5761021161081a565b928551976102837f3af21ec5a20011b88d3b7b4ed7c806cef05a5980cf34974bcd53566a131f7e4c95868b52878460208d0137610120809b2090604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b6e5af43d82803e903d91602b57fd5bf37f0000000000000000000000000000000000000000000000000000000000000000763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff8260881c16175f5260781b17602052603760095ff5169687156104a757873b156101425786517f501016d50000000000000000000000000000000000000000000000000000000081525f818481348d5af1801561049d5761045b575b5086519586019086821067ffffffffffffffff83111761043157509361041593602099937f283d7294adf3707552a0898f20486ec8259aa76a7911d7e12229462afe5d326897936080978a523584528884015260643560608401526084358684015260a083015260c43560c083015260e43560e083015287898301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06103d161081a565b920192835191845283209252604291604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b835190338252868201528484820152346060820152a151908152f35b6041837f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b67ffffffffffffffff81116104725787525f61032c565b506041827f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b88513d5f823e3d90fd5b5085517fb06ebf3d000000000000000000000000000000000000000000000000000000008152fd5b60448387848851927fa48641520000000000000000000000000000000000000000000000000000000084528301523490820152fd5b9250509151917ffa4f3704000000000000000000000000000000000000000000000000000000008352820152fd5b503081146101f9565b60449250848451927f8b022b830000000000000000000000000000000000000000000000000000000084523390840152820152fd5b34610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576105a66107ca565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b50346101425760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610142576106426107a7565b9073ffffffffffffffffffffffffffffffffffffffff602435818116929183820361014257604435946106736107ca565b1690816106a5575050505f808093819382821561069c575bf11561069357005b513d5f823e3d90fd5b506108fc61068b565b5f91935060449060209396958651917fa9059cbb00000000000000000000000000000000000000000000000000000000835288830152602482015282855af19081610719575b50156106f357005b517ffb7f5079000000000000000000000000000000000000000000000000000000008152fd5b90503d15610733575060015f5114601f3d11165b5f6106eb565b3b151561072d565b34610142575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101425760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361014257565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107ea57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b467f000000000000000000000000000000000000000000000000000000000000000003610865577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f000000000000000000000000000000000000000000000000000000000000000082527f000000000000000000000000000000000000000000000000000000000000000060408201527f0000000000000000000000000000000000000000000000000000000000000000606082015246608082015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660a082015260a0815260c0810181811067ffffffffffffffff8211176109425760405251902090565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea2646970667358221220a5b05225c7e065476bba6209375e06b35943f7ec353584bb7fc046b2831ef78f64736f6c63430008170033", + "devdoc": { + "errors": { + "FailedDeployment()": [ + { + "details": "The deployment failed." + } + ], + "InsufficientBalance(uint256,uint256)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ] + }, + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4830, + "contract": "contracts/extensions/NativeOrderFactory.sol:NativeOrderFactory", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file