fluid-contracts-public/deployments/arbitrum/dump/0xA2F84B7328F576fc68e0708f7B486388910Ef26F.json
2024-07-11 13:05:09 +00:00

324 lines
122 KiB
JSON

{
"address": "0xA2F84B7328F576fc68e0708f7B486388910Ef26F",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "vaultT1Factory_",
"type": "address"
},
{
"internalType": "address",
"name": "fluidWalletFactory_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "FluidWallet__NotAllowed",
"type": "error"
},
{
"inputs": [],
"name": "FluidWallet__ToHexDigit",
"type": "error"
},
{
"inputs": [],
"name": "FluidWallet__Unauthorized",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Executed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "ExecutedCast",
"type": "event"
},
{
"inputs": [],
"name": "ETH_ADDRESS",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FLUID_WALLET_FACTORY",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VAULT_T1_FACTORY",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VERSION",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "operation",
"type": "uint8"
}
],
"internalType": "struct FluidWalletErrorsAndEvents.Action[]",
"name": "actions_",
"type": "tuple[]"
}
],
"name": "cast",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
},
{
"internalType": "address",
"name": "initiator_",
"type": "address"
},
{
"internalType": "bytes",
"name": "data_",
"type": "bytes"
}
],
"name": "executeOperation",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator_",
"type": "address"
},
{
"internalType": "address",
"name": "from_",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId_",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data_",
"type": "bytes"
}
],
"name": "onERC721Received",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xa2410ca430d219c89576d7409677356e2c4ecc650f41e0ccc302d2908ec7e226",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
"contractAddress": null,
"transactionIndex": 1,
"gasUsed": "2938375",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xe62909d39b48a0c7497bef7006002571afd5dc1893583d8c2e913a3b86214a75",
"transactionHash": "0xa2410ca430d219c89576d7409677356e2c4ecc650f41e0ccc302d2908ec7e226",
"logs": [],
"blockNumber": 220376210,
"cumulativeGasUsed": "2938375",
"status": 1,
"byzantium": true
},
"args": [
"0xCdFbb1DCBb7A9B92c579e8d96dcaD19aC5f755F9",
"0xd8Ae986159e350B6535539B8A1e488658452f25E"
],
"numDeployments": 1,
"solcInputHash": "1989963ad64c4704dbe1170530c79d20",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vaultT1Factory_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fluidWalletFactory_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FluidWallet__NotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FluidWallet__ToHexDigit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FluidWallet__Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Executed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ExecutedCast\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ETH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FLUID_WALLET_FACTORY\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_T1_FACTORY\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"operation\",\"type\":\"uint8\"}],\"internalType\":\"struct FluidWalletErrorsAndEvents.Action[]\",\"name\":\"actions_\",\"type\":\"tuple[]\"}],\"name\":\"cast\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"initiator_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data_\",\"type\":\"bytes\"}],\"name\":\"executeOperation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data_\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"executeOperation(address[],uint256[],uint256[],address,bytes)\":{\"params\":{\"data_\":\"data bytes containing the `abi.encoded()` actions that are executed like in `CastParams.actions`\",\"initiator_\":\"flashloan initiator -> must be this contract\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"ERC721 callback used Fluid Vault Factory and executes actions encoded in `data_` Caller should be Fluid Wallet Factory.\",\"params\":{\"data_\":\"data bytes containing the `abi.encoded()` actions that are executed like in `Action[]` & `owner`\",\"from_\":\"from_ previous owner of the given token ID\",\"operator_\":\"operator_ caller to transfer the the given token ID\",\"tokenId_\":\"tokenId_ id of the ERC721\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/wallet/wallet/main.sol\":\"FluidWalletImplementation\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xaf297d12d8d4a57fe01a70f0ef38908f208e3faedc577056d0b728fa2f3ccf0c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Clones.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 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 *\\n * _Available since v3.4._\\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 /// @solidity memory-safe-assembly\\n assembly {\\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(0, 0x09, 0x37)\\n }\\n require(instance != address(0), \\\"ERC1167: create failed\\\");\\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 /// @solidity memory-safe-assembly\\n assembly {\\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(0, 0x09, 0x37, salt)\\n }\\n require(instance != address(0), \\\"ERC1167: create2 failed\\\");\\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 /// @solidity memory-safe-assembly\\n assembly {\\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 := keccak256(add(ptr, 0x43), 0x55)\\n }\\n }\\n\\n /**\\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\\n */\\n function predictDeterministicAddress(address implementation, bytes32 salt)\\n internal\\n view\\n returns (address predicted)\\n {\\n return predictDeterministicAddress(implementation, salt, address(this));\\n }\\n}\\n\",\"keccak256\":\"0x888d64d221d52c31d015b76e50ca1af5ef8ff076550810b49cea6b01d8267a10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 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 */\\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 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\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9b72f93be69ca894d8492c244259615c4a742afc8d63720dbc8bb81087d9b238\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xd1556954440b31c97a142c6ba07d5cade45f96fafd52091d33a14ebe365aecbf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\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 /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\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 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] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\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 representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\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 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 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 up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // 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 prod0 := mul(x, y)\\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 return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\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. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\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^256 / 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^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\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 works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\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^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, 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 * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\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 unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\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 log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/periphery/wallet/wallet/main.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IERC721 } from \\\"@openzeppelin/contracts/interfaces/IERC721.sol\\\";\\nimport { IERC20 } from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Clones } from \\\"@openzeppelin/contracts/proxy/Clones.sol\\\";\\nimport { Strings } from \\\"@openzeppelin/contracts/utils/Strings.sol\\\";\\n\\nimport { IFluidVaultFactory } from \\\"../../../protocols/vault/interfaces/iVaultFactory.sol\\\";\\nimport { IFluidVaultT1 } from \\\"../../../protocols/vault/interfaces/iVaultT1.sol\\\";\\n\\ninterface IFluidWalletFactory {\\n function WALLET_PROXY() external view returns(address);\\n}\\n\\ninterface InstaFlashReceiverInterface {\\n function executeOperation(\\n address[] calldata assets,\\n uint256[] calldata amounts,\\n uint256[] calldata premiums,\\n address initiator,\\n bytes calldata _data\\n ) external returns (bool);\\n}\\n\\nabstract contract FluidWalletVariables {\\n /***********************************|\\n | Constants/Immutables |\\n |__________________________________*/\\n string public constant VERSION = \\\"1.0.0\\\";\\n address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n uint256 internal constant X32 = 0xffffffff;\\n\\n address public immutable VAULT_T1_FACTORY;\\n address public immutable FLUID_WALLET_FACTORY;\\n\\n /***********************************|\\n | Slot 0 |\\n |__________________________________*/\\n /// @dev owner address of this wallet. It is initialized while deploying the wallet for the user.\\n address public owner;\\n\\n /***********************************|\\n | Slot 1 |\\n |__________________________________*/\\n /// @dev transient allow hash used to signal allowing certain entry into methods such as executeOperation etc.\\n bytes32 internal _transientAllowHash;\\n \\n function _resetTransientStorage() internal {\\n assembly {\\n sstore(1, 1) // Store 1 in the transient storage 1\\n }\\n }\\n}\\n\\ncontract FluidWalletErrorsAndEvents {\\n error FluidWallet__NotAllowed();\\n error FluidWallet__ToHexDigit();\\n error FluidWallet__Unauthorized();\\n\\n event Executed(\\n address indexed owner,\\n uint256 indexed tokenId\\n );\\n\\n event ExecutedCast(address indexed owner);\\n\\n struct Action {\\n address target;\\n bytes data;\\n uint256 value;\\n uint8 operation;\\n }\\n}\\n\\ncontract FluidWalletImplementation is FluidWalletVariables, FluidWalletErrorsAndEvents {\\n using SafeERC20 for IERC20;\\n \\n constructor(\\n address vaultT1Factory_,\\n address fluidWalletFactory_\\n ) {\\n VAULT_T1_FACTORY = vaultT1Factory_;\\n FLUID_WALLET_FACTORY = fluidWalletFactory_;\\n }\\n\\n /// @dev ERC721 callback used Fluid Vault Factory and executes actions encoded in `data_`\\n /// Caller should be Fluid Wallet Factory.\\n /// @param operator_ operator_ caller to transfer the the given token ID\\n /// @param from_ from_ previous owner of the given token ID\\n /// @param tokenId_ tokenId_ id of the ERC721\\n /// @param data_ data bytes containing the `abi.encoded()` actions that are executed like in `Action[]` & `owner`\\n function onERC721Received(\\n address operator_,\\n address from_,\\n uint256 tokenId_,\\n bytes calldata data_\\n ) external returns (bytes4) {\\n if (msg.sender != address(VAULT_T1_FACTORY)) revert FluidWallet__NotAllowed();\\n if (operator_ != from_) revert FluidWallet__NotAllowed();\\n if (operator_ != FLUID_WALLET_FACTORY) revert FluidWallet__NotAllowed();\\n\\n (address owner_, Action[] memory actions_) = abi.decode(data_, (address, Action[]));\\n\\n /// @dev validate owner by computing wallet address.\\n _validateOwner(owner_);\\n\\n /// @dev execute actions.\\n _executeActions(actions_);\\n\\n /// @dev reset _transientAllowHash to prevent reentrancy\\n _resetTransientStorage();\\n\\n // Transfer tokenId back to main owner\\n if (IERC721(VAULT_T1_FACTORY).ownerOf(tokenId_) == address(this)) {\\n IERC721(VAULT_T1_FACTORY).transferFrom(address(this), owner_, tokenId_);\\n }\\n\\n // flush vault specific tokens to owner address\\n _flushTokens(owner_, tokenId_);\\n\\n emit Executed(owner_, tokenId_);\\n\\n return this.onERC721Received.selector;\\n }\\n\\n function cast(\\n Action[] memory actions_\\n ) public {\\n /// @dev validate owner by computing wallet address.\\n _validateOwner(msg.sender);\\n\\n /// @dev execute actions.\\n _executeActions(actions_);\\n\\n /// @dev reset _transientAllowHash to prevent reentrancy\\n _resetTransientStorage();\\n\\n emit ExecutedCast(msg.sender);\\n }\\n \\n\\n /***********************************|\\n | FLASHLOAN CALLBACK |\\n |__________________________________*/\\n\\n /// @dev callback used by Instadapp Flashloan Aggregator, executes operations while owning\\n /// the flashloaned amounts. `data_` must contain actions, one of them must pay back flashloan\\n // /// @param assets_ assets_ received a flashloan for\\n // /// @param amounts_ flashloaned amounts for each asset\\n // /// @param premiums_ fees to pay for the flashloan\\n /// @param initiator_ flashloan initiator -> must be this contract\\n /// @param data_ data bytes containing the `abi.encoded()` actions that are executed like in `CastParams.actions`\\n\\n function executeOperation(\\n address[] calldata /* assets */,\\n uint256[] calldata /* amounts */,\\n uint256[] calldata /* premiums */,\\n address initiator_,\\n bytes calldata data_\\n ) external returns (bool) {\\n if (\\n !(_transientAllowHash ==\\n bytes32(keccak256(abi.encode(data_, block.timestamp))) &&\\n initiator_ == address(this))\\n ) {\\n revert FluidWallet__Unauthorized();\\n }\\n\\n _executeActions(abi.decode(data_, (Action[])));\\n\\n return true;\\n }\\n\\n /***********************************|\\n | INTERNAL HELPERS |\\n |__________________________________*/\\n\\n /// @notice Calculating the slot ID for Liquidity contract for single mapping\\n function _calculateStorageSlotUintMapping(uint256 slot_, uint key_) internal pure returns (bytes32) {\\n return keccak256(abi.encode(key_, slot_));\\n }\\n\\n function _flushTokens(address owner_, uint256 tokenId_) internal {\\n uint256 tokenConfig_ = IFluidVaultFactory(VAULT_T1_FACTORY).readFromStorage(_calculateStorageSlotUintMapping(3, tokenId_));\\n address vaultAddress_ = IFluidVaultFactory(VAULT_T1_FACTORY).getVaultAddress((tokenConfig_ >> 192) & X32);\\n\\n IFluidVaultT1.ConstantViews memory constants_ = IFluidVaultT1(vaultAddress_).constantsView();\\n\\n if (constants_.supplyToken == ETH_ADDRESS) {\\n uint256 balance_ = address(this).balance;\\n \\n if (balance_ > 0) Address.sendValue(payable(owner_), balance_);\\n } else {\\n uint256 balance_ = IERC20(constants_.supplyToken).balanceOf(address(this));\\n\\n if (balance_ > 0) IERC20(constants_.supplyToken).safeTransfer(owner_, balance_);\\n }\\n \\n if (constants_.borrowToken == ETH_ADDRESS ) {\\n uint256 balance_ = address(this).balance;\\n \\n if (balance_ > 0) Address.sendValue(payable(owner_), balance_);\\n } else {\\n uint256 balance_ = IERC20(constants_.borrowToken).balanceOf(address(this));\\n\\n if (balance_ > 0) IERC20(constants_.borrowToken).safeTransfer(owner_, balance_);\\n }\\n }\\n\\n /// @dev validate `owner` by recomputing fluid address.\\n function _validateOwner(address owner_) internal view {\\n address wallet_ = Clones.predictDeterministicAddress(\\n IFluidWalletFactory(FLUID_WALLET_FACTORY).WALLET_PROXY(),\\n keccak256(abi.encode(owner_)),\\n FLUID_WALLET_FACTORY\\n );\\n if (wallet_ != address(this)) revert FluidWallet__NotAllowed();\\n }\\n\\n /// @dev executes `actions_` with respective target, calldata, operation etc.\\n function _executeActions(Action[] memory actions_) internal {\\n uint256 actionsLength_ = actions_.length;\\n for (uint256 i; i < actionsLength_; ) {\\n Action memory action_ = actions_[i];\\n\\n // execute action\\n bool success_;\\n bytes memory result_;\\n if (action_.operation == 0) {\\n // call (operation = 0)\\n\\n // low-level call will return success true also if action target is not even a contract.\\n // we do not explicitly check for this, default interaction is via UI which can check and handle this.\\n // Also applies to delegatecall etc.\\n (success_, result_) = action_.target.call{ value: action_.value }(action_.data);\\n\\n // handle action failure right after external call to better detect out of gas errors\\n if (!success_) {\\n _handleActionFailure(i, result_);\\n }\\n } else if (action_.operation == 1) {\\n // delegatecall (operation = 1)\\n\\n (success_, result_) = action_.target.delegatecall(action_.data);\\n\\n // reset _transientAllowHash to make sure it can not be set up in any way for reentrancy\\n _resetTransientStorage();\\n\\n // handle action failure right after external call to better detect out of gas errors\\n if (!success_) {\\n _handleActionFailure(i, result_);\\n }\\n } else if (action_.operation == 2) {\\n // flashloan (operation = 2)\\n // flashloan is always executed via .call, flashloan aggregator uses `msg.sender`, so .delegatecall\\n // wouldn't send funds to this contract but rather to the original sender.\\n\\n bytes memory data_ = action_.data;\\n assembly {\\n data_ := add(data_, 4) // Skip function selector (4 bytes)\\n }\\n // get actions data from calldata action_.data. Only supports InstaFlashAggregatorInterface\\n (, , , data_, ) = abi.decode(data_, (address[], uint256[], uint256, bytes, bytes));\\n\\n // set allowHash to signal allowed entry into executeOperation()\\n _transientAllowHash = bytes32(\\n keccak256(abi.encode(data_, block.timestamp))\\n );\\n\\n // handle action failure right after external call to better detect out of gas errors\\n (success_, result_) = action_.target.call{ value: action_.value }(action_.data);\\n\\n if (!success_) {\\n _handleActionFailure(i, result_);\\n }\\n\\n // reset _transientAllowHash to prevent reentrancy during actions execution\\n _resetTransientStorage();\\n } else {\\n // either operation does not exist or the id was not set according to what the action wants to execute\\n revert(string.concat(Strings.toString(i), \\\"_FLUID__INVALID_ID_OR_OPERATION\\\"));\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev handles failure of an action execution depending on error cause,\\n /// decoding and reverting with `result_` as reason string.\\n function _handleActionFailure(uint256 i_, bytes memory result_) internal pure {\\n revert(string.concat(Strings.toString(i_), _getRevertReasonFromReturnedData(result_)));\\n }\\n\\n uint256 internal constant REVERT_REASON_MAX_LENGTH = 250;\\n\\n /// @dev Get the revert reason from the returnedData (supports Panic, Error & Custom Errors).\\n /// Based on https://github.com/superfluid-finance/protocol-monorepo/blob/dev/packages/ethereum-contracts/contracts/libs/CallUtils.sol\\n /// This is needed in order to provide some human-readable revert message from a call.\\n /// @param returnedData_ revert data of the call\\n /// @return reason_ revert reason\\n function _getRevertReasonFromReturnedData(\\n bytes memory returnedData_\\n ) internal pure returns (string memory reason_) {\\n if (returnedData_.length < 4) {\\n // case 1: catch all\\n return \\\"_REASON_NOT_DEFINED\\\";\\n }\\n\\n bytes4 errorSelector_;\\n assembly {\\n errorSelector_ := mload(add(returnedData_, 0x20))\\n }\\n if (errorSelector_ == bytes4(0x4e487b71)) {\\n // case 2: Panic(uint256), selector 0x4e487b71 (Defined since 0.8.0)\\n // ref: https://docs.soliditylang.org/en/v0.8.0/control-structures.html#panic-via-assert-and-error-via-require)\\n\\n // convert last byte to hex digits -> string to decode the panic code\\n bytes memory result_ = new bytes(2);\\n result_[0] = _toHexDigit(uint8(returnedData_[returnedData_.length - 1]) / 16);\\n result_[1] = _toHexDigit(uint8(returnedData_[returnedData_.length - 1]) % 16);\\n reason_ = string.concat(\\\"_TARGET_PANICKED: 0x\\\", string(result_));\\n } else if (errorSelector_ == bytes4(0x08c379a0)) {\\n // case 3: Error(string), selector 0x08c379a0 (Defined at least since 0.7.0)\\n // based on https://ethereum.stackexchange.com/a/83577\\n assembly {\\n returnedData_ := add(returnedData_, 0x04)\\n }\\n reason_ = string.concat(\\\"_\\\", abi.decode(returnedData_, (string)));\\n } else {\\n // case 4: Custom errors (Defined since 0.8.0)\\n\\n // convert bytes4 selector to string, params are ignored...\\n // based on https://ethereum.stackexchange.com/a/111876\\n bytes memory result_ = new bytes(8);\\n for (uint256 i; i < 4; ) {\\n // use unchecked as i is < 4 and division. also errorSelector can not underflow\\n unchecked {\\n result_[2 * i] = _toHexDigit(uint8(errorSelector_[i]) / 16);\\n result_[2 * i + 1] = _toHexDigit(uint8(errorSelector_[i]) % 16);\\n ++i;\\n }\\n }\\n reason_ = string.concat(\\\"_CUSTOM_ERROR: 0x\\\", string(result_));\\n }\\n\\n {\\n // truncate reason_ string to REVERT_REASON_MAX_LENGTH for reserveGas used to ensure Cast event is emitted\\n if (bytes(reason_).length > REVERT_REASON_MAX_LENGTH) {\\n bytes memory reasonBytes_ = bytes(reason_);\\n uint256 maxLength_ = REVERT_REASON_MAX_LENGTH + 1; // cheaper than <= in each loop\\n bytes memory truncatedRevertReason_ = new bytes(maxLength_);\\n for (uint256 i; i < maxLength_; ) {\\n truncatedRevertReason_[i] = reasonBytes_[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n reason_ = string(truncatedRevertReason_);\\n }\\n }\\n }\\n\\n /// @dev used to convert bytes4 selector to string\\n function _toHexDigit(uint8 d) internal pure returns (bytes1) {\\n // use unchecked as the operations with d can not over / underflow\\n unchecked {\\n if (d < 10) {\\n return bytes1(uint8(bytes1(\\\"0\\\")) + d);\\n }\\n if (d < 16) {\\n return bytes1(uint8(bytes1(\\\"a\\\")) + d - 10);\\n }\\n }\\n revert FluidWallet__ToHexDigit();\\n }\\n}\",\"keccak256\":\"0x25e142db3b0762963700680f1fadb431e8331b0d95d8721cd1a4e543aa8d6012\",\"license\":\"BUSL-1.1\"},\"contracts/protocols/vault/interfaces/iVaultFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\nimport { IERC721Enumerable } from \\\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\\\";\\n\\ninterface IFluidVaultFactory is IERC721Enumerable {\\n /// @notice Minting an NFT Vault for the user\\n function mint(uint256 vaultId_, address user_) external returns (uint256 tokenId_);\\n\\n /// @notice returns owner of Vault which is also an NFT\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /// @notice Global auth is auth for all vaults\\n function isGlobalAuth(address auth_) external view returns (bool);\\n\\n /// @notice Vault auth is auth for a specific vault\\n function isVaultAuth(address vault_, address auth_) external view returns (bool);\\n\\n /// @notice Total vaults deployed.\\n function totalVaults() external view returns (uint256);\\n\\n /// @notice Compute vaultAddress\\n function getVaultAddress(uint256 vaultId) external view returns (address);\\n\\n /// @notice read uint256 `result_` for a storage `slot_` key\\n function readFromStorage(bytes32 slot_) external view returns (uint256 result_);\\n}\\n\",\"keccak256\":\"0xc4a0caed89a8670e1ccf159d03fa23bb29f69c579f522bb0e33b1b5cb106c40d\",\"license\":\"MIT\"},\"contracts/protocols/vault/interfaces/iVaultT1.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IFluidVaultT1 {\\n /// @notice returns the vault id\\n function VAULT_ID() external view returns (uint256);\\n\\n /// @notice reads uint256 data `result_` from storage at a bytes32 storage `slot_` key.\\n function readFromStorage(bytes32 slot_) external view returns (uint256 result_);\\n\\n struct ConstantViews {\\n address liquidity;\\n address factory;\\n address adminImplementation;\\n address secondaryImplementation;\\n address supplyToken;\\n address borrowToken;\\n uint8 supplyDecimals;\\n uint8 borrowDecimals;\\n uint vaultId;\\n bytes32 liquiditySupplyExchangePriceSlot;\\n bytes32 liquidityBorrowExchangePriceSlot;\\n bytes32 liquidityUserSupplySlot;\\n bytes32 liquidityUserBorrowSlot;\\n }\\n\\n /// @notice returns all Vault constants\\n function constantsView() external view returns (ConstantViews memory constantsView_);\\n\\n /// @notice fetches the latest user position after a liquidation\\n function fetchLatestPosition(\\n int256 positionTick_,\\n uint256 positionTickId_,\\n uint256 positionRawDebt_,\\n uint256 tickData_\\n )\\n external\\n view\\n returns (\\n int256, // tick\\n uint256, // raw debt\\n uint256, // raw collateral\\n uint256, // branchID_\\n uint256 // branchData_\\n );\\n\\n /// @notice calculates the updated vault exchange prices\\n function updateExchangePrices(\\n uint256 vaultVariables2_\\n )\\n external\\n view\\n returns (\\n uint256 liqSupplyExPrice_,\\n uint256 liqBorrowExPrice_,\\n uint256 vaultSupplyExPrice_,\\n uint256 vaultBorrowExPrice_\\n );\\n\\n /// @notice calculates the updated vault exchange prices and writes them to storage\\n function updateExchangePricesOnStorage()\\n external\\n returns (\\n uint256 liqSupplyExPrice_,\\n uint256 liqBorrowExPrice_,\\n uint256 vaultSupplyExPrice_,\\n uint256 vaultBorrowExPrice_\\n );\\n\\n /// @notice returns the liquidity contract address\\n function LIQUIDITY() external view returns (address);\\n\\n function operate(\\n uint256 nftId_, // if 0 then new position\\n int256 newCol_, // if negative then withdraw\\n int256 newDebt_, // if negative then payback\\n address to_ // address at which the borrow & withdraw amount should go to. If address(0) then it'll go to msg.sender\\n )\\n external\\n payable\\n returns (\\n uint256, // nftId_\\n int256, // final supply amount. if - then withdraw\\n int256 // final borrow amount. if - then payback\\n );\\n \\n function liquidate(\\n uint256 debtAmt_,\\n uint256 colPerUnitDebt_, // min collateral needed per unit of debt in 1e18\\n address to_,\\n bool absorb_\\n ) external payable returns (uint actualDebtAmt_, uint actualColAmt_);\\n\\n function absorb() external;\\n\\n function rebalance() external payable returns (int supplyAmt_, int borrowAmt_);\\n\\n error FluidLiquidateResult(uint256 colLiquidated, uint256 debtLiquidated);\\n}\\n\",\"keccak256\":\"0xe0ec40a4531ecbcd7b8db25b4cd8529e0c284bb20eb40b7cf909fb8af0e3ca8b\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60c06040523480156200001157600080fd5b506040516200282938038062002829833981016040819052620000349162000069565b6001600160a01b039182166080521660a052620000a1565b80516001600160a01b03811681146200006457600080fd5b919050565b600080604083850312156200007d57600080fd5b62000088836200004c565b915062000098602084016200004c565b90509250929050565b60805160a05161272b620000fe6000396000818160f0015281816102dd0152818161067f015261074501526000818161013c0152818161021f015281816103d4015281816104ac01528181610b270152610c1e015261272b6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b1461015e578063920f5c841461017e578063a734f06e146101a1578063ffa1ad74146101bc57600080fd5b8063150b7a021461008d57806357b7bf20146100d65780636ff66e79146100eb5780638a1c736414610137575b600080fd5b6100a061009b366004611b8f565b610205565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100e96100e4366004611ead565b610583565b005b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100cd565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6000546101129073ffffffffffffffffffffffffffffffffffffffff1681565b61019161018c366004611f27565b6105cc565b60405190151581526020016100cd565b61011273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6101f86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516100cd9190612070565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610276576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146102db576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610360576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061036f84860186612083565b9150915061037c82610678565b61038581610815565b61038e60018055565b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101879052309073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa15801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043f91906120de565b73ffffffffffffffffffffffffffffffffffffffff1603610509576040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018890527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050505b6105138287610b23565b604051869073ffffffffffffffffffffffffffffffffffffffff8416907f6f6c6d78a4851d4c222c8404fc92372ee84b7b81054305ae8ea3c83c2dabd42e90600090a3507f150b7a0200000000000000000000000000000000000000000000000000000000979650505050505050565b61058c33610678565b61059581610815565b61059e60018055565b60405133907fd2c4fe7e5a558f9b1b406ce6cd257540e044fe92fa299597ed9656533c6a8c8d90600090a250565b60008282426040516020016105e3939291906120fb565b6040516020818303038152906040528051906020012060015414801561061e575073ffffffffffffffffffffffffffffffffffffffff841630145b610654576040517f38b760c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61066861066383850185611ead565b610815565b5060019998505050505050505050565b60006107c07f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ba8df43c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070c91906120de565b6040805173ffffffffffffffffffffffffffffffffffffffff8616602082015201604051602081830303815290604052805190602001207f000000000000000000000000000000000000000000000000000000000000000060405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b905073ffffffffffffffffffffffffffffffffffffffff81163014610811576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b805160005b81811015610b1e57600083828151811061083657610836612152565b6020026020010151905060006060826060015160ff166000036108e157826000015173ffffffffffffffffffffffffffffffffffffffff16836040015184602001516040516108859190612181565b60006040518083038185875af1925050503d80600081146108c2576040519150601f19603f3d011682016040523d82523d6000602084013e6108c7565b606091505b509092509050816108dc576108dc8482610f54565b610b10565b826060015160ff1660010361097b57826000015173ffffffffffffffffffffffffffffffffffffffff16836020015160405161091d9190612181565b600060405180830381855af49150503d8060008114610958576040519150601f19603f3d011682016040523d82523d6000602084013e61095d565b606091505b50909250905061096c60018055565b816108dc576108dc8482610f54565b826060015160ff16600203610a9057602083015160048101805190916109a991810160249081019101612248565b506040519094506109c39350849250429150602001612360565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206001558651918701519087015173ffffffffffffffffffffffffffffffffffffffff909216929091610a2a91612181565b60006040518083038185875af1925050503d8060008114610a67576040519150601f19603f3d011682016040523d82523d6000602084013e610a6c565b606091505b50909350915082610a8157610a818583610f54565b610a8a60018055565b50610b10565b610a9984610f77565b604051602001610aa99190612382565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610b0791600401612070565b60405180910390fd5b83600101935050505061081a565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b5c736e4610b6c600385611035565b6040518263ffffffff1660e01b8152600401610b8a91815260200190565b602060405180830381865afa158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb91906123c3565b6040517fe6bd26a200000000000000000000000000000000000000000000000000000000815260c082901c63ffffffff16600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e6bd26a290602401602060405180830381865afa158015610c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8991906120de565b905060008173ffffffffffffffffffffffffffffffffffffffff1663b7791bf26040518163ffffffff1660e01b81526004016101a060405180830381865afa158015610cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfd91906123e7565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16816080015173ffffffffffffffffffffffffffffffffffffffff1603610d6157478015610d5b57610d5b8682611064565b50610e26565b60808101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610dd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df691906123c3565b90508015610e24576080820151610e249073ffffffffffffffffffffffffffffffffffffffff1687836111be565b505b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168160a0015173ffffffffffffffffffffffffffffffffffffffff1603610e8857478015610e8257610e828682611064565b50610f4d565b60a08101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906123c3565b90508015610f4b5760a0820151610f4b9073ffffffffffffffffffffffffffffffffffffffff1687836111be565b505b5050505050565b610f5d82610f77565b610f668261124b565b604051602001610aa99291906124c4565b60606000610f84836116c0565b600101905060008167ffffffffffffffff811115610fa457610fa4611c02565b6040519080825280601f01601f191660200182016040528015610fce576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610fd857509392505050565b604080516020808201849052818301859052825180830384018152606090920190925280519101205b92915050565b804710156110ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b07565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611128576040519150601f19603f3d011682016040523d82523d6000602084013e61112d565b606091505b5050905080610b1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b07565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b1e9084906117a2565b606060048251101561129057505060408051808201909152601381527f5f524541534f4e5f4e4f545f444546494e454400000000000000000000000000602082015290565b60208201517fb1b7848f000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000082160161141c5760408051600280825281830190925260009160208201818036833701905050905061133a601085600187516113139190612551565b8151811061132357611323612152565b0160200151611335919060f81c612564565b6118ae565b8160008151811061134d5761134d612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113b2601085600187516113909190612551565b815181106113a0576113a0612152565b0160200151611335919060f81c612586565b816001815181106113c5576113c5612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060405160200161140591906125a8565b6040516020818303038152906040529250506115e0565b7ff73c8660000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016114a5576004830192508280602001905181019061147f91906125ed565b60405160200161148f9190612636565b60405160208183030381529060405291506115e0565b60408051600880825281830190925260009160208201818036833701905050905060005b60048110156115bb576114fd60108483600481106114e9576114e9612152565b1a816114f7576114f76124f3565b046118ae565b82826002028151811061151257611512612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061156c601084836004811061155857611558612152565b1a81611566576115666124f3565b066118ae565b82826002026001018151811061158457611584612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016114c9565b50806040516020016115cd919061267b565b6040516020818303038152906040529250505b60fa825111156116ba578160006115f960fa60016126c0565b905060008167ffffffffffffffff81111561161657611616611c02565b6040519080825280601f01601f191660200182016040528015611640576020820181803683370190505b50905060005b828110156116b45783818151811061166057611660612152565b602001015160f81c60f81b82828151811061167d5761167d612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611646565b50935050505b50919050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611709577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611735576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061175357662386f26fc10000830492506010015b6305f5e100831061176b576305f5e100830492506008015b612710831061177f57612710830492506004015b60648310611791576064830492506002015b600a831061105e5760010192915050565b6000611804826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661190e9092919063ffffffff16565b805190915015610b1e578080602001905181019061182291906126d3565b610b1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b07565b6000600a8260ff1610156118c6575060300160f81b90565b60108260ff1610156118dc575060570160f81b90565b6040517fb0b8d61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606061191d8484600085611927565b90505b9392505050565b6060824710156119b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b07565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516119e29190612181565b60006040518083038185875af1925050503d8060008114611a1f576040519150601f19603f3d011682016040523d82523d6000602084013e611a24565b606091505b5091509150611a3587838387611a42565b925050505b949350505050565b60608315611ad8578251600003611ad15773ffffffffffffffffffffffffffffffffffffffff85163b611ad1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b07565b5081611a3a565b611a3a8383815115611aed5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b079190612070565b73ffffffffffffffffffffffffffffffffffffffff81168114611b4357600080fd5b50565b60008083601f840112611b5857600080fd5b50813567ffffffffffffffff811115611b7057600080fd5b602083019150836020828501011115611b8857600080fd5b9250929050565b600080600080600060808688031215611ba757600080fd5b8535611bb281611b21565b94506020860135611bc281611b21565b935060408601359250606086013567ffffffffffffffff811115611be557600080fd5b611bf188828901611b46565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611c5457611c54611c02565b60405290565b6040516101a0810167ffffffffffffffff81118282101715611c5457611c54611c02565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611cc557611cc5611c02565b604052919050565b600067ffffffffffffffff821115611ce757611ce7611c02565b5060051b60200190565b600067ffffffffffffffff821115611d0b57611d0b611c02565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60ff81168114611b4357600080fd5b8035611d5181611d37565b919050565b600082601f830112611d6757600080fd5b81356020611d7c611d7783611ccd565b611c7e565b82815260059290921b84018101918181019086841115611d9b57600080fd5b8286015b84811015611ea257803567ffffffffffffffff80821115611dc05760008081fd5b81890191506080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215611df95760008081fd5b611e01611c31565b87840135611e0e81611b21565b815260408481013584811115611e245760008081fd5b85019350603f84018d13611e385760008081fd5b88840135611e48611d7782611cf1565b8181528e83838801011115611e5d5760008081fd5b818387018c83013760008b8383010152808b850152505060609350838501358183015250611e8c828501611d46565b9281019290925250845250918301918301611d9f565b509695505050505050565b600060208284031215611ebf57600080fd5b813567ffffffffffffffff811115611ed657600080fd5b611a3a84828501611d56565b60008083601f840112611ef457600080fd5b50813567ffffffffffffffff811115611f0c57600080fd5b6020830191508360208260051b8501011115611b8857600080fd5b600080600080600080600080600060a08a8c031215611f4557600080fd5b893567ffffffffffffffff80821115611f5d57600080fd5b611f698d838e01611ee2565b909b50995060208c0135915080821115611f8257600080fd5b611f8e8d838e01611ee2565b909950975060408c0135915080821115611fa757600080fd5b611fb38d838e01611ee2565b909750955060608c01359150611fc882611b21565b90935060808b01359080821115611fde57600080fd5b50611feb8c828d01611b46565b915080935050809150509295985092959850929598565b60005b8381101561201d578181015183820152602001612005565b50506000910152565b6000815180845261203e816020860160208601612002565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006119206020830184612026565b6000806040838503121561209657600080fd5b82356120a181611b21565b9150602083013567ffffffffffffffff8111156120bd57600080fd5b6120c985828601611d56565b9150509250929050565b8051611d5181611b21565b6000602082840312156120f057600080fd5b815161192081611b21565b6040815282604082015282846060830137600060608483010152600060607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601168301019050826020830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008251612193818460208701612002565b9190910192915050565b600082601f8301126121ae57600080fd5b815160206121be611d7783611ccd565b82815260059290921b840181019181810190868411156121dd57600080fd5b8286015b84811015611ea257805183529183019183016121e1565b6000612206611d7784611cf1565b905082815283838301111561221a57600080fd5b611920836020830184612002565b600082601f83011261223957600080fd5b611920838351602085016121f8565b600080600080600060a0868803121561226057600080fd5b855167ffffffffffffffff8082111561227857600080fd5b818801915088601f83011261228c57600080fd5b8151602061229c611d7783611ccd565b82815260059290921b8401810191818101908c8411156122bb57600080fd5b948201945b838610156122e25785516122d381611b21565b825294820194908201906122c0565b918b01519199509093505050808211156122fb57600080fd5b61230789838a0161219d565b955060408801519450606088015191508082111561232457600080fd5b61233089838a01612228565b9350608088015191508082111561234657600080fd5b5061235388828901612228565b9150509295509295909350565b6040815260006123736040830185612026565b90508260208301529392505050565b60008251612394818460208701612002565b7f5f464c5549445f5f494e56414c49445f49445f4f525f4f5045524154494f4e00920191825250601f01919050565b6000602082840312156123d557600080fd5b5051919050565b8051611d5181611d37565b60006101a082840312156123fa57600080fd5b612402611c5a565b61240b836120d3565b8152612419602084016120d3565b602082015261242a604084016120d3565b604082015261243b606084016120d3565b606082015261244c608084016120d3565b608082015261245d60a084016120d3565b60a082015261246e60c084016123dc565b60c082015261247f60e084016123dc565b60e08201526101008381015190820152610120808401519082015261014080840151908201526101608084015190820152610180928301519281019290925250919050565b600083516124d6818460208801612002565b8351908301906124ea818360208801612002565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561105e5761105e612522565b600060ff831680612577576125776124f3565b8060ff84160491505092915050565b600060ff831680612599576125996124f3565b8060ff84160691505092915050565b7f5f5441524745545f50414e49434b45443a2030780000000000000000000000008152600082516125e0816014850160208701612002565b9190910160140192915050565b6000602082840312156125ff57600080fd5b815167ffffffffffffffff81111561261657600080fd5b8201601f8101841361262757600080fd5b611a3a848251602084016121f8565b7f5f0000000000000000000000000000000000000000000000000000000000000081526000825161266e816001850160208701612002565b9190910160010192915050565b7f5f435553544f4d5f4552524f523a2030780000000000000000000000000000008152600082516126b3816011850160208701612002565b9190910160110192915050565b8082018082111561105e5761105e612522565b6000602082840312156126e557600080fd5b8151801515811461192057600080fdfea264697066735822122097aafa9c697baa1a7f32f3965bc1e87dcabcf1b611f5ec941cd1124dadee748664736f6c63430008150033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b1461015e578063920f5c841461017e578063a734f06e146101a1578063ffa1ad74146101bc57600080fd5b8063150b7a021461008d57806357b7bf20146100d65780636ff66e79146100eb5780638a1c736414610137575b600080fd5b6100a061009b366004611b8f565b610205565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100e96100e4366004611ead565b610583565b005b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100cd565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6000546101129073ffffffffffffffffffffffffffffffffffffffff1681565b61019161018c366004611f27565b6105cc565b60405190151581526020016100cd565b61011273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6101f86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516100cd9190612070565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610276576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146102db576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610360576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061036f84860186612083565b9150915061037c82610678565b61038581610815565b61038e60018055565b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101879052309073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa15801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043f91906120de565b73ffffffffffffffffffffffffffffffffffffffff1603610509576040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018890527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050505b6105138287610b23565b604051869073ffffffffffffffffffffffffffffffffffffffff8416907f6f6c6d78a4851d4c222c8404fc92372ee84b7b81054305ae8ea3c83c2dabd42e90600090a3507f150b7a0200000000000000000000000000000000000000000000000000000000979650505050505050565b61058c33610678565b61059581610815565b61059e60018055565b60405133907fd2c4fe7e5a558f9b1b406ce6cd257540e044fe92fa299597ed9656533c6a8c8d90600090a250565b60008282426040516020016105e3939291906120fb565b6040516020818303038152906040528051906020012060015414801561061e575073ffffffffffffffffffffffffffffffffffffffff841630145b610654576040517f38b760c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61066861066383850185611ead565b610815565b5060019998505050505050505050565b60006107c07f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ba8df43c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070c91906120de565b6040805173ffffffffffffffffffffffffffffffffffffffff8616602082015201604051602081830303815290604052805190602001207f000000000000000000000000000000000000000000000000000000000000000060405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b905073ffffffffffffffffffffffffffffffffffffffff81163014610811576040517f52df424e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b805160005b81811015610b1e57600083828151811061083657610836612152565b6020026020010151905060006060826060015160ff166000036108e157826000015173ffffffffffffffffffffffffffffffffffffffff16836040015184602001516040516108859190612181565b60006040518083038185875af1925050503d80600081146108c2576040519150601f19603f3d011682016040523d82523d6000602084013e6108c7565b606091505b509092509050816108dc576108dc8482610f54565b610b10565b826060015160ff1660010361097b57826000015173ffffffffffffffffffffffffffffffffffffffff16836020015160405161091d9190612181565b600060405180830381855af49150503d8060008114610958576040519150601f19603f3d011682016040523d82523d6000602084013e61095d565b606091505b50909250905061096c60018055565b816108dc576108dc8482610f54565b826060015160ff16600203610a9057602083015160048101805190916109a991810160249081019101612248565b506040519094506109c39350849250429150602001612360565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206001558651918701519087015173ffffffffffffffffffffffffffffffffffffffff909216929091610a2a91612181565b60006040518083038185875af1925050503d8060008114610a67576040519150601f19603f3d011682016040523d82523d6000602084013e610a6c565b606091505b50909350915082610a8157610a818583610f54565b610a8a60018055565b50610b10565b610a9984610f77565b604051602001610aa99190612382565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610b0791600401612070565b60405180910390fd5b83600101935050505061081a565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b5c736e4610b6c600385611035565b6040518263ffffffff1660e01b8152600401610b8a91815260200190565b602060405180830381865afa158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb91906123c3565b6040517fe6bd26a200000000000000000000000000000000000000000000000000000000815260c082901c63ffffffff16600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e6bd26a290602401602060405180830381865afa158015610c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8991906120de565b905060008173ffffffffffffffffffffffffffffffffffffffff1663b7791bf26040518163ffffffff1660e01b81526004016101a060405180830381865afa158015610cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfd91906123e7565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16816080015173ffffffffffffffffffffffffffffffffffffffff1603610d6157478015610d5b57610d5b8682611064565b50610e26565b60808101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610dd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df691906123c3565b90508015610e24576080820151610e249073ffffffffffffffffffffffffffffffffffffffff1687836111be565b505b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168160a0015173ffffffffffffffffffffffffffffffffffffffff1603610e8857478015610e8257610e828682611064565b50610f4d565b60a08101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906123c3565b90508015610f4b5760a0820151610f4b9073ffffffffffffffffffffffffffffffffffffffff1687836111be565b505b5050505050565b610f5d82610f77565b610f668261124b565b604051602001610aa99291906124c4565b60606000610f84836116c0565b600101905060008167ffffffffffffffff811115610fa457610fa4611c02565b6040519080825280601f01601f191660200182016040528015610fce576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610fd857509392505050565b604080516020808201849052818301859052825180830384018152606090920190925280519101205b92915050565b804710156110ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b07565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611128576040519150601f19603f3d011682016040523d82523d6000602084013e61112d565b606091505b5050905080610b1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b07565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b1e9084906117a2565b606060048251101561129057505060408051808201909152601381527f5f524541534f4e5f4e4f545f444546494e454400000000000000000000000000602082015290565b60208201517fb1b7848f000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000082160161141c5760408051600280825281830190925260009160208201818036833701905050905061133a601085600187516113139190612551565b8151811061132357611323612152565b0160200151611335919060f81c612564565b6118ae565b8160008151811061134d5761134d612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113b2601085600187516113909190612551565b815181106113a0576113a0612152565b0160200151611335919060f81c612586565b816001815181106113c5576113c5612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060405160200161140591906125a8565b6040516020818303038152906040529250506115e0565b7ff73c8660000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016114a5576004830192508280602001905181019061147f91906125ed565b60405160200161148f9190612636565b60405160208183030381529060405291506115e0565b60408051600880825281830190925260009160208201818036833701905050905060005b60048110156115bb576114fd60108483600481106114e9576114e9612152565b1a816114f7576114f76124f3565b046118ae565b82826002028151811061151257611512612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061156c601084836004811061155857611558612152565b1a81611566576115666124f3565b066118ae565b82826002026001018151811061158457611584612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016114c9565b50806040516020016115cd919061267b565b6040516020818303038152906040529250505b60fa825111156116ba578160006115f960fa60016126c0565b905060008167ffffffffffffffff81111561161657611616611c02565b6040519080825280601f01601f191660200182016040528015611640576020820181803683370190505b50905060005b828110156116b45783818151811061166057611660612152565b602001015160f81c60f81b82828151811061167d5761167d612152565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611646565b50935050505b50919050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611709577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611735576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061175357662386f26fc10000830492506010015b6305f5e100831061176b576305f5e100830492506008015b612710831061177f57612710830492506004015b60648310611791576064830492506002015b600a831061105e5760010192915050565b6000611804826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661190e9092919063ffffffff16565b805190915015610b1e578080602001905181019061182291906126d3565b610b1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b07565b6000600a8260ff1610156118c6575060300160f81b90565b60108260ff1610156118dc575060570160f81b90565b6040517fb0b8d61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606061191d8484600085611927565b90505b9392505050565b6060824710156119b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b07565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516119e29190612181565b60006040518083038185875af1925050503d8060008114611a1f576040519150601f19603f3d011682016040523d82523d6000602084013e611a24565b606091505b5091509150611a3587838387611a42565b925050505b949350505050565b60608315611ad8578251600003611ad15773ffffffffffffffffffffffffffffffffffffffff85163b611ad1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b07565b5081611a3a565b611a3a8383815115611aed5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b079190612070565b73ffffffffffffffffffffffffffffffffffffffff81168114611b4357600080fd5b50565b60008083601f840112611b5857600080fd5b50813567ffffffffffffffff811115611b7057600080fd5b602083019150836020828501011115611b8857600080fd5b9250929050565b600080600080600060808688031215611ba757600080fd5b8535611bb281611b21565b94506020860135611bc281611b21565b935060408601359250606086013567ffffffffffffffff811115611be557600080fd5b611bf188828901611b46565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611c5457611c54611c02565b60405290565b6040516101a0810167ffffffffffffffff81118282101715611c5457611c54611c02565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611cc557611cc5611c02565b604052919050565b600067ffffffffffffffff821115611ce757611ce7611c02565b5060051b60200190565b600067ffffffffffffffff821115611d0b57611d0b611c02565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60ff81168114611b4357600080fd5b8035611d5181611d37565b919050565b600082601f830112611d6757600080fd5b81356020611d7c611d7783611ccd565b611c7e565b82815260059290921b84018101918181019086841115611d9b57600080fd5b8286015b84811015611ea257803567ffffffffffffffff80821115611dc05760008081fd5b81890191506080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215611df95760008081fd5b611e01611c31565b87840135611e0e81611b21565b815260408481013584811115611e245760008081fd5b85019350603f84018d13611e385760008081fd5b88840135611e48611d7782611cf1565b8181528e83838801011115611e5d5760008081fd5b818387018c83013760008b8383010152808b850152505060609350838501358183015250611e8c828501611d46565b9281019290925250845250918301918301611d9f565b509695505050505050565b600060208284031215611ebf57600080fd5b813567ffffffffffffffff811115611ed657600080fd5b611a3a84828501611d56565b60008083601f840112611ef457600080fd5b50813567ffffffffffffffff811115611f0c57600080fd5b6020830191508360208260051b8501011115611b8857600080fd5b600080600080600080600080600060a08a8c031215611f4557600080fd5b893567ffffffffffffffff80821115611f5d57600080fd5b611f698d838e01611ee2565b909b50995060208c0135915080821115611f8257600080fd5b611f8e8d838e01611ee2565b909950975060408c0135915080821115611fa757600080fd5b611fb38d838e01611ee2565b909750955060608c01359150611fc882611b21565b90935060808b01359080821115611fde57600080fd5b50611feb8c828d01611b46565b915080935050809150509295985092959850929598565b60005b8381101561201d578181015183820152602001612005565b50506000910152565b6000815180845261203e816020860160208601612002565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006119206020830184612026565b6000806040838503121561209657600080fd5b82356120a181611b21565b9150602083013567ffffffffffffffff8111156120bd57600080fd5b6120c985828601611d56565b9150509250929050565b8051611d5181611b21565b6000602082840312156120f057600080fd5b815161192081611b21565b6040815282604082015282846060830137600060608483010152600060607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601168301019050826020830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008251612193818460208701612002565b9190910192915050565b600082601f8301126121ae57600080fd5b815160206121be611d7783611ccd565b82815260059290921b840181019181810190868411156121dd57600080fd5b8286015b84811015611ea257805183529183019183016121e1565b6000612206611d7784611cf1565b905082815283838301111561221a57600080fd5b611920836020830184612002565b600082601f83011261223957600080fd5b611920838351602085016121f8565b600080600080600060a0868803121561226057600080fd5b855167ffffffffffffffff8082111561227857600080fd5b818801915088601f83011261228c57600080fd5b8151602061229c611d7783611ccd565b82815260059290921b8401810191818101908c8411156122bb57600080fd5b948201945b838610156122e25785516122d381611b21565b825294820194908201906122c0565b918b01519199509093505050808211156122fb57600080fd5b61230789838a0161219d565b955060408801519450606088015191508082111561232457600080fd5b61233089838a01612228565b9350608088015191508082111561234657600080fd5b5061235388828901612228565b9150509295509295909350565b6040815260006123736040830185612026565b90508260208301529392505050565b60008251612394818460208701612002565b7f5f464c5549445f5f494e56414c49445f49445f4f525f4f5045524154494f4e00920191825250601f01919050565b6000602082840312156123d557600080fd5b5051919050565b8051611d5181611d37565b60006101a082840312156123fa57600080fd5b612402611c5a565b61240b836120d3565b8152612419602084016120d3565b602082015261242a604084016120d3565b604082015261243b606084016120d3565b606082015261244c608084016120d3565b608082015261245d60a084016120d3565b60a082015261246e60c084016123dc565b60c082015261247f60e084016123dc565b60e08201526101008381015190820152610120808401519082015261014080840151908201526101608084015190820152610180928301519281019290925250919050565b600083516124d6818460208801612002565b8351908301906124ea818360208801612002565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561105e5761105e612522565b600060ff831680612577576125776124f3565b8060ff84160491505092915050565b600060ff831680612599576125996124f3565b8060ff84160691505092915050565b7f5f5441524745545f50414e49434b45443a2030780000000000000000000000008152600082516125e0816014850160208701612002565b9190910160140192915050565b6000602082840312156125ff57600080fd5b815167ffffffffffffffff81111561261657600080fd5b8201601f8101841361262757600080fd5b611a3a848251602084016121f8565b7f5f0000000000000000000000000000000000000000000000000000000000000081526000825161266e816001850160208701612002565b9190910160010192915050565b7f5f435553544f4d5f4552524f523a2030780000000000000000000000000000008152600082516126b3816011850160208701612002565b9190910160110192915050565b8082018082111561105e5761105e612522565b6000602082840312156126e557600080fd5b8151801515811461192057600080fdfea264697066735822122097aafa9c697baa1a7f32f3965bc1e87dcabcf1b611f5ec941cd1124dadee748664736f6c63430008150033",
"devdoc": {
"kind": "dev",
"methods": {
"executeOperation(address[],uint256[],uint256[],address,bytes)": {
"params": {
"data_": "data bytes containing the `abi.encoded()` actions that are executed like in `CastParams.actions`",
"initiator_": "flashloan initiator -> must be this contract"
}
},
"onERC721Received(address,address,uint256,bytes)": {
"details": "ERC721 callback used Fluid Vault Factory and executes actions encoded in `data_` Caller should be Fluid Wallet Factory.",
"params": {
"data_": "data bytes containing the `abi.encoded()` actions that are executed like in `Action[]` & `owner`",
"from_": "from_ previous owner of the given token ID",
"operator_": "operator_ caller to transfer the the given token ID",
"tokenId_": "tokenId_ id of the ERC721"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 39836,
"contract": "contracts/periphery/wallet/wallet/main.sol:FluidWalletImplementation",
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 39839,
"contract": "contracts/periphery/wallet/wallet/main.sol:FluidWalletImplementation",
"label": "_transientAllowHash",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
}
}
}
}